[SR-Users] Kamailio PSTN with User/Pass authentication

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 24 21:40:02 CEST 2015


Hello,

the AVPs with username/password must be set before calling uac_auth().
You do it the other way around.

Cheers,
Daniel

On 24/09/15 16:44, Infinicalls Infinicalls wrote:
> Hi,
>  I am still struggling with setting up the PSTN auth part. Can anyone
> post a working code? Thanks.
>
> regards
> Ganesh Kumar
>
> On 9/23/15, Infinicalls Infinicalls <infinicalls at gmail.com> wrote:
>> Hi,
>>  I moved the uac_auth to the failure route and it compiled without
>> errors. Thanks. But the problem is calls are not getting through. And
>> users are unable to connect. Here is my config file.
>>
>> "
>> # ----- UAC -----
>> modparam("uac","auth_realm_avp","$avp(s:auth_realm_avp)")
>> modparam("uac","auth_username_avp","$avp(s:auth_username_avp)")
>> modparam("uac","auth_password_avp","$avp(s:auth_password_avp)")
>>
>> route[HANDLE_PROXY_AUTH_RESPONSE_M]
>> {
>>     if ($T_reply_code == "407")  # there's also 401
>>     {
>>         $avp(s:auth_realm_avp) = "whichever realm is used";
>>         $avp(s:auth_username_avp) = "xxxxxxxxxx";
>>         $avp(s:auth_password_avp) = "xxxxxxxxxx";
>>     }
>> }
>>
>> failure_route[STD_FAILURE_ROUTE]
>> {
>>  if (uac_auth())
>>         {
>>           xlog("L_INFO", "$var(tan)[HANDLE_PROXY_AUTH_RESPONSE_M] did
>> auth. Relaying to new destination. from=$fu,
>> callee-selected-by=$ou, uri=$ru");
>>             route(RELAY_ROUTE_C);  # doing the relay here
>>             exit;
>>         }
>>         else
>>         {
>>             xlog("L_INFO", "$var(tan)[HANDLE_PROXY_AUTH_RESPONSE_M] no
>> matching realm found. realm=$ar");
>>         }
>>     route(HANDLE_PROXY_AUTH_RESPONSE_M);
>> }
>> "
>> <snip>
>>
>> Can somebody give me a working example and help me. thanks.
>>
>> regards
>> Ganesh Kumar
>>
> _______________________________________________
> 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

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat




More information about the sr-users mailing list