<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-IN link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Thank you Sir, I will try to implement this. I am highly impressed with your presentation at kamailio world 2021. I like to follow you, can you share me some more material for better knowledge of kamailio.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>And how I can route requests from one ROUTE to another ie. From <i>request_route</i> to <i>failure_route</i> or <i>onreply_route</i> or <i>branch_route</i> etc.</span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks</p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>From: </b><a href="mailto:hw@gilawa.com">Henning Westerholt</a><br><b>Sent: </b>29 August 2022 12:53 PM<br><b>To: </b><a href="mailto:kdkaushik@gmail.com">Keshav Kaushik</a><br><b>Cc: </b><a href="mailto:sr-users@lists.kamailio.org">Kamailio (SER) - Users Mailing List</a><br><b>Subject: </b>RE: kamailio Trunk authentication</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=DE>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>For non-commercial support please address our sr-users list (added to CC).</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Please look at the uac module, there a function uac_auth() for this particular scenario with example cfg.</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><a href="https://kamailio.org/docs/modules/5.5.x/modules/uac.html#uac.f.uac_auth">https://kamailio.org/docs/modules/5.5.x/modules/uac.html#uac.f.uac_auth</a></span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Cheers,</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Henning</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB> </span><span lang=DE><o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-GB>-- </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Henning Westerholt – </span><span lang=DE><a href="https://skalatan.de/blog/"><span lang=EN-GB style='color:#0563C1'>https://skalatan.de/blog/</span></a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Kamailio services – </span><span lang=DE><a href="https://gilawa.com/"><span lang=EN-GB style='color:#0563C1'>https://gilawa.com</span></a><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-GB> </span><span lang=DE><o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin-left:35.4pt'><b><span lang=DE>From:</span></b><span lang=DE> Keshav Kaushik <kdkaushik@gmail.com> <br><b>Sent:</b> Sunday, August 28, 2022 1:34 PM<br><b>To:</b> Henning Westerholt <hw@gilawa.com><br><b>Subject:</b> kamailio Trunk authentication<o:p></o:p></span></p></div></div><p class=MsoNormal style='margin-left:35.4pt'><span lang=DE> <o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>Respected Sir,</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>I am new to kamailio so not very familiar with config PV’s and transformations etc.</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>I have successfully authenticated the Twilio SIP phone via ACL.</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>But I also willing to authenticate the Twilio SIP via username and password.</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>For doing this I plan to modify the “proxy-authentication” header as blow:</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>if (is_present_hf("Proxy-Authorization")) {</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> $nonc=$sel(proxy-authorization.nonce);// not working</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> $has="kamailio:$ar:SdE-----------ADVpa";</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> $ha1=$(has{s.md5});</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> hat="$aa:$adu";</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> $ha2=$(hat{s.md5});</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> $resp="$HA1:$nonc:$HA2";</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> append_hf('Proxy-Authorization: Digest username="kamailio", realm="$ar", nonce="$nonc", uri="<a href="sip:+1650ZZZZZZ@XX.YY.7.195">sip:+1650ZZZZZZ@XX.YY.7.195</a>", response="$(resp{s.md5})"');</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>}</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> remove_hf("Proxy-Authorization");// remove original header</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>When I save the config file and restart kamailio, it does not start, may be due to some error in code.</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>Can you please help in authentication of a SIP trunk using user/passowrd.</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> </span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>Thanks in advance</span><span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'> <span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'> <span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows<span lang=DE><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'> <span lang=DE><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>