Good afternoon Ladies and Gentlemen,

 

I’m using FreeSWITCH (1.7.0 git cae2553 2015-12-11 00:23:48Z 64bit) as B2BUA between Kamailio and our own Server. Our Server is attached to FreeSWICH via ESL.

From Kamailio into our own Server it is connecting w/o problems. But when I initiate a call from our Server to Kamailio via FreeSWITCH I’ve a weird reaction:

 

Network-Overview:

PSTN(192.168.1.30) à Kamailio(192.168.1.150/10.250.5.74) à FreeSWITCH(10.250.5.72) à Our Server(10.250.5.67)

 

1st Initial Invite to FS:

INVITE sip:7@10.250.5.72 SIP/2.0

   Via: SIP/2.0/UDP 10.250.5.17:5090;branch=z9hG4bK.GSRDySx-y;rport

   From: <sip:1001@10.250.5.72>;tag=nDaJDf3lz

   To: sip:7@10.250.5.72

   Route: <sip:10.250.5.72:5080;lr>

   Content-Type: application/sdp

 

7 is mapped to go to our Server and our Server then is trying to connect to a UA (2031) at PSTN via FreeSWITCH gateway(Kamailio):

INVITE sip:2031@10.250.5.74:5070 SIP/2.0

   Via: SIP/2.0/UDP 10.250.5.72:5070;rport;branch=z9hG4bKmgrc4De2Q0ySN

   From: "" <sip:1001@[10.250.5.72:5070]>;tag=U5jj715ZB6maK

   To: <sip:2031@10.250.5.74:5070>

 

This Invite was built by FreeSWITCH and I could confirm that the „SIP-Invite“ sent via ESL to FreeSWITCH from our Server was correct but as you can see here FreeSWITCH „malformed“ the From-Header with the square brackets and due to that I’m getting error from PSTN later:

 

SIP/2.0 400 Bad Request

   Warning: 399 192.168.1.30 "Malformed headers : From "

   To: <sip:2031@10.250.5.74:5070>;tag=ae0f6cb7ca85c1fb958bd8bed1f9b7b7

 

Here some config data that is set in FreeSWITCH:

Vars.xml:

  <X-PRE-PROCESS cmd="set" data="domain=10.250.5.72"/>

  <X-PRE-PROCESS cmd="set" data="external_sip_port=5070"/>

  <X-PRE-PROCESS cmd="set" data="internal_sip_port=5080"/>

 

Sip-profiles/external/testpbx.xml:

<include>

  <gateway name="testpbx">

  <param name="realm" value="10.250.5.74:5070"/>

  <param name="from-domain" value="10.250.5.72:5070"/>

  <param name="proxy" value="10.250.5.74:5070"/>

  …

  </gateway>

</include>

 

Sip-profiles/external.xml and internal.xml:

    <param name="rtp-ip" value="10.250.5.72"/>

    <param name="sip-ip" value="10.250.5.72"/>

    <param name="ext-rtp-ip" value="10.250.5.72"/>

    <param name="ext-sip-ip" value="10.250.5.72"/>

 

Can anyone help why FreeSWITCH is doing this or can point to a class where the the From Header is built? Maybe someone knows a solution?

Here you can find full SIP-Trace Logs and Full FreeSWITCH Debugging Log: https://we.tl/FtPuknRrSw

 

 

Very Respectfully

Dimitry Nagorny

Trainee