Hi,
I have a carrier who requires SIP authentication on calls, can anyone point me in the right direction? Normally in Asterisk or Freeswitch you can authenticate a peer, but can't see how to do this in Kamailio.
Thanks Keith
On Wednesday 18 June 2014 10:42:02 Keith wrote:
I have a carrier who requires SIP authentication on calls, can anyone point me in the right direction? Normally in Asterisk or Freeswitch you can authenticate a peer, but can't see how to do this in Kamailio.
You need the uac module and handle the 401 responses
http://kamailio.org/docs/modules/4.0.x/modules/uac.html#idp1684080
For example if you have dispatcher that need authentication for invites (where RTF_DISPATCH is the dispatcher its failure route):
modparam("uac","auth_realm_avp","$avp(s:uac_auth_realm)") modparam("uac","auth_username_avp","$avp(s:uac_auth_user)") modparam("uac","auth_password_avp","$avp(s:uac_auth_pass)")
failure_route[RTF_DISPATCH] { if (t_check_status("401")) { $avp(uac_auth_realm)=$td; $avp(uac_auth_user)="username"; $avp(uac_auth_pass)="password"; uac_auth();
t_relay(); exit; } ...