[SR-Users] Routing outgoing call from asterisk to registered SIP provider

Bruno Salzano bruno at brunosalzano.com
Tue Oct 27 23:44:11 CET 2015


Hello Daniel,

Il 27/10/15 11:41, Daniel Tryba ha scritto:
> On Tuesday 27 October 2015 07:36:15 Bruno Salzano wrote:
>> It seems that when i route the call outbound, i get a 407. So i would like
>> to react to this using uac_auth() as described here:
>> http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()
>>
>> Is this the right way? Can someone help me, giving hints and some working
>> example?
> Based on the info you have given I'd say this is correct. The working code is
> in the URL you provide. Adding a specific failure route in the FROMASTERISK
> when ds_is_from_list matches to the uac_auth() function is the way to go.
I got it working. It required me to enable the track_cseq_updates in 
dialog module and use uac_auth(). Actually my config is the following:

route[FROMASTERISK] {
     if (ds_is_from_list()) {
         xlog("L_INFO","[$fU@$si:$sp]{$rm} {$ru} Call from Media-Server 
Cluster\n");
         rtpengine_manage("direction=internal direction=external 
replace-origin replace-session-connection trust-address");
         uac_replace_from("", "sip:NUMBER at HOST");
         route(RELAY);
         exit;
     }
}


failure_route[TRUNKAUTH] {
         xlog("L_INFO","TRUNKAUTH FAILURE ROUTE");
     if (t_is_canceled()) {
         exit;
     }
     if(t_check_status("401|407")) {
         xlog("L_INFO", "Got 401/407 sending uac_auth() and t_relay()");
         $avp(auser) = "USERNAME";
         $avp(apass) = "SECRET";
         $avp(arealm) = "REALM";
         uac_auth();
         t_relay();
         exit;
     }
}

Now I've just last question on this topic: what's the best way to 
replace credentials (USERNAME, SECRET, REALM) from db?
I've to manage also the uac_replace_from.
What I want is to avoid to change the configuration everytime a new 
trunk is added.

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




More information about the sr-users mailing list