<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p></p>
<div><span style="font-size: 12pt;">Hi,</span><br>
</div>
<div><br>
</div>
<div>I am just testing with the mi t_uac_dlg command, and I am trying to create an additional header, which is sent in the SIP INFO message and actually contains double quotes.</div>
<div><br>
</div>
<div>So in my kamailio.cfg script file I set the variable;</div>
<div><br>
</div>
<div><br>
</div>
<div>$var(testjon8) = "p1=\"STOP\"";</div>
<div><br>
</div>
<div>xlog("L_INFO","We are going to try and use $var(testjon8)\n");</div>
<div><br>
</div>
<div>And when seeing in the logs I see it states;</div>
<div><br>
</div>
<div>We are going to try and use p1="STOP"</div>
<div><br>
</div>
<div>And p1="STOP" is exactly what I want.</div>
<div><br>
</div>
<div>However when I generate the SIP INFO message, and check on the wire using wireshark I see;</div>
<div><br>
</div>
<div>Event:p1=STOP</div>
<div><br>
</div>
<div>So it doesnt have the double quotes I would like.</div>
<div><br>
</div>
<div>How can I escape them so the t_uac_dlg command includes them?</div>
<div><br>
</div>
<div>The portion where this header is generated in the command is;</div>
<div><br>
</div>
<div><br>
</div>
<div>exec_avp("kamctl mi t_uac_dlg INFO $dlg(to_uri) . . \\\"From:'$var(testjon)'\"\\r\\nTo:$var(testjon2)\\r\\nCall-ID:$var(testjon3)\\r\\nAllow:$var(Allow)\\r\\nContact:$var(testjon4)\\r\\nEvent:$var(testjon8)\\r\\n\\\"\"", "$avp(test)");</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>And also running debug I see it as Event:p1="STOP"\r\n\""</div>
<div><br>
</div>
<div><br>
</div>
<div>Can you tell me how I can escape " so its actually within the SIP header itself?</div>
<div><br>
</div>
<div>Many thanks</div>
<div><br>
</div>
<div>Jon</div>
<br>
<p></p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.sip-router.org> on behalf of Jonathan Hunter <hunterj91@hotmail.com><br>
<b>Sent:</b> 25 November 2016 18:55<br>
<b>To:</b> Kamailio SER - Users Mailing List; miconda@gmail.com<br>
<b>Subject:</b> Re: [SR-Users] Send SIP Info within a dialog using $uac_req(method)="INFO"</font>
<div> </div>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Daniel,</p>
<p><br>
</p>
<p>Great thanks very much, will give it a try.</p>
<p><br>
</p>
<p>Jon</p>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Daniel-Constantin Mierla <miconda@gmail.com><br>
<b>Sent:</b> 22 November 2016 18:46<br>
<b>To:</b> Jonathan Hunter; Kamailio SER - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Send SIP Info within a dialog using $uac_req(method)="INFO"</font>
<div> </div>
</div>
<div>
<p>Hello,</p>
<p><br>
</p>
<p>got a bit of time to look at the code and discovered that there is a rpc command tm.t_uac_start added by ser guys that might get you moving forward. It is not waiting for the reply of the generated request and you can use it with json rpc exec function in
 the config, so it avoids using exec.</p>
<p><br>
</p>
<p>Can you give it a try?</p>
<p><br>
</p>
Some documentation can be found in the comments of the function used by this command:<br>
<br>
  - <a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/blob/master/modules/tm/rpc_uac.c#L399" id="LPlnk800914" previewremoved="true">
https://github.com/kamailio/kamailio/blob/master/modules/tm/rpc_uac.c#L399</a><br>
<br>
Cheers,<br>
Daniel<br>
<br>
<br>
<div class="moz-cite-prefix">On 22/11/2016 18:35, Jonathan Hunter wrote:<br>
</div>
<blockquote type="cite">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Daniel,</p>
<p><br>
</p>
<p>Thanks here you go;</p>
<p><br>
</p>
<div>[root@POC_ProxyA kamailio]# kamctl mi t_uac_dlg INFO <a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112">
sip:3003@193.144.1.112</a> . <a class="moz-txt-link-freetext" href="">udp:10.70.1.136:5060</a>    \"From:<a class="moz-txt-link-freetext" href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a>"\r\nTo:<a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\">sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\</a>""</div>
<div>404 Invalid local socket</div>
<div>[root@POC_ProxyA kamailio]# VERBOSE=1 kamctl mi t_uac_dlg INFO <a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112">
sip:3003@193.144.1.112</a> . <a class="moz-txt-link-freetext" href="">udp:10.70.1.136:5060</a>    \"From:<a class="moz-txt-link-freetext" href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a>"\r\nTo:<a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\">sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\</a>""</div>
<div>database engine 'MYSQL' loaded</div>
<div>Control engine 'FIFO' loaded</div>
<div>entering fifo_cmd t_uac_dlg INFO <a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112">
sip:3003@193.144.1.112</a> . <a class="moz-txt-link-freetext" href="">udp:10.70.1.136:5060</a> "From:<a class="moz-txt-link-freetext" href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a></div>
<div>To:<a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112">sip:3003@193.144.1.112</a></div>
<div>Contact:<a class="moz-txt-link-freetext" href="sip:daemon@8.8.8.8">sip:daemon@8.8.8.8</a></div>
<div>"</div>
<div>404 Invalid local socket</div>
<div>FIFO command was:</div>
<div>:t_uac_dlg:kamailio_receiver_23469</div>
<div>INFO</div>
<div><a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112">sip:3003@193.144.1.112</a></div>
<div>.</div>
<div><a class="moz-txt-link-freetext" href="">udp:10.70.1.136:5060</a></div>
<div>"From:<a class="moz-txt-link-freetext" href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a></div>
<div>To:<a class="moz-txt-link-freetext" href="sip:3003@193.144.1.112">sip:3003@193.144.1.112</a></div>
<div>Contact:<a class="moz-txt-link-freetext" href="sip:daemon@8.8.8.8">sip:daemon@8.8.8.8</a></div>
<div>"</div>
<div><br>
</div>
<div><br>
</div>
Thanks
<p><br>
</p>
<p>Jon</p>
</div>
</blockquote>
<pre class="moz-signature" cols="72">
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>