<html xmlns:v="urn:schemas-microsoft-com:vml" 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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thank you Henning for this information:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I found in our cfg there is no set_contact_alias() but a add_contact_alias() function called for INVITE|SUBSCRIBE|UPDATE|REGISTER messages. According to:<o:p></o:p></p>
<p class="MsoNormal"><a href="https://kamailio.org/docs/modules/5.5.x/modules/nathelper.html#nathelper.f.add_contact_alias">https://kamailio.org/docs/modules/5.5.x/modules/nathelper.html#nathelper.f.add_contact_alias</a>, it is for add alias src ip/port/transport
 to the end of Contact URI line<o:p></o:p></p>
<p class="MsoNormal">I tried comment it out and I don’t see the bad ;alias be fore TO: any more. However, it caused some other issue I’m now have an incomplete Contact URI line. And caused some further issue.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So I guess my original issue was after I add ;transport=tcp at the end of the Contac URI line the add_contact_alias() function can’t find the correct line to append the alias parameter, and simply added to before the To: line. Do you know
 where does this add_contact_alias function actually been defined? Maybe I take a look at it and see if I can find some hint there.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">BR,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Weiqi <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Henning Westerholt <hw@gilawa.com> <br>
<b>Sent:</b> Wednesday, March 30, 2022 2:48 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Cc:</b> Weiqi Yao <wyao@omniprophis.com><br>
<b>Subject:</b> RE: Kamailio PCSCF route logic<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:solid #9C6500 1.0pt;padding:2.0pt 2.0pt 2.0pt 2.0pt">
<p class="MsoNormal" style="line-height:12.0pt;background:#FFEB9C"><span lang="DE" style="font-size:10.0pt;color:#9C6500">CAUTION:</span><span lang="DE" style="font-size:10.0pt;color:black"> This email originated from outside of the organization. Do not click
 links or open attachments unless you recognize the sender and know the content is safe.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<div>
<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">check out the different functions in this module:
<a href="https://kamailio.org/docs/modules/5.5.x/modules/nathelper.html#nathelper.set_contact_alias">
https://kamailio.org/docs/modules/5.5.x/modules/nathelper.html#nathelper.set_contact_alias</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-GB">-- <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">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><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">https://gilawa.com</span></a></span><span lang="EN-GB"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="DE">From:</span></b><span lang="DE"> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Weiqi Yao<br>
<b>Sent:</b> Tuesday, March 29, 2022 8:10 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> [SR-Users] Kamailio PCSCF route logic<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">Hello community,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">We made some modifications to Kamailio PCSCF sample cfg file, so when PCSCF receiving an tcp SUBSCRIBE message it add ;transport=tcp to the end of Contact URI. Below is what we added the route block right after
 if (is_method("INVITE|SUBSCRIBE”)) logic<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">         if (is_method("SUBSCRIBE") && proto=='tcp') {<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">            $var(original_contact_header) = $ct;<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">            $var(new_contact_header) = $(var(original_contact_header){re.subst,/(.*:.*)(>);/\1;transport=tcp>/g});<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">            remove_hf("Contact");<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">            append_hf("Contact: $var(new_contact_header)\r\n");<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">            msg_apply_changes();<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">         }<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">We did see the ;transport=tcp been added but we also seeing a bad line ;alias=[…] is added before the To: line
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><img border="0" width="703" height="26" style="width:7.3263in;height:.2708in" id="Picture_x0020_1" src="cid:image001.png@01D84420.B175CFC0"><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">Does anyone know what function might cause this ;alias been added before To: line?<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">BR,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt">Weiqi<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
</div>
</body>
</html>