Hi, I am trying to add PSTN gw for terminating my calls. I have changed the IP in the kamailio.cfg file, but this provider wants digest auth and so I need to pass api/pass to them. Can somebody guide me how and where to add the username+pass to the config file.
thanks
regards Ganesh Kuamr
Hello,
look at uac module for uac_auth() function -- you need to use that in a failure_route when processing 407 from provider, like in example:
- http://kamailio.org/docs/modules/4.4.x/modules/uac.html#uac.f.uac_auth()
Cheers, Daniel
On 21/09/15 17:08, Infinicalls Infinicalls wrote:
Hi, I am trying to add PSTN gw for terminating my calls. I have changed the IP in the kamailio.cfg file, but this provider wants digest auth and so I need to pass api/pass to them. Can somebody guide me how and where to add the username+pass to the config file.
thanks
regards Ganesh Kuamr
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
That's what we used:
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) = "someuser"; $avp(s:auth_password_avp) = "somesecret";
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"); } } }
failure_route[STD_FAILURE_ROUTE] { # ... route(HANDLE_PROXY_AUTH_RESPONSE_M); # ...
}
Mit freundlichen Grüßen / Best regards
Marco Barthel
Robert Bosch GmbH (CI/AFU1) Postfach 30 02 20 70442 Stuttgart GERMANY www.bosch.com
Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000; Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner, Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr. Markus Heyn, Dr. Dirk Hoheisel, Christoph Kübel, Uwe Raschke, Dr. Werner Struth, Peter Tyroller
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Infinicalls Infinicalls Sent: Montag, 21. September 2015 17:09 To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: [SR-Users] Kamailio PSTN with User/Pass authentication
Hi, I am trying to add PSTN gw for terminating my calls. I have changed the IP in the kamailio.cfg file, but this provider wants digest auth and so I need to pass api/pass to them. Can somebody guide me how and where to add the username+pass to the config file.
thanks
regards Ganesh Kuamr
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr- users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi, Thanks very much both of you. But I get this following error :
#service kamailio restart * Not starting Kamailio SIP Server: invalid configuration file! * * 0(39013) ERROR: <core> [cfg.y:3282]: yyparse(): misused command uac_auth 0(39013) : <core> [cfg.y:3426]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 332, column 22: Command cannot be used in the block
ERROR: bad config file (1 errors) 0(39013) INFO: <core> [sctp_core.c:48]: sctp_core_destroy(): SCTP API not initialized
regards Ganesh Kumar
On 9/23/15, Barthel Marco (CI/AFU1) Marco.Barthel@de.bosch.com wrote:
That's what we used:
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) = "someuser"; $avp(s:auth_password_avp) = "somesecret";
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"); } } }
failure_route[STD_FAILURE_ROUTE] { # ... route(HANDLE_PROXY_AUTH_RESPONSE_M); # ...
}
Mit freundlichen Grüßen / Best regards
Marco Barthel
Robert Bosch GmbH (CI/AFU1) Postfach 30 02 20 70442 Stuttgart GERMANY www.bosch.com
Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000; Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner, Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr. Markus Heyn, Dr. Dirk Hoheisel, Christoph Kübel, Uwe Raschke, Dr. Werner Struth, Peter Tyroller
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Infinicalls Infinicalls Sent: Montag, 21. September 2015 17:09 To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: [SR-Users] Kamailio PSTN with User/Pass authentication
Hi, I am trying to add PSTN gw for terminating my calls. I have changed the IP in the kamailio.cfg file, but this provider wants digest auth and so I need to pass api/pass to them. Can somebody guide me how and where to add the username+pass to the config file.
thanks
regards Ganesh Kuamr
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr- users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi,
Uncommented / Added these two lines:
# ----- mi_fifo params ----- modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
# ----- ctl params ----- modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
Still the same error.
-- Ganesh Kumar
On 9/23/15, Infinicalls Infinicalls infinicalls@gmail.com wrote:
Hi, Thanks very much both of you. But I get this following error :
#service kamailio restart
- Not starting Kamailio SIP Server: invalid configuration file!
- 0(39013) ERROR: <core> [cfg.y:3282]: yyparse(): misused command
uac_auth 0(39013) : <core> [cfg.y:3426]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 332, column 22: Command cannot be used in the block
ERROR: bad config file (1 errors) 0(39013) INFO: <core> [sctp_core.c:48]: sctp_core_destroy(): SCTP API not initialized
regards Ganesh Kumar
On 9/23/15, Barthel Marco (CI/AFU1) Marco.Barthel@de.bosch.com wrote:
That's what we used:
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) = "someuser"; $avp(s:auth_password_avp) = "somesecret";
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"); } } }
failure_route[STD_FAILURE_ROUTE] { # ... route(HANDLE_PROXY_AUTH_RESPONSE_M); # ...
}
Mit freundlichen Grüßen / Best regards
Marco Barthel
Robert Bosch GmbH (CI/AFU1) Postfach 30 02 20 70442 Stuttgart GERMANY www.bosch.com
Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000; Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner, Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr. Markus Heyn, Dr. Dirk Hoheisel, Christoph Kübel, Uwe Raschke, Dr. Werner Struth, Peter Tyroller
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Infinicalls Infinicalls Sent: Montag, 21. September 2015 17:09 To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: [SR-Users] Kamailio PSTN with User/Pass authentication
Hi, I am trying to add PSTN gw for terminating my calls. I have changed the IP in the kamailio.cfg file, but this provider wants digest auth and so I need to pass api/pass to them. Can somebody guide me how and where to add the username+pass to the config file.
thanks
regards Ganesh Kuamr
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr- users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Wednesday 23 September 2015 21:52:24 Infinicalls Infinicalls wrote:
- 0(39013) ERROR: <core> [cfg.y:3282]: yyparse(): misused command
uac_auth
0(39013) : <core> [cfg.y:3426]: yyerror_at(): parse error in config
file /usr/local/etc/kamailio/kamailio.cfg, line 332, column 22: Command cannot be used in the block
The problem is listed above: on line 332 uac_auth is used in a block where it can't be used. It can only be used from: http://kamailio.org/docs/modules/stable/modules/uac.html#uac.f.uac_auth%28%2...
"4.7. uac_auth()
This function can be called only from failure route and will build the authentication response header and insert it into the request without sending anything.
This function can be used from FAILURE_ROUTE. "
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
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@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
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@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users