[SR-Users] SIP Trunk

Daniel Tryba daniel at pocos.nl
Wed Jun 18 11:06:19 CEST 2014


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;
        }
...

-- 

POCOS B.V. - Croy 9c - 5653 LC Eindhoven
Telefoon: 040 293 8661 - Fax: 040 293 8658
http://www.pocos.nl/   - http://www.sipo.nl/
K.v.K. Eindhoven 17097024



More information about the sr-users mailing list