RestComm / sip-servlets

Leading SIP - IMS - WebRTC Application Server
http://www.restcomm.com/
GNU Affero General Public License v3.0
238 stars 181 forks source link

When using 0.0.0.0 as an IP Address for the SIP Connectors, sip-servlets send invite contain wrong VIA head! #79

Open GeorgeShaw opened 8 years ago

GeorgeShaw commented 8 years ago

I use sip-servlets to realize TPCC, when I need deploy it to server with two IP, I using 0.0.0.0 as an IP Address for the SIP Connectors to binding both address, then the problems come: The sip-servlets act as UAC send Invite to UAS, but it contain the wrong VIA head, send-by IP is 0.0.0.0, not the real ip address it use. So, when UAS recelive the invite, UAS cann't reply to the request as 0.0.0.0 describe in VIA head, for UAS donn't kown the real address of UAC. As decribe in RFC 3261, SIP transportation layer should add right Via Head in invite, so the uas can answer it. But now it's wrong.

Log Time

deruelle commented 8 years ago

Which version are you using ?

dbush-vonage commented 8 years ago

I'm seeing this as well. I'm on version 4.0.21-wildfly-8.2.1. This was previously working on 2.1.547-jboss-as-7.2.0. In my case, the remote UAS is still sending the 200 OK, but the 200 is not forwarded to my app because a matching listening point cannot be found for 0.0.0.0.

In the logs, I see:
[org.mobicents.servlet.sip.core.SipNetworkInterfaceManagerImpl] -- (Mobicents-SIP-Servlets-UDPMessageChannelThread-12) Checked Listening Point 0.0.0.0/5060:udp against existing listening points, found null [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] -- (Mobicents-SIP-Servlets-UDPMessageChannelThread-12) the triplet host/port/transport : 0.0.0.0/5060/UDP is external : true [org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher] -- (Mobicents-SIP-Servlets-UDPMessageChannelThread-12) Not forwarding the response statefully. It was either an endpoint or a B2BUA, ie an endpoint too SIP/2.0 200 OK^M ...

dbush-vonage commented 8 years ago

I was able to address this issue by using a static address for the sip connector in standalone-sip.xml:

<connector name="sip-udp" protocol="SIP/2.0" scheme="sip" socket-binding="sip-udp" use-static-address="true" static-server-address="127.0.0.1"/>