Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple network interface does not work and others problems #11

Open
pascal-pro opened this issue Nov 18, 2020 · 2 comments
Open

Multiple network interface does not work and others problems #11

pascal-pro opened this issue Nov 18, 2020 · 2 comments

Comments

@pascal-pro
Copy link

I'm trying to use your pkg, and I find myself facing multiple worries.

First of all, in the endpoint.go file, the GetNetworkInfo function doesn't take the value Endpoint.ip

It makes errors when sending a call, or the caller can't find his interlocutor.
in the logs of my sip server, I have two different IPs, in LAN IP I have address 1 and in IP I have address 2.

Here is the function that works:

func (e EndPoint) GetNetworkInfo(protocol string) *transport.Target {
	//logger := e.Log() // Comment this because UNUSED 

	var target transport.Target

	target.Host = e.ip.String() //CHANGE HERE
	//the check do in the creation of the endpoint

	network := strings.ToUpper(protocol)
	if p, ok := e.listenPorts[network]; ok {
		target.Port = p
	} else {
		defPort := transport.DefaultPort(network)
		target.Port = &defPort
	}
	return &target
}

My second concern is the receptionand sending of audio, I can't find any example or any function allowing me to read or write the streams.
Thank you for making this library :D

@Windforce17
Copy link

The SIP Stack seem to find a wrong network interface,and write a wrong ip address to sip protocol.Because the lib create sip stack in advacnce,and then listen to a udp port.So the SipStackConfig.Host has been set a wrong address, unless you set a correct host.

@Windforce17
Copy link

SIP protocol not handle other data transform. In my case,the audio data encoded by PCMU and use RTP protocol.This information defined in sip's payload by sdp protocol:

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.100.27:5060;branch=z9hG4bK.LXjpfN0we17IlFyjNLBbxL30NJbsuYz7
From: "nightingale" <sip:666666666@6.6.6.6:5060>;tag=Qp1Mmnwu
To: <sip:01234567@6.6.6.6>;tag=7cf111ddb4ae263d724df31f014fa639
Call-ID: COFVXP23YzwPjHNxqMsDC6TRmwxlQflc
CSeq: 1 INVITE
Contact: "Anonymous" <sip:6.6.6.6:5060>
Content-Type: application/sdp
Content-Length: 192

v=0
o=- 8395 8395 IN IP4 7.7.7.7.7
s=-
c=IN IP4 7.7.7.7.7
t=0 0
m=audio 15520 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

the sip server(6.6.6.6) use rtp protocol and PCMU format to transform data through 7.7.7.7:15520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants