<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>not sure I really understood what you want to do, so some generic
remarks:</p>
<p> - From header for generated replies is taken from request. If
you want a different one, change it for request, then do
msg_apply_changes() and then generate the reply</p>
<p> - the To-tag set by Kamailio in generated replies should be
available via:</p>
<p> *
<a class="moz-txt-link-freetext" href="https://www.kamailio.org/wikidocs/cookbooks/5.6.x/pseudovariables/#lttkey-local-to-tag">https://www.kamailio.org/wikidocs/cookbooks/5.6.x/pseudovariables/#lttkey-local-to-tag</a></p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 11.08.22 17:19, Lewis Hutchinson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CWXP265MB2517FE08FF74B57622B83FCDC5649@CWXP265MB2517.GBRP265.PROD.OUTLOOK.COM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}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]-->
<div class="WordSection1">
<p class="MsoNormal">Apologies for the confusion I am actually
trying to access to To tag in the sl reply and fix that to
what I want (i.e the $ft of the SUBSCRIBE plus i.e –1234) to
test<br>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><b><span
style="font-size:12.0pt;color:black;mso-fareast-language:EN-GB">Lewis
</span></b><span style="mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="mso-fareast-language:EN-GB" lang="EN-US">From:</span></b><span
style="mso-fareast-language:EN-GB" lang="EN-US"> Lewis
Hutchinson
<br>
<b>Sent:</b> 11 August 2022 14:59<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<b>Subject:</b> Remove and Re add FROM in 200 OK sl
reply<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello All<o:p></o:p></p>
<p class="MsoNormal">kamailio 5.5.3<br>
KEMI Python<br>
Lab environemnt<br>
<br>
Is there a reason why this does not work?<br>
<br>
Lines 2 and 3 work but the removal of the initial From is not
working on Line 1<br>
<br>
<br>
1. KSR.hdr.remove(“From”)<br>
2. KSR.hdr.append_to_reply("From: "
+KSR.pv.gete("$fn") + " <"+KSR.pv.gete("$fu") + ">" +
";tag=" +KSR.pv.gete("$ft") + "--1234" + "\r\n")<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">3.
KSR.sl.sl_send_reply(200, "OK")<br>
<br>
<br>
In a SUBSCRIBE/NOTIFY scenario I am trying to control the From
Tag returned in the 200OK so I can use the same one in
subsequent NOTIFY messages generated outside of Kamailio, my
theory is use the From tag in the Subscribe and append it on
the reply with –1234 for example (this is only in a Lab at
this stage, any other options please let me know)<br>
<br>
Whenever I do this I end up with 2 From headers (see below)<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">SIP/2.0
200 OK<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">Via:
SIP/2.0/UDP
192.168.1.67:5060;branch=z9hG4bK-f710a11a;rport=46404;received=xx.yy.xx.yy<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">From:
" testuser"
<a href="sip:limeant30@sip.viazeta.com"
moz-do-not-send="true" class="moz-txt-link-freetext">sip:limeant30@sip.viazeta.com</a>;tag=bf8745def06c7b12<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">To:
<sip:
<a
href="mailto:testuser@sip.viazeta.com%3e;tag=47969b75f14e6954812863912d1cf21c.b5f3318f"
moz-do-not-send="true">
testuser@sip.viazeta.com>;tag=47969b75f14e6954812863912d1cf21c.b5f3318f</a><o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">Call-ID:
<a href="mailto:b21ba770-9b5836aa@192.168.1.67"
moz-do-not-send="true" class="moz-txt-link-freetext">b21ba770-9b5836aa@192.168.1.67</a><o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">CSeq:
18137 SUBSCRIBE<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">Contact:
"testuser" <<a href="sip:testuser@%20xx.yy.xx.yy:46404"
moz-do-not-send="true">sip:testuser@ xx.yy.xx.yy:46404</a>><o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">Expires:
3600<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">From:
"testuser"
<a href="sip:testuser@testbed.com" moz-do-not-send="true"
class="moz-txt-link-freetext">sip:testuser@testbed.com</a>;tag=bf8745def06c7b12--1234<o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span
style="font-size:9.0pt;font-family:Consolas;color:#1D1C1D;mso-fareast-language:EN-GB">Content-Length:
0<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I have tried
many many variations but the original From header always
persists I have checked the debug logs and it says it has been
removed<br>
<br>
Anyone know what I am missing? And how to get
KSR.hdr.remove(“From”) to work. Looking in a debug log the
header is removed.
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><b><span
style="font-size:12.0pt;color:black;mso-fareast-language:EN-GB">Lewis</span></b><span
style="font-size:12.0pt;color:black;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
* <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
</body>
</html>