[Freeswitch-users] FS uses external IP address for Contact in 200 to internal server

M Yudkowsky speech at pobox.com
Thu May 24 20:43:35 UTC 2018


I'm using FreeSWITCH (FS) as a proxy between an internal server that makes calls and an external SIP provider. The internal server is a speech recognition server that has a telephony component to originate and terminate calls.

Here's the sequence of messages between the internal server (IS) and FS:

Starting the call, we see:

IS (internal IP)  == INVITE ==> FS (internal IP)
IS (internal IP)  <== 100 == FS (internal IP)
IS (internal IP)  <== 183 == FS (internal IP)

   FS gets a connection to SIP provider, and the internal call continues:

IS (internal IP)  <== 200 OK == FS (internal IP)

   But the 200 OK from FS contains, in the Contact field, the *external* IP address:
   Contact: <sip:xxxxx@(external IP):5060;transport=udp>
   As a result, the IS sends a response to the *external* IP address:

IS (external IP)  == ACK ==> FS (external IP)

   FS resends several 200's, which IS properly ignores.
   Eventually FS gives up on hearing from IS and sends a 
   BYE with a Reason of 408 ACK Timeout.

I'm not clear which server is to "blame," if either. FS has "inbound-proxy-media" set to true in (my-dialplan).xml, and I would therefore expect that the Contact field would treat internal servers as internal and use internal IP addresses exclusively. Or is FS correct? Is the problem that IS attempting to do NAT based on the Contact and making an error? (I tried disabling IS's NAT, and almost certainly did it correctly, but that does not seem to help.)

Variables set in (my_dialplan).xml:

<param name="inbound-proxy-media" value="true"/>
<param name="local-network-acl" value="localnet.auto"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>

And the next two were added on in an attempt to fix this, but failed to do so:

<param name="aggressive-nat-detection" value="true"/>
<param name="NDLB-force-rport" value="true"/>

So, any ideas?

  Moshe Yudkowsky
  Disaggregate Corporation
  2952 W Fargo
  Chicago, IL 60645 USA

  +1 773 764 8727
   speech at pobox.com


More information about the FreeSWITCH-users mailing list