<div dir="ltr">Why not put Kamailio in front of the freeswitch server? Then it will handle the register messages, and you can tell it to forward all SIP messages to freeswitch if it was authenticated. Thats the usual way to do it, I would guess.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 13 June 2013 07:36, ThanhTruong <span dir="ltr"><<a href="mailto:ngoc217thanh@yahoo.com" target="_blank">ngoc217thanh@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span>hi,</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span>In mod_sofia, it handle REGISTER message, and I want to route this message to kamailio server, then kamailio will return 401, then, we can use sofia-sip (in UA) to authenticate with kamailio, if 200OK return from kamailio, i will return 200ok back to sip client.</span></div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span>In this case, I think i need to change code in handle register in mod_sofia. But this is in mind, and code in mod_sofia is very complex, I can find where to send REGISTER message to kamailio but message is not correct, kamailio cant understand this message.</span></div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span>Do you have any ideal in my case ?</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span>any code suggestion ?</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span>Thank you in advance .</span></div><span class="HOEnZb"><font color="#888888"><div></div><div> </div><div>ThanhTruong<br></div> </font></span><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">
<span class="HOEnZb"><font color="#888888"> </font></span><div style="font-family:'times new roman','new york',times,serif;font-size:12pt"><span class="HOEnZb"><font color="#888888"> <div dir="ltr"> <hr size="1">
<font face="Arial"> <b><span style="font-weight:bold">From:</span></b> Brian West <<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>><br> <b><span style="font-weight:bold">To:</span></b> <a href="mailto:freeswitch-dev@lists.freeswitch.org" target="_blank">freeswitch-dev@lists.freeswitch.org</a> <br>
<b><span style="font-weight:bold">Sent:</span></b> Thursday, June 13, 2013 12:25 PM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [Freeswitch-dev] help to correct sip stack to send to kamailio
        in mod_sofia<br> </font> </div></font></span><div><div class="h5"> <div><br>Can you explain why you think you need to modify mod_sofia to make this work?<br><br>/b<br><br>On Jun 12, 2013, at 10:22 PM, ThanhTruong <<a href="mailto:ngoc217thanh@yahoo.com" target="_blank">ngoc217thanh@yahoo.com</a>> wrote:<br>
<br>> hi all,<br>> <br>> I am very new in sofia sip, and I am develop one register module for FS using sofia sip stack.<br>> <br>> in FS, when i receive REGISTER message, i am trying to send it to another registrar server (kamailio).<br>
> <br>> I have implement my code in incoming REGISTER message like:<br>> <br>> nua_set_params(profile->nua,<br>> SIPTAG_FROM_STR("sip:<a href="mailto:101@192.168.1.112" target="_blank">101@192.168.1.112</a>:5062"),<br>
>
NUTAG_ENABLEMESSAGE(1),<br>> NUTAG_ENABLEINVITE(1),<br>> NUTAG_AUTOALERT(1),<br>> NUTAG_SESSION_TIMER(0),<br>> NUTAG_AUTOANSWER(0),<br>
> TAG_NULL());<br>> <br>> nua_register(nh,<br>> NUTAG_PROXY("sip:<a href="http://192.168.1.112:5062" target="_blank">192.168.1.112:5062</a>"),<br>> NUTAG_REGISTRAR("sip:<a href="http://192.168.1.112:5062" target="_blank">192.168.1.112:5062</a>"), //registra uri<br>
>
SIPTAG_FROM_STR("sip:<a href="http://192.168.1.112:5062" target="_blank">192.168.1.112:5062</a>"),<br>> NUTAG_INSTANCE (0),<br>> NUTAG_M_USERNAME("101"),<br>> TAG_NULL());<br>
> <br>> 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.<br>> <br>> With this code bellow, i send REGISTER message and get response in kamailio as:<br>
> <br>> send 613 bytes to udp/[192.168.1.112]:5062 at 03:10:42.833439:<br>> ------------------------------------------------------------------------<br>> REGISTER sip:<a href="mailto:101@192.168.3.122" target="_blank">101@192.168.3.122</a>:42806;rinstance=7742cc70900998e8 SIP/2.0<br>
>
Via: SIP/2.0/UDP 192.168.1.112;rport;branch=z9hG4bKBB44UFQ9ySjQK<br>> Max-Forwards: 70<br>> From: <sip:<a href="http://192.168.1.112:5062" target="_blank">192.168.1.112:5062</a>>;tag=DXeN4j2DFt27j<br>> To: "101" <sip:<a href="mailto:101@192.168.1.112" target="_blank">101@192.168.1.112</a>>;tag=cd424d7d<br>
> Call-ID: ac980e34-4e79-1231-71ba-3e508d3991e2<br>> CSeq: 45210457 REGISTER<br>> Contact: <sip:<a href="mailto:101@192.168.1.112" target="_blank">101@192.168.1.112</a>><br>> User-Agent: FreeSWITCH-mod_sofia/1.5.2b+git~20130527T075833Z~f3541e00f4<br>
> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE<br>> Supported: timer, precondition, path, replaces<br>> Content-Length: 0<br>> <br>> <br>
> recv 325 bytes from
udp/[192.168.1.112]:5062 at 03:10:42.834220:<br>> ------------------------------------------------------------------------<br>> SIP/2.0 404 Not here<br>> Via: SIP/2.0/UDP 192.168.1.112;rport=5060;branch=z9hG4bKBB44UFQ9ySjQK<br>
> From: <sip:<a href="http://192.168.1.112:5062" target="_blank">192.168.1.112:5062</a>>;tag=DXeN4j2DFt27j<br>> To: "101" <sip:<a href="mailto:101@192.168.1.112" target="_blank">101@192.168.1.112</a>>;tag=cd424d7d<br>
> Call-ID: ac980e34-4e79-1231-71ba-3e508d3991e2<br>> CSeq: 45210457 REGISTER<br>> Server: kamailio (4.0.1 (x86_64/linux))<br>> Content-Length: 0<br>> <br>> <br>> Then, I see that structure of SIP REGISTER message is not correct.<br>
> <br>> Can some one help me to construct this message to send to kamailio ?<br>> May we dont care about nua_create ? just using
nua_set_params or nua_register or nua_options ?<br>> <br>> Thank all in advance.<br>> <br>> ThanhTruong<br>> <br>> _________________________________________________________________________<br>> Professional FreeSWITCH Consulting Services:<br>
> <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>> <a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>> <br>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
> <a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>> <br>> Official FreeSWITCH Sites<br>> <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>> <a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
> <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>> <br>> FreeSWITCH-dev mailing list<br>> <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
> <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br><br>FreeSWITCH-dev mailing list<br><a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br><br></div> </div></div></div> </div> </div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Håkon<br>
</div>