<p dir="ltr">One more thing may be useful for you. If you will get an error with cseq numder when provider send 401/407 message- usedialog module. It resole an issuevwith cseq( read documentation)<br>
30.04.2015 18:23 пользователь "SamyGo" <<a href="mailto:govoiper@gmail.com">govoiper@gmail.com</a>> написал:<br>
><br>
> I'd like you to google around, there is a function available from another module which will apply the changes in SIP Message.<br>
><br>
><br>
> On Thu, Apr 30, 2015 at 9:51 AM, Ali Jibran <<a href="mailto:alijibran@vividtech.io">alijibran@vividtech.io</a>> wrote:<br>
>><br>
>> Perfect. Yeah got the working. <br>
>><br>
>> Just one last issue. I don’t think this is rewriting the header. When I log the header again after the changes it still shows me the old values.<br>
>><br>
>>  <br>
>><br>
>> From: sr-users [mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>] On Behalf Of SamyGo<br>
>> Sent: Thursday, April 30, 2015 6:50 PM<br>
>><br>
>><br>
>> To: Kamailio (SER) - Users Mailing List<br>
>> Subject: Re: [SR-Users] UAC Module<br>
>><br>
>>  <br>
>><br>
>> t_on_failure("F_VOIP") to be used before t_relay();<br>
>><br>
>> That will arm the call to go to F_VOIP on failure responses. <br>
>><br>
>>  <br>
>><br>
>> On Thu, Apr 30, 2015 at 9:33 AM, Ali Jibran <<a href="mailto:alijibran@vividtech.io">alijibran@vividtech.io</a>> wrote:<br>
>>><br>
>>>  <br>
>>><br>
>>> #!ifdef WITH_FREESWITCH<br>
>>><br>
>>>         if(is_method("INVITE") && route(FROMFREESWITCH))) {<br>
>>><br>
>>>                 xlog("L_INFO" ,"[$fU/$tU@$si:$sp]{$rm} Call from FreeSWITCH needs to be sent TOVOIP \n");<br>
>>><br>
>>>                 route(TOVOIP);<br>
>>><br>
>>>                 t_on_failure("F_VOIP");<br>
>>><br>
>>>                 exit;<br>
>>><br>
>>>         }<br>
>>><br>
>>>  <br>
>>><br>
>>> #!endif<br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>> route[TOVOIP] {<br>
>>><br>
>>>         xlog("L_INFO","ALERT: $fu to $tu  ");<br>
>>><br>
>>>         $fU="XXXXXX";<br>
>>><br>
>>>         $td="<a href="http://sip.voipfone.net">sip.voipfone.net</a>";<br>
>>><br>
>>>         $du="<a href="mailto:sip%3AXXXXXXX@sip.voipfone.net">sip:XXXXXXX@sip.voipfone.net</a>";<br>
>>><br>
>>>         t_relay();<br>
>>><br>
>>>        <br>
>>><br>
>>> }<br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>> failure_route[F_VOIP] {<br>
>>><br>
>>>         uac_auth();<br>
>>><br>
>>>         xlog("L_INFO","ALERT: IN FAIL");<br>
>>><br>
>>>    }<br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>> 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>
>>>  <br>
>>><br>
>>> From: sr-users [mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>] On Behalf Of SamyGo<br>
>>> Sent: Thursday, April 30, 2015 9:18 AM<br>
>>> To: Kamailio (SER) - Users Mailing List<br>
>>> Subject: Re: [SR-Users] UAC Module<br>
>>><br>
>>>  <br>
>>><br>
>>> Hi Jibran,<br>
>>><br>
>>>  <br>
>>><br>
>>> Here is an old thread as reference:<br>
>>><br>
>>><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><br>
>>><br>
>>>  <br>
>>><br>
>>> 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. <br>
>>><br>
>>> Thats why its usually recommended to go with IP-Authentication only. Send INVITE and Provider says Lets do this call,simple and easy.<br>
>>><br>
>>>  <br>
>>><br>
>>> From the configuration perspective this is my idea of still using UAC.<br>
>>><br>
>>>  <br>
>>><br>
>>> - Call coming from FS on kamailio<br>
>>><br>
>>> - Rewrite the from-uri  (so the provider receives calls from the registered username)<br>
>>><br>
>>> - modify the to-domain part to contain the IP address of the provider<br>
>>><br>
>>> - set the $du to ip of the provider, and t_relay() the call.<br>
>>><br>
>>> - Most likely the Provider would say Proxy-Auth required..that can be caught in failure_route[]<br>
>>><br>
>>> - 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><br>
>>><br>
>>> - once this function is successful send the INVITE again to the provider.<br>
>>><br>
>>>  <br>
>>><br>
>>> Last three steps can be the following snippet of code(reference from here):<br>
>>><br>
>>>  <br>
>>><br>
>>> failure_route[2] {<br>
>>><br>
>>>      if (t_check_status("40[17]")) {<br>
>>><br>
>>>         xlog("got challenged \n");<br>
>>><br>
>>>         if (uac_auth()) {<br>
>>><br>
>>>             xlog("auth was succesful \n");<br>
>>><br>
>>>             t_relay("udp:ip_addr:5060"); //provider's IP_ADDR<br>
>>><br>
>>>         }<br>
>>><br>
>>> }<br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>> I hope you get IP Auth from the provider, and find the reply useful.<br>
>>><br>
>>>  <br>
>>><br>
>>> Regards,<br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>> On Wed, Apr 29, 2015 at 4:49 PM, Ali Jibran <<a href="mailto:alijibran@vividtech.io">alijibran@vividtech.io</a>> wrote:<br>
>>>><br>
>>>><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">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>><br>
>>>  <br>
>>><br>
>>>  <br>
>>><br>
>>> ________________________________<br>
>>><br>
>>> This email is free from viruses and malware because avast! Antivirus protection is active.<br>
>>><br>
>>>  <br>
>>><br>
>>><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">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>><br>
>>  <br>
>><br>
>><br>
>><br>
>> ________________________________<br>
>><br>
>> This email is free from viruses and malware because avast! Antivirus protection is active.<br>
>><br>
>><br>
>><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">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>><br>
><br>
><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">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
</p>