[SR-Users] UAC Module

Ali Jibran alijibran at vividtech.io
Thu Apr 30 15:51:59 CEST 2015


Perfect. Yeah got the working. 

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.

 

From: sr-users [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of SamyGo
Sent: Thursday, April 30, 2015 6:50 PM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] UAC Module

 

t_on_failure("F_VOIP") to be used before t_relay();

That will arm the call to go to F_VOIP on failure responses. 

 

On Thu, Apr 30, 2015 at 9:33 AM, Ali Jibran <alijibran at vividtech.io <mailto:alijibran at vividtech.io> > wrote:

 

#!ifdef WITH_FREESWITCH

        if(is_method("INVITE") && route(FROMFREESWITCH))) {

                xlog("L_INFO" ,"[$fU/$tU@$si:$sp]{$rm} Call from FreeSWITCH needs to be sent TOVOIP \n");

                route(TOVOIP);

                t_on_failure("F_VOIP"); 

                exit;

        }

 

#!endif

 

 

 

route[TOVOIP] {

        xlog("L_INFO","ALERT: $fu to $tu  ");

        $fU="XXXXXX";

        $td="sip.voipfone.net <http://sip.voipfone.net> ";

        $du="sip:XXXXXXX at sip.voipfone.net <mailto:sip%3AXXXXXXX at sip.voipfone.net> ";

        t_relay();

        

}

 

 

failure_route[F_VOIP] {

        uac_auth();

        xlog("L_INFO","ALERT: IN FAIL");

   }

 

 

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? 

 

From: sr-users [mailto:sr-users-bounces at lists.sip-router.org <mailto:sr-users-bounces at lists.sip-router.org> ] On Behalf Of SamyGo
Sent: Thursday, April 30, 2015 9:18 AM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] UAC Module

 

Hi Jibran,

 

Here is an old thread as reference:


http://lists.sip-router.org/pipermail/sr-users/2013-August/079336.html

 

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. 

Thats why its usually recommended to go with IP-Authentication only. Send INVITE and Provider says Lets do this call,simple and easy.

 

>From the configuration perspective this is my idea of still using UAC.

 

- Call coming from FS on kamailio

- Rewrite the from-uri  (so the provider receives calls from the registered username)

- modify the to-domain part to contain the IP address of the provider

- set the $du to ip of the provider, and t_relay() the call.

- Most likely the Provider would say Proxy-Auth required..that can be caught in failure_route[]

- There you can call the uac_auth() function to have username.password attached to the response of above. http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()

- once this function is successful send the INVITE again to the provider.

 

Last three steps can be the following snippet of code(reference from here <http://opensips.org/pipermail/users/2010-August/013947.html> ):

 

failure_route[2] {
     if (t_check_status("40[17]")) {
        xlog("got challenged \n");
        if (uac_auth()) {
            xlog("auth was succesful \n");
            t_relay("udp:ip_addr:5060"); //provider's IP_ADDR
        }
}

 

 

I hope you get IP Auth from the provider, and find the reply useful.

 

Regards,

 

 

 

On Wed, Apr 29, 2015 at 4:49 PM, Ali Jibran <alijibran at vividtech.io <mailto:alijibran at vividtech.io> > wrote:


Hi all.
I have this setup.
Trunk--->Kamailio---->FreeSWITCH

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.

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?

Basically this is what I'm trying to workout
FS---->kamailio---->trunk.


Any help will be much appreciated. Thanks.
AJ
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org> 
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

 

 

  _____  


 <http://www.avast.com/> 

This email is free from viruses and malware because avast! Antivirus <http://www.avast.com/>  protection is active. 

 


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org> 
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

 



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150430/7ea50056/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ~WRD000.jpg
Type: image/jpeg
Size: 823 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150430/7ea50056/attachment.jpg>


More information about the sr-users mailing list