[SR-Users] kamailio Trunk authentication

Henning Westerholt hw at gilawa.com
Mon Aug 29 09:23:17 CEST 2022


Hello,

For non-commercial support please address our sr-users list (added to CC).

Please look at the uac module, there a function uac_auth() for this particular scenario with example cfg.

https://kamailio.org/docs/modules/5.5.x/modules/uac.html#uac.f.uac_auth

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>

From: Keshav Kaushik <kdkaushik at gmail.com>
Sent: Sunday, August 28, 2022 1:34 PM
To: Henning Westerholt <hw at gilawa.com>
Subject: kamailio Trunk authentication

Respected Sir,
I am new to kamailio so not very familiar with config PV’s and transformations etc.
I have successfully authenticated the Twilio SIP phone via ACL.
But I also willing to authenticate the Twilio SIP via username and password.
For doing this I plan to modify the “proxy-authentication” header as blow:

if (is_present_hf("Proxy-Authorization")) {

            $nonc=$sel(proxy-authorization.nonce);// not working
            $has="kamailio:$ar:SdE-----------ADVpa";
            $ha1=$(has{s.md5});
            hat="$aa:$adu";
            $ha2=$(hat{s.md5});
            $resp="$HA1:$nonc:$HA2";
            append_hf('Proxy-Authorization: Digest username="kamailio", realm="$ar", nonce="$nonc", uri="sip:+1650ZZZZZZ at XX.YY.7.195", response="$(resp{s.md5})"');
}
            remove_hf("Proxy-Authorization");// remove original header

When I save the config file and restart kamailio, it does not start, may be due to some error in code.

Can you please help in authentication of a SIP trunk using user/passowrd.

Thanks in advance


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220829/1ef35ffb/attachment.htm>


More information about the sr-users mailing list