<div dir="ltr">Hello,<br><br>This way the contact header is <b>not</b> getting inserted.<div><br><div>Below syntax is only able to insert it.<br><div>insert_hf("Contact: <<a href="http://sip:00912269240500@10.52.26.98:5060">sip:00912269240500@10.52.26.98:5060</a>>\r\n", "Contact");</div><div><br></div><div>My problem is with <b>remove_hf(); </b>function only. It does not remove the value.</div><div><b><br></b></div><div><b><br></b><br><br></div></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 4, 2022 at 2:05 PM Henning Westerholt <<a href="mailto:hw@gilawa.com">hw@gilawa.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="DE" style="overflow-wrap: break-word;">
<div class="gmail-m_4769393912033389464WordSection1">
<p class="MsoNormal"><span>Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">please do not add the Contact header as second parameter to the insert_hf.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Try this out:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;background:rgb(204,204,204)">remove_hf("Contact");<br>
insert_hf("Contact: <</span><span style="color:black;background:rgb(204,204,204)"><a href="http://sip:00912269240500@10.52.26.98:5060" target="_blank"><span lang="EN-GB">sip:00912269240500@10.52.26.98:5060</span></a></span><span lang="EN-GB" style="color:black;background:rgb(204,204,204)">>\r\n");</span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- <u></u>
<u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt –
</span><span><a href="https://skalatan.de/blog/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services –
</span><span><a href="https://gilawa.com/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://gilawa.com</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Ankit Jayswal<br>
<b>Sent:</b> Thursday, August 4, 2022 7:27 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> Re: [SR-Users] Contact header modification - Kamailio<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Yes,<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">When I use <b>remove_hf()</b> and
<b>insert_hf()</b> it doesn't remove the value of the Contact header properly.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Below code executed:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;background:rgb(204,204,204)">remove_hf("Contact");<br>
insert_hf("Contact: <</span><span style="color:black;background:rgb(204,204,204)"><a href="http://sip:00912269240500@10.52.26.98:5060" target="_blank"><span lang="EN-GB">sip:00912269240500@10.52.26.98:5060</span></a></span><span lang="EN-GB" style="color:black;background:rgb(204,204,204)">>\r\n",
"Contact");</span><span lang="EN-GB"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB">I have given the sngrep INVITE request below after applying the above code.
</span>See the highlighted contact header not removing previous value properly.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><img border="0" width="472" height="241" style="width: 4.9166in; height: 2.5104in;" id="gmail-m_4769393912033389464Bild_x0020_1" src="cid:1826851ac374cff311"><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Wed, Aug 3, 2022 at 8:30 PM Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-left:35.4pt">How did you conclude that it doesn’t work?<br>
<br>
> On Aug 3, 2022, at 8:06 AM, Ankit Jayswal <<a href="mailto:ankit.jayswal@engagely.ai" target="_blank">ankit.jayswal@engagely.ai</a>> wrote:<br>
> <br>
> Hello,<br>
> <br>
> Can you suggest directly replacing the value of the Contact header ? As remove_hf("Contact") does not work for me.<br>
> <br>
> I need just Contact: <<a href="http://sip:009122692405xx@10.52.26.98:5060" target="_blank">sip:009122692405xx@10.52.26.98:5060</a>> instead of,<br>
> Contact: <<a>sip:0091692405xx@45.118.162.x:5080;alias=10.52.26.102~5080~1</a>><br>
> <br>
> <br>
> On Tue, Aug 2, 2022 at 12:56 PM Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>> wrote:<br>
> The suggestion given by Henning was to remove the existing Contact header, and replace it with whatever value you like.<br>
> <br>
> > On Aug 2, 2022, at 1:12 AM, Ankit Jayswal <<a href="mailto:ankit.jayswal@engagely.ai" target="_blank">ankit.jayswal@engagely.ai</a>> wrote:<br>
> > <br>
> > Hello,<br>
> > Whenever I try the remove_hf("Contact") function the call leg is divided into the two parts and the call is not getting set up properly and not progressing.<br>
> > I am just looking for a function that can modify the Contact header value of an existing Contact header.<br>
> > <br>
> > On Mon, Aug 1, 2022 at 8:31 PM Henning Westerholt <<a href="mailto:hw@gilawa.com" target="_blank">hw@gilawa.com</a>> wrote:<br>
> > Hello,<br>
> > <br>
> > <br>
> > <br>
> > you need to do a “remove_hf(“Contact”)” before.<br>
> > <br>
> > <br>
> > <br>
> > Cheers,<br>
> > <br>
> > <br>
> > <br>
> > Henning<br>
> > <br>
> > <br>
> > <br>
> > --<br>
> > <br>
> > Henning Westerholt – <a href="https://skalatan.de/blog/" target="_blank">https://skalatan.de/blog/</a><br>
> > <br>
> > Kamailio services – <a href="https://gilawa.com" target="_blank">https://gilawa.com</a><br>
> > <br>
> > <br>
> > <br>
> > From: Ankit Jayswal <<a href="mailto:ankit.jayswal@engagely.ai" target="_blank">ankit.jayswal@engagely.ai</a>>
<br>
> > Sent: Monday, August 1, 2022 4:26 PM<br>
> > To: Henning Westerholt <<a href="mailto:hw@gilawa.com" target="_blank">hw@gilawa.com</a>><br>
> > Cc: Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>>; Amey Naik <<a href="mailto:amey.naik@engagely.ai" target="_blank">amey.naik@engagely.ai</a>>; Devanand Jalla <<a href="mailto:devanand.jalla@engagely.ai" target="_blank">devanand.jalla@engagely.ai</a>><br>
> > Subject: Re: [SR-Users] Contact header modification - Kamailio<br>
> > <br>
> > <br>
> > <br>
> > Hello,<br>
> > Thanks for your reply, but I am looking to replace the value in the Contact header. Which function can help me to do this ?<br>
> > I tried, <br>
> > assign_hf_value("Contact", "<<a href="http://sip:00912269240xxx@10.52.26.98:5060" target="_blank">sip:00912269240xxx@10.52.26.98:5060</a>>");<br>
> > <br>
> > <br>
> > But that is not working properly, it assigns value but previous value also remains in it.<br>
> > <br>
> > <br>
> > <br>
> > On Mon, Aug 1, 2022 at 6:11 PM Henning Westerholt <<a href="mailto:hw@gilawa.com" target="_blank">hw@gilawa.com</a>> wrote:<br>
> > <br>
> > Hello,<br>
> > <br>
> > <br>
> > <br>
> > the topos module can do that, among other things. Alternatively there is also the topoh module, which do not need any backend storage.<br>
> > <br>
> > <br>
> > <br>
> > Cheers,<br>
> > <br>
> > <br>
> > <br>
> > Henning<br>
> > <br>
> > <br>
> > <br>
> > --<br>
> > <br>
> > Henning Westerholt – <a href="https://skalatan.de/blog/" target="_blank">https://skalatan.de/blog/</a><br>
> > <br>
> > Kamailio services – <a href="https://gilawa.com" target="_blank">https://gilawa.com</a><br>
> > <br>
> > <br>
> > <br>
> > From: sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@lists.kamailio.org</a>> On Behalf Of Ankit Jayswal<br>
> > Sent: Monday, August 1, 2022 2:37 PM<br>
> > To: <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> > Cc: Amey Naik <<a href="mailto:amey.naik@engagely.ai" target="_blank">amey.naik@engagely.ai</a>>; Devanand Jalla <<a href="mailto:devanand.jalla@engagely.ai" target="_blank">devanand.jalla@engagely.ai</a>><br>
> > Subject: [SR-Users] Contact header modification - Kamailio<br>
> > <br>
> > <br>
> > <br>
> > Hello Team,<br>
> > <br>
> > I am in need to modify the contact header in Kamailio before sending an INVITE request to the SIP trunk provider. Basically the IP address I need to modify in the contact header. Please suggest a better way to do this. Below is an example.<br>
> > <br>
> > OLD (Existing):<br>
> > <br>
> > Contact: <<a>sip:009169240xxx@45.118.162.x:5080;alias=10.52.26.102~5080~1</a>><br>
> > <br>
> > <br>
> > <br>
> > NEW (Needed):<br>
> > <br>
> > Contact: <<a href="http://sip:00912269240xxx@10.52.26.98:5060" target="_blank">sip:00912269240xxx@10.52.26.98:5060</a>><br>
> > <br>
> > I tried various functions from the textops module but no hope.<br>
> > I am looking for a function that can replace the contact header's value. Please help me with this.<br>
> > <br>
> > <br>
> > <br>
> > --<br>
> > <br>
> > Thanks & Regards,<br>
> > Ankit Jayswal | Specialist - Software Development<br>
> > <br>
> > __________________________________________________________<br>
> > Kamailio - Users Mailing List - Non Commercial Discussions<br>
> > * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> > Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
> > Edit mailing list options or unsubscribe:<br>
> > * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
> <br>
> -- <br>
> Alex Balashov | Principal | Evariste Systems LLC<br>
> <br>
> Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)<br>
> Web: <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>,
<a href="http://www.csrpswitch.com/" target="_blank">http://www.csrpswitch.com/</a><br>
> <br>
> <br>
> __________________________________________________________<br>
> Kamailio - Users Mailing List - Non Commercial Discussions<br>
> * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
> Edit mailing list options or unsubscribe:<br>
> * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
> __________________________________________________________<br>
> Kamailio - Users Mailing List - Non Commercial Discussions<br>
> * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
> Edit mailing list options or unsubscribe:<br>
> * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
-- <br>
Alex Balashov | Principal | Evariste Systems LLC<br>
<br>
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)<br>
Web: <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>,
<a href="http://www.csrpswitch.com/" target="_blank">http://www.csrpswitch.com/</a><br>
<br>
<br>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</blockquote></div>