<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>#!ifdef WITH_FREESWITCH<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        if(is_method("INVITE") && route(FROMFREESWITCH))) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>                xlog("L_INFO" ,"[$fU/$tU@$si:$sp]{$rm} Call from FreeSWITCH needs to be sent TOVOIP \n");<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>                route(TOVOIP);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>                t_on_failure("F_VOIP"); <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>                exit;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>#!endif<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>route[TOVOIP] {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        xlog("L_INFO","ALERT: $fu to $tu  ");<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        $fU="XXXXXX";<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        $td="sip.voipfone.net";<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        $du="sip:XXXXXXX@sip.voipfone.net";<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        t_relay();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>failure_route[F_VOIP] {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        uac_auth();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>        xlog("L_INFO","ALERT: IN FAIL");<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Lucida Console"'>   }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I tried this but it never makes it to the failure branch. Im a newbie to kamailio and still working around the scripting. Can you please help me out here to where I am making the mistake? <br><br><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> sr-users [mailto:sr-users-bounces@lists.sip-router.org] <b>On Behalf Of </b>SamyGo<br><b>Sent:</b> Thursday, April 30, 2015 9:18 AM<br><b>To:</b> Kamailio (SER) - Users Mailing List<br><b>Subject:</b> Re: [SR-Users] UAC Module<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi Jibran,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Here is an old thread as reference:<o:p></o:p></p></div><div><p class=MsoNormal><br><a href="http://lists.sip-router.org/pipermail/sr-users/2013-August/079336.html">http://lists.sip-router.org/pipermail/sr-users/2013-August/079336.html</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I wouldn't want to do the whole handshake of INVITE,PROXY-AUTH,INVITE with username/password on a Provider for huge number of calls..imagine sending thousands of call to that provider and for each call going through the trouble of exchanging authentication. <o:p></o:p></p></div><div><p class=MsoNormal>Thats why its usually recommended to go with IP-Authentication only. Send INVITE and Provider says Lets do this call,simple and easy.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>From the configuration perspective this is my idea of still using UAC.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>- Call coming from FS on kamailio<o:p></o:p></p></div><div><p class=MsoNormal>- Rewrite the from-uri  (so the provider receives calls from the registered username)<o:p></o:p></p></div><div><p class=MsoNormal>- modify the to-domain part to contain the IP address of the provider<o:p></o:p></p></div><div><p class=MsoNormal>- set the $du to ip of the provider, and t_relay() the call.<o:p></o:p></p></div><div><p class=MsoNormal>- Most likely the Provider would say Proxy-Auth required..that can be caught in failure_route[]<o:p></o:p></p></div><div><p class=MsoNormal>- There you can call the uac_auth() function to have username.password attached to the response of above. <a href="http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()">http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()</a><o:p></o:p></p></div><div><p class=MsoNormal>- once this function is successful send the INVITE again to the provider.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Last three steps can be the following snippet of code(reference from <a href="http://opensips.org/pipermail/users/2010-August/013947.html">here</a>):<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><pre><span style='color:black'>failure_route[2] {<o:p></o:p></span></pre><pre><span style='color:black'>     if (t_check_status("40[17]")) {<o:p></o:p></span></pre><pre><span style='color:black'>        xlog("got challenged \n");<o:p></o:p></span></pre><pre><span style='color:black'>        if (uac_auth()) {<o:p></o:p></span></pre><pre><span style='color:black'>            xlog("auth was succesful \n");<o:p></o:p></span></pre><pre><span style='color:black'>            t_relay("udp:ip_addr:5060"); //provider's IP_ADDR<o:p></o:p></span></pre><pre><span style='color:black'>        }<o:p></o:p></span></pre><pre><span style='color:black'>}<o:p></o:p></span></pre></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I hope you get IP Auth from the provider, and find the reply useful.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Regards,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Wed, Apr 29, 2015 at 4:49 PM, Ali Jibran <<a href="mailto:alijibran@vividtech.io" target="_blank">alijibran@vividtech.io</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal><br>Hi all.<br>I have this setup.<br>Trunk--->Kamailio---->FreeSWITCH<br><br>I have a trunk from a sip provided and registered successfully with the UAC module. Incoming is working fine. I need to make out going through kamailio too.<br><br>I have it in the dialplan to forward the invite to kamailio from FreeSWITCH. I can see it the logs that it reaches kamailio. Now how do I make the call via the trunk?<br><br>Basically this is what I'm trying to workout<br>FS---->kamailio---->trunk.<br><br><br>Any help will be much appreciated. Thanks.<br>AJ<br>_______________________________________________<br>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
        <tr>
                <td style='border:none;padding:0px 15px 0px 8px'>
                        <a href="http://www.avast.com/">
                                <img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" />
                        </a>
                </td>
                <td>
                        <p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
                                This email is free from viruses and malware because <a href="http://www.avast.com/">avast! Antivirus</a> protection is active.
                        </p>
                </td>
        </tr>
</table>
<br />
</body></html>