<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hi, Gary!<br>
        <br>
        Actually I just realized that you are not passing the headers
        parameter correctly. You separate the headers with comma,
        whereas they all should be a single parameter.<br>
        Can you try the following command?</tt><tt><br>
      </tt><tt><br>
      </tt><tt>curl "127.0.0.1:8888/json/<span style="font-size:
          12.0px;line-height: 19.2px;">t_uac_dlg</span>?params=<span
          style="line-height: 1.6em;">OPTIONS,<a moz-do-not-send="true"
            class="moz-txt-link-abbreviated"
            href="sip:1000001115@10.0.0.30" target="_parent">sip:1000001115@10.0.0.30</a>,.,.,</span><span
          style="line-height: 1.6em;">From: <a moz-do-not-send="true"
            class="moz-txt-link-abbreviated"
            href="sip:1111111111@10.0.0.30" target="_parent">sip:1111111111@10.0.0.30</a>\r\n</span><span
          style="line-height: 1.6em;">To: <a moz-do-not-send="true"
            class="moz-txt-link-abbreviated"
            href="sip:1000001115@10.0.0.30" target="_parent">sip:1000001115@10.0.0.30</a>\r\n</span><span
          style="line-height: 1.6em;">Content-Type: text/plain\r\n"<br>
          <br>
          Best regards,</span><br>
      </tt>
      <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
      On 09/23/2014 09:45 PM, Gary Nyquist wrote:<br>
    </div>
    <blockquote
cite="mid:trinity-ca22eb09-9e24-463a-9b78-0f3be8f7bed4-1411497933493@3capp-mailcom-lxa12"
      type="cite">
      <div style="font-family: Verdana;font-size: 12.0px;">
        <div><span style="font-family: Verdana; font-size: 12px;
            font-style: italic; line-height: 19.2000007629395px;">Hi </span><span
            style="font-family: Verdana; font-size: 12px; font-style:
            italic; line-height: 19.2px;">Răzvan,</span></div>
        <div><span style="line-height: 1.6em;">I tried enclosing with
            quotes; but it made no difference </span><img
            moz-do-not-send="true" alt="" class="smiley"
src="https://sec-s.uicdn.com/3c-cdn/mail/client/wicket/resource/static-res/---/mc/img/smileys/default/s_10.gif"
            style="line-height: 1.6em; margin: 4px 2px 0px;
            vertical-align: bottom;"></div>
        <div><span style="line-height: 1.6em;">OPTIONS packet did not go
            out of the box.</span></div>
        <div>The log still shows the same:</div>
        <div> </div>
        <div>DBG:mi_json:mi_json_run_mi_cmd: command=t_uac_dlg accepts
          parameters<br>
          DBG:mi_json:mi_json_run_mi_cmd: got string param [OPTIONS]<br>
          DBG:mi_json:mi_json_run_mi_cmd: got string param
          [<a class="moz-txt-link-abbreviated" href="mailto:sip:1000001115@10.0.0.30">sip:1000001115@10.0.0.30</a>]<br>
          DBG:mi_json:mi_json_run_mi_cmd: got string param [.]<br>
          DBG:mi_json:mi_json_run_mi_cmd: got string param [.]<br>
          DBG:mi_json:mi_json_run_mi_cmd: got string param [From:
          <a class="moz-txt-link-abbreviated" href="mailto:sip:1111111111@10.0.0.30">sip:1111111111@10.0.0.30</a>]<br>
          DBG:mi_json:mi_json_run_mi_cmd: got string param [To:
          <a class="moz-txt-link-abbreviated" href="mailto:sip:1000001115@10.0.0.30">sip:1000001115@10.0.0.30</a>]<br>
          DBG:mi_json:mi_json_run_mi_cmd: got string param
          [Content-Type: text/plain]<br>
          DBG:mi_json:mi_json_run_mi_cmd: got mi_rpl=[0x7fe1bdee44d0]<br>
          DBG:mi_json:mi_json_answer_to_connection: building on page
          [0x7fe1bdd633b0:0]<br>
          DBG:mi_json:mi_json_build_page: start<br>
          DBG:mi_json:mi_json_build_content: start<br>
          DBG:mi_json:mi_json_build_content: done<br>
          DBG:httpd:answer_to_connection: MHD_create_response_from_data
          [0x7fe1bdd633b0:0]</div>
        <div> </div>
        <div> </div>
        <div>Any more tips?</div>
        <div> </div>
        <div>Thanks a lot.</div>
        <div>BR</div>
        <div>- Gary</div>
        <div> </div>
        <div>
          <div name="quote" style="margin:10px 5px 5px 10px; padding:
            10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap:
            break-word; -webkit-nbsp-mode: space; -webkit-line-break:
            after-white-space;">
            <div style="margin:0 0 10px 0;"><b>Sent:</b> Tuesday,
              September 23, 2014 at 7:41 AM<br>
              <b>From:</b> "Răzvan Crainea" <a class="moz-txt-link-rfc2396E" href="mailto:razvan@opensips.org">&lt;razvan@opensips.org&gt;</a><br>
              <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a><br>
              <b>Subject:</b> Re: [OpenSIPS-Users] mi_json parameters
              format</div>
            <div name="quoted-content">
              <div style="background-color: rgb(255,255,255);">
                <div class="moz-cite-prefix"><tt>Hi, Gary!</tt><br>
                  <br>
                  <tt>Have you tried quoting the entire curl parameter
                    using </tt><tt>quotes?</tt><br>
                  <br>
                  <tt>curl "127.0.0.1:8888/json/<tt><span
                        style="font-size: 12.0px;line-height: 19.2px;">t_uac_dlg</span></tt>?params=<span
                      style="line-height: 1.6em;">OPTIONS,<a
                        moz-do-not-send="true"
                        class="moz-txt-link-abbreviated"
                        href="sip:1000001115@10.0.0.30" target="_parent">sip:1000001115@10.0.0.30</a>,.,.,</span><span
                      style="line-height: 1.6em;">From: <a
                        moz-do-not-send="true"
                        class="moz-txt-link-abbreviated"
                        href="sip:1111111111@10.0.0.30" target="_parent">sip:1111111111@10.0.0.30</a>,</span><span
                      style="line-height: 1.6em;">To: <a
                        moz-do-not-send="true"
                        class="moz-txt-link-abbreviated"
                        href="sip:1000001115@10.0.0.30" target="_parent">sip:1000001115@10.0.0.30</a>,</span><span
                      style="line-height: 1.6em;">Content-Type:
                      text/plain"</span><br>
                    <br>
                    Best regards,</tt>
                  <pre class="moz-signature">Răzvan Crainea
OpenSIPS Solutions
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre>
                  On 09/22/2014 07:23 PM, Gary Nyquist wrote:</div>
                <blockquote>
                  <div style="font-family: Verdana;font-size: 12.0px;">
                    <div>Hi <span style="font-family: Verdana;font-size:
                        12.0px;line-height: 19.2px;">Răzvan,</span></div>
                    <div> </div>
                    <div>Thanks for the response.</div>
                    <div>The "<span style="font-family:
                        Verdana;font-size: 12.0px;line-height: 19.2px;">get_statistics</span>"
                      command works fine with the comma-separated
                      params.</div>
                    <div> </div>
                    <div>Facing problem with '<span style="font-family:
                        Verdana;font-size: 12.0px;line-height: 19.2px;">t_uac_dlg</span>'
                      command.</div>
                    <div>Can't figure out how to pass the headers in the
                      params.</div>
                    <div> </div>
                    <div>As per the 'tm' module doc:</div>
                    <div>
                      <div class="titlepage" style="font-family:
                        Helvetica , Arial;font-size: medium;line-height:
                        normal;">
                        <h3 class="title"><code class="function">t_uac_dlg</code></h3>
                      </div>
                      <p style="font-family: Helvetica ,
                        Arial;font-size: 12.0px;text-align:
                        justify;line-height: normal;">Generates and
                        sends a local SIP request.</p>
                      <p style="font-family: Helvetica ,
                        Arial;font-size: 12.0px;text-align:
                        justify;line-height: normal;">Parameters:</p>
                      <div class="itemizedlist" style="font-family:
                        Helvetica , Arial;font-size: medium;line-height:
                        normal;">
                        <ul type="disc">
                          <li>
                            <p style="font-size: 12.0px;text-align:
                              justify;"><span class="emphasis"><em>method</em></span> -
                              request method</p>
                          </li>
                          <li>
                            <p style="font-size: 12.0px;text-align:
                              justify;"><span class="emphasis"><em>RURI</em></span> -
                              request SIP URI</p>
                          </li>
                          <li>
                            <p style="font-size: 12.0px;text-align:
                              justify;"><span class="emphasis"><em>NEXT
                                  HOP</em></span> - next hop SIP URI
                              (OBP); use “<span class="quote">.</span>”
                              if no value.</p>
                          </li>
                          <li>
                            <p style="font-size: 12.0px;text-align:
                              justify;"><span class="emphasis"><em>socket</em></span> -
                              local socket to be used for sending the
                              request; use “<span class="quote">.</span>”
                              if no value.</p>
                          </li>
                          <li>
                            <p style="font-size: 12.0px;text-align:
                              justify;"><span class="emphasis"><em>headers</em></span> -
                              set of additional headers to be added to
                              the request; at least “<span class="quote">From</span>”
                              and “<span class="quote">To</span>”
                              headers must be specify)</p>
                          </li>
                          <li>
                            <p style="font-size: 12.0px;text-align:
                              justify;"><span class="emphasis"><em>body</em></span> -
                              (optional, may not be present) request
                              body (if present, requires the “<span
                                class="quote">Content-Type</span>” and “<span
                                class="quote">Content-length</span>”
                              headers)</p>
                          </li>
                        </ul>
                      </div>
                    </div>
                    <div><span style="line-height: 1.6em;">I want to
                        send (say) an OPTIONS packet.</span></div>
                    <div>
                      <div style="font-family: Verdana;font-size:
                        12.0px;line-height: 19.2px;">The following fifo
                        commands works fine:</div>
                      <div style="font-family: Verdana;font-size:
                        12.0px;line-height: 19.2px;">opensipsctl fifo
                        t_uac_dlg OPTIONS <a moz-do-not-send="true"
                          class="moz-txt-link-rfc2396E"
                          href="sip:1000001115@10.0.0.30"
                          target="_parent">"sip:1000001115@10.0.0.30"</a>
                        . . "\"From: <a moz-do-not-send="true"
                          class="moz-txt-link-abbreviated"
                          href="sip:1111111111@10.0.0.30%5Cr%5CnTo"
                          target="_parent">sip:1111111111@10.0.0.30\r\nTo</a>:
                        <a moz-do-not-send="true"
                          class="moz-txt-link-abbreviated"
                          href="sip:1000001115@10.0.0.30%5Cr%5CnContent-Type"
                          target="_parent">sip:1000001115@10.0.0.30\r\nContent-Type</a>:
                        text/plain\r\n"\"</div>
                      <div style="font-family: Verdana;font-size:
                        12.0px;line-height: 19.2px;"> </div>
                    </div>
                    <div>But, 'mi_json' command won't work.</div>
                    <div>Have tried (without luck) with several
                      permutations, including the follwoing:</div>
                    <div>curl 127.0.0.1:8888/json/<span
                        style="font-family: Verdana;font-size:
                        12.0px;line-height: 19.2px;">t_uac_dlg</span>?params=<span
                        style="line-height: 1.6em;">OPTIONS,<a
                          moz-do-not-send="true"
                          class="moz-txt-link-abbreviated"
                          href="sip:1000001115@10.0.0.30"
                          target="_parent">sip:1000001115@10.0.0.30</a>,.,.,</span><span
                        style="line-height: 1.6em;">From: <a
                          moz-do-not-send="true"
                          class="moz-txt-link-abbreviated"
                          href="sip:1111111111@10.0.0.30"
                          target="_parent">sip:1111111111@10.0.0.30</a>,</span><span
                        style="line-height: 1.6em;">To: <a
                          moz-do-not-send="true"
                          class="moz-txt-link-abbreviated"
                          href="sip:1000001115@10.0.0.30"
                          target="_parent">sip:1000001115@10.0.0.30</a>,</span><span
                        style="line-height: 1.6em;">Content-Type:
                        text/plain</span></div>
                    <div> </div>
                    <div>Have tried with url encoing the complete params
                      query string; but no OPTIONS packet goes out.</div>
                    <div><span style="line-height: 1.6em;">No errors in
                        the log also (debug level 4). </span></div>
                    <div> </div>
                    <div>Any clues?</div>
                    <div> </div>
                    <div><span style="font-family: Verdana;font-size:
                        12.0px;line-height: 19.2px;">Regards</span></div>
                    <div><span style="font-family: Verdana;font-size:
                        12.0px;line-height: 19.2px;">-Gary</span></div>
                    <div> 
                      <div style="margin: 10.0px 5.0px 5.0px
                        10.0px;padding: 10.0px 0 10.0px
                        10.0px;border-left: 2.0px solid
                        rgb(195,217,229);">
                        <div style="margin: 0 0 10.0px 0;"><b>Sent:</b> Monday,
                          September 22, 2014 at 8:11 AM<br>
                          <b>From:</b> "Răzvan Crainea" <a
                            moz-do-not-send="true"
                            class="moz-txt-link-rfc2396E"
                            href="razvan@opensips.org" target="_parent">&lt;razvan@opensips.org&gt;</a><br>
                          <b>To:</b> <a moz-do-not-send="true"
                            class="moz-txt-link-abbreviated"
                            href="users@lists.opensips.org"
                            target="_parent">users@lists.opensips.org</a><br>
                          <b>Subject:</b> Re: [OpenSIPS-Users] mi_json
                          parameters format</div>
                        <div>Hi, Gary!<br>
                          <br>
                          As the documentation indicates, you should
                          pass the parameters separated<br>
                          by comma. You can try something like this:<br>
                          <br>
                          curl <a moz-do-not-send="true"
                            class="moz-txt-link-rfc2396E"
                            href="http://127.0.0.1:8888/JSON/get_statistics?params=tm:,dialog:"
                            target="_blank">"http://127.0.0.1:8888/JSON/get_statistics?params=tm:,dialog:"</a><br>
                          <br>
                          Best regards,<br>
                          <br>
                          Răzvan Crainea<br>
                          OpenSIPS Solutions<br>
                          <a moz-do-not-send="true"
                            href="http://www.opensips-solutions.com"
                            target="_blank">www.opensips-solutions.com</a><br>
                          <br>
                          On 09/18/2014 11:41 PM, Gary Nyquist wrote:<br>
                          &gt; Hi,<br>
                          &gt;<br>
                          &gt; I am trying to use the MI interface to
                          generate SIP MESSAGE packets locally<br>
                          &gt; and send out to remote SIP UA.<br>
                          &gt;<br>
                          &gt; The 'opensipsctl fifo' method works fine.<br>
                          &gt; The 'mi_datagram' method works fine.<br>
                          &gt;<br>
                          &gt; But not able to make "mi_json" work with
                          "t_uac_dlg".<br>
                          &gt; Basically, can't figure out how the
                          parameters for "t_uac_dlg" be formatted for
                          the mi_json query.<br>
                          &gt;<br>
                          &gt; Reading the manual, I understand that the
                          "parameters are to be comma-separated then
                          URI-encoded."<br>
                          &gt; The following working fine:<br>
                          &gt; curl
                          10.0.0.30:8888/json/get_statistics?params=all<br>
                          &gt;<br>
                          &gt; But can't figure out how to pass the
                          parameters for "t_uac_dlg" command.<br>
                          &gt;<br>
                          &gt; Any help / advice?<br>
                          &gt;<br>
                          &gt; Thanks<br>
                          &gt; -Gary<br>
                          &gt;<br>
                          &gt;
                          _______________________________________________<br>
                          &gt; Users mailing list<br>
                          &gt; <a moz-do-not-send="true"
                            class="moz-txt-link-abbreviated"
                            href="Users@lists.opensips.org"
                            target="_parent">Users@lists.opensips.org</a><br>
                          &gt; <a moz-do-not-send="true"
                            href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                            target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                          <br>
                          <br>
_______________________________________________<br>
                          Users mailing list<br>
                          <a moz-do-not-send="true"
                            class="moz-txt-link-abbreviated"
                            href="Users@lists.opensips.org"
                            target="_parent">Users@lists.opensips.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                            target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></div>
                      </div>
                    </div>
                  </div>
                   
                  <fieldset class="mimeAttachmentHeader"> </fieldset>
                   
                  <pre>_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="Users@lists.opensips.org" target="_parent">Users@lists.opensips.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                </blockquote>
                <br>
                _______________________________________________ Users
                mailing list <a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <a
                  moz-do-not-send="true"
                  href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                  target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>