[Freeswitch-dev] help to correct sip stack to send to kamailio in mod_sofia

ThanhTruong ngoc217thanh at yahoo.com
Thu Jun 13 07:22:53 MSD 2013


hi all,

I am very new in sofia sip, and I am develop one register module for FS using sofia sip stack.

in FS, when i receive REGISTER message, i am trying to send it to another registrar server (kamailio).

I have implement my code in incoming REGISTER message like:

        nua_set_params(profile->nua,
                   SIPTAG_FROM_STR("sip:101 at 192.168.1.112:5062"),
                   NUTAG_ENABLEMESSAGE(1),
                   NUTAG_ENABLEINVITE(1),
                   NUTAG_AUTOALERT(1),
                   NUTAG_SESSION_TIMER(0),
                   NUTAG_AUTOANSWER(0),
                   TAG_NULL());

        nua_register(nh,
                 NUTAG_PROXY("sip:192.168.1.112:5062"),
                 NUTAG_REGISTRAR("sip:192.168.1.112:5062"), //registra uri
                 SIPTAG_FROM_STR("sip:192.168.1.112:5062"),
                 NUTAG_INSTANCE (0),
                 NUTAG_M_USERNAME("101"),
                 TAG_NULL());

I have one account 101/xxxx in kamailio, i want to register from softphone to FS, FS send register and process authentication with kamailio, then return 200OK back to softphone.

With this code bellow, i send REGISTER message and get response in kamailio as:

send 613 bytes to udp/[192.168.1.112]:5062 at 03:10:42.833439:
   ------------------------------------------------------------------------
   REGISTER sip:101 at 192.168.3.122:42806;rinstance=7742cc70900998e8 SIP/2.0
   Via: SIP/2.0/UDP 192.168.1.112;rport;branch=z9hG4bKBB44UFQ9ySjQK
   Max-Forwards: 70
   From: <sip:192.168.1.112:5062>;tag=DXeN4j2DFt27j
   To: "101" <sip:101 at 192.168.1.112>;tag=cd424d7d
   Call-ID: ac980e34-4e79-1231-71ba-3e508d3991e2
   CSeq: 45210457 REGISTER
   Contact: <sip:101 at 192.168.1.112>
   User-Agent: FreeSWITCH-mod_sofia/1.5.2b+git~20130527T075833Z~f3541e00f4
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
   Supported: timer, precondition, path, replaces
   Content-Length: 0
   

recv 325 bytes from udp/[192.168.1.112]:5062 at 03:10:42.834220:
   ------------------------------------------------------------------------
   SIP/2.0 404 Not here
   Via: SIP/2.0/UDP 192.168.1.112;rport=5060;branch=z9hG4bKBB44UFQ9ySjQK
   From: <sip:192.168.1.112:5062>;tag=DXeN4j2DFt27j
   To: "101" <sip:101 at 192.168.1.112>;tag=cd424d7d
   Call-ID: ac980e34-4e79-1231-71ba-3e508d3991e2
   CSeq: 45210457 REGISTER
   Server: kamailio (4.0.1 (x86_64/linux))
   Content-Length: 0
   

Then, I see that structure of SIP REGISTER message is not correct.

Can some one help me to construct this message to send to kamailio ?
May we dont care about nua_create ? just using nua_set_params or nua_register or nua_options ?

Thank all in advance.
 
ThanhTruong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20130612/7e962c81/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list