[Freeswitch-users] FreeSWITCH malforming SIP Package

Nagorny, Dimitry dimitry.nagorny at robot5.de
Mon Apr 11 18:44:30 MSD 2016

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:

PSTN( --> Kamailio( --> FreeSWITCH( --> Our Server(

1st Initial Invite to FS:
INVITE sip:7 at SIP/2.0
   Via: SIP/2.0/UDP;branch=z9hG4bK.GSRDySx-y;rport
   From: <sip:1001 at>;tag=nDaJDf3lz
   To: sip:7 at
   Route: <sip:;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 at SIP/2.0
   Via: SIP/2.0/UDP;rport;branch=z9hG4bKmgrc4De2Q0ySN
   From: "" <sip:1001@[]>;tag=U5jj715ZB6maK
   To: <sip:2031 at>

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 "Malformed headers : From "
   To: <sip:2031 at>;tag=ae0f6cb7ca85c1fb958bd8bed1f9b7b7

Here some config data that is set in FreeSWITCH:
  <X-PRE-PROCESS cmd="set" data="domain="/>
  <X-PRE-PROCESS cmd="set" data="external_sip_port=5070"/>
  <X-PRE-PROCESS cmd="set" data="internal_sip_port=5080"/>

  <gateway name="testpbx">
  <param name="realm" value=""/>
  <param name="from-domain" value=""/>
  <param name="proxy" value=""/>

Sip-profiles/external.xml and internal.xml:
    <param name="rtp-ip" value=""/>
    <param name="sip-ip" value=""/>
    <param name="ext-rtp-ip" value=""/>
    <param name="ext-sip-ip" value=""/>

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160411/78f060c4/attachment.html 

Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list