<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p><br>
    </p>
    <p>this is only when you do jsonrpc over http, but it is not the
      case here. See my previous response in this discussion thread.</p>
    <p><br>
    </p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 02/12/2016 15:28, Jonathan Hunter
      wrote:<br>
    </div>
    <blockquote
cite="mid:AM4PR0201MB2162F474198FC06D37D82E8BBD8E0@AM4PR0201MB2162.eurprd02.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
        dir="ltr">
        <p>Hi Daniel,</p>
        <p><br>
        </p>
        <p>I can see when people are using curl they can define
          content-type ;</p>
        <p><br>
        </p>
        <pre style="white-space: pre-wrap;"><i>--header 'Content-Type: application/json'</i></pre>
        However is this  possible within the jsonrpc_exec command, as
        this seems to set the body.
        <p><br>
        </p>
        <p>Can you define the Content-Type before firing the command?</p>
        <p><br>
        </p>
        <p>Thanks</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 style="font-size:11pt"
              color="#000000" face="Calibri, sans-serif"><b>From:</b>
              sr-users <a class="moz-txt-link-rfc2396E" href="mailto:sr-users-bounces@lists.sip-router.org"><sr-users-bounces@lists.sip-router.org></a> on
              behalf of Jonathan Hunter <a class="moz-txt-link-rfc2396E" href="mailto:hunterj91@hotmail.com"><hunterj91@hotmail.com></a><br>
              <b>Sent:</b> 01 December 2016 16:12<br>
              <b>To:</b> Kamailio SER - Users Mailing List;
              <a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a><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">
              <div>Hi Daniel, </div>
              <div><br>
              </div>
              <div>I am trying tm.t_uac_start and its stating
                Content-Type Missing, I have tried to add to params but
                it doesnt like it, where should it be defined?</div>
              <div><br>
              </div>
              <div>Command below;</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>jsonrpc_exec('{"jsonrpc":"2.0","method":"tm.t_uac_start","params":
                ["INFO",
"$dlg(to_uri)",".",".","From:$var(testjon)\r\n","To:$var(testjon2)\r\n","Contact:$var(testjon4)\r\n","Content-Type:
                application/json\r\n","Content-Length: 0\r\n"]}');</div>
              <div><br>
              </div>
              <div>And logs;</div>
              <div><br>
              </div>
              <div><span style="font-size:12pt">Dec  1 16:09:15
                  POC_ProxyA /usr/sbin/kamailio[11883]: INFO:
                  <script>: getting here Content-Type missing</span><br>
              </div>
              <div>Dec  1 16:09:15 POC_ProxyA /usr/sbin/kamailio[11883]:
                INFO: <script>: getting here
                {"jsonrpc":"2.0","error":{"code":-32000,"message":"Execution
                Error"}}</div>
              <br>
              <p>Thanks</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
                    style="font-size:11pt" color="#000000"
                    face="Calibri, sans-serif"><b>From:</b>
                    Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
                    <b>Sent:</b> 01 December 2016 12:31<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,<br>
                  </p>
                  <br>
                  tm.t_uac_start is another rpc command than what was
                  tried before, this one doesn't do async operation.<br>
                  <br>
                  Cheers,<br>
                  Daniel<br>
                  <br>
                  <div class="moz-cite-prefix">On 01/12/2016 13:28,
                    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>Hello,</p>
                      <p><br>
                      </p>
                      <p>I am currently still using the exec module, so
                        within the .cfg file, as when using jsonrpc-s
                        its coming up with the async command issue
                        again, I presume this will still be the case?</p>
                      <p><br>
                      </p>
                      <p>Ok I will try with the combinations you
                        mention.</p>
                      <p><br>
                      </p>
                      <p>Many thanks</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
                            style="font-size:11pt" color="#000000"
                            face="Calibri, sans-serif"><b>From:</b>
                            Daniel-Constantin Mierla
                            <a moz-do-not-send="true"
                              class="moz-txt-link-rfc2396E"
                              href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
                            <b>Sent:</b> 01 December 2016 12:24<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>are you still trying with MI command via
                            kamctl? Not with the jsonrpc-s module and
                            tm.t_uac_start?</p>
                          <p><br>
                          </p>
                          <p>When double quotes disappear is likely due
                            to command line interpreter, so you need to
                            put two of them for each one you have now,
                            then ones than need to stay should be with
                            more backslashes.</p>
                          <p><br>
                          </p>
                          <p>Also, you can try to use single quotes to
                            enclose the parameter values and let the
                            double quotes in the content of the
                            parameter.</p>
                          <p><br>
                          </p>
                          <p>Cheers,<br>
                            Daniel<br>
                          </p>
                          <br>
                          <div class="moz-cite-prefix">On 30/11/2016
                            15:38, 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">
                              <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>
                              <br>
                              <br>
                              <div style="color:rgb(0,0,0)">
                                <hr tabindex="-1"
                                  style="display:inline-block;
                                  width:98%">
                                <div id="divRplyFwdMsg" dir="ltr"><font
                                    style="font-size:11pt"
                                    color="#000000" face="Calibri,
                                    sans-serif"><b>From:</b> sr-users
                                    <a moz-do-not-send="true"
                                      class="moz-txt-link-rfc2396E"
                                      href="mailto:sr-users-bounces@lists.sip-router.org">
<sr-users-bounces@lists.sip-router.org></a> on behalf of Jonathan
                                    Hunter <a moz-do-not-send="true"
                                      class="moz-txt-link-rfc2396E"
                                      href="mailto:hunterj91@hotmail.com">
                                      <hunterj91@hotmail.com></a><br>
                                    <b>Sent:</b> 25 November 2016 18:55<br>
                                    <b>To:</b> Kamailio SER - Users
                                    Mailing List; <a
                                      moz-do-not-send="true"
                                      class="moz-txt-link-abbreviated"
                                      href="mailto:miconda@gmail.com">
                                      miconda@gmail.com</a><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
                                          style="font-size:11pt"
                                          color="#000000" face="Calibri,
                                          sans-serif"><b>From:</b>
                                          Daniel-Constantin Mierla
                                          <a moz-do-not-send="true"
                                            class="moz-txt-link-rfc2396E"
href="mailto:miconda@gmail.com"><miconda@gmail.com></a><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 moz-do-not-send="true"
                                          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
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112">
                                                sip:3003@193.144.1.112</a>
                                              . <a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="">udp:10.70.1.136:5060</a>
                                                 \"From:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a>"\r\nTo:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112%5Cr%5CnContact:sip:daemon@8.8.8.8%5Cr%5Cn%5C">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
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112">
                                                sip:3003@193.144.1.112</a>
                                              . <a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="">udp:10.70.1.136:5060</a>
                                                 \"From:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a>"\r\nTo:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112%5Cr%5CnContact:sip:daemon@8.8.8.8%5Cr%5Cn%5C">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
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112">
                                                sip:3003@193.144.1.112</a>
                                              . <a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="">udp:10.70.1.136:5060</a>
                                              "From:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a></div>
                                            <div>To:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112">sip:3003@193.144.1.112</a></div>
                                            <div>Contact:<a
                                                moz-do-not-send="true"
                                                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
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112">sip:3003@193.144.1.112</a></div>
                                            <div>.</div>
                                            <div><a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="">udp:10.70.1.136:5060</a></div>
                                            <div>"From:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
                                                href="sip:1234@8.8.8.8">sip:1234@8.8.8.8</a></div>
                                            <div>To:<a
                                                moz-do-not-send="true"
                                                class="moz-txt-link-freetext"
href="sip:3003@193.144.1.112">sip:3003@193.144.1.112</a></div>
                                            <div>Contact:<a
                                                moz-do-not-send="true"
                                                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 moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" 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 moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </blockquote>
                          <br>
                          <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                  <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 8-10, 2017 - <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<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>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>