<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Kirill,<br>
      <br>
      I just pushed a fix for that extra '\n':<br>
         
<a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/commit/01f8f0867431ddb9e085f4cee460e3e748314887">https://github.com/OpenSIPS/opensips/commit/01f8f0867431ddb9e085f4cee460e3e748314887</a><br>
      <br>
      The fix is on all branches, so update from GIT and give it a try.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2018
  <a class="moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a>
</pre>
    <div class="moz-cite-prefix">On 07/20/2018 10:29 AM, Kirill
      Galinurov wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPDUut8SUC76o=dMcR5u5pCmyXeqHywhveOiFEYU-gLNPB9Zkg@mail.gmail.com">
      <div dir="ltr">Yes it's wrong Data format.
        <div> "Date":"Thu Jul 19 11:30:33 2018 <br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2018-07-19 19:00 GMT+03:00 <span
            dir="ltr"><<a
              href="mailto:users-request@lists.opensips.org"
              target="_blank" moz-do-not-send="true">users-request@lists.opensips.org</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Users
            mailing list submissions to<br>
                    <a href="mailto:users@lists.opensips.org"
              moz-do-not-send="true">users@lists.opensips.org</a><br>
            <br>
            To subscribe or unsubscribe via the World Wide Web, visit<br>
                    <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            or, via email, send a message with subject or body 'help' to<br>
                    <a href="mailto:users-request@lists.opensips.org"
              moz-do-not-send="true">users-request@lists.opensips.<wbr>org</a><br>
            <br>
            You can reach the person managing the list at<br>
                    <a href="mailto:users-owner@lists.opensips.org"
              moz-do-not-send="true">users-owner@lists.opensips.org</a><br>
            <br>
            When replying, please edit your Subject line so it is more
            specific<br>
            than "Re: Contents of Users digest..."<br>
            <br>
            <br>
            Today's Topics:<br>
            <br>
               1. Re: mi_json returns invalid JSON (Răzvan Crainea)<br>
               2. Re: mi_json returns invalid JSON (Ben Newlin)<br>
               3. Re: mi_json returns invalid JSON (Ben Newlin)<br>
            <br>
            <br>
            ------------------------------<wbr>------------------------------<wbr>----------<br>
            <br>
            Message: 1<br>
            Date: Thu, 19 Jul 2018 10:14:37 +0300<br>
            From: Răzvan Crainea <<a
              href="mailto:razvan@opensips.org" moz-do-not-send="true">razvan@opensips.org</a>><br>
            To: <a href="mailto:users@lists.opensips.org"
              moz-do-not-send="true">users@lists.opensips.org</a><br>
            Subject: Re: [OpenSIPS-Users] mi_json returns invalid JSON<br>
            Message-ID: <<a
              href="mailto:04329915-bc6d-0b21-547f-c114ccca3e66@opensips.org"
              moz-do-not-send="true">04329915-bc6d-0b21-547f-<wbr>c114ccca3e66@opensips.org</a>><br>
            Content-Type: text/plain; charset=utf-8; format=flowed<br>
            <br>
            Hi, Kirill!<br>
            <br>
            This doesn't seem to be an invalid JSON, but only a bad
            formatting of <br>
            the date. I agree it should not include the "\n", because it
            is useless, <br>
            but this doesn't make it invalid. Are you experiencing
            trouble with <br>
            using JSON libraries that don't support this format?<br>
            <br>
            Best regards,<br>
            Răzvan<br>
            <br>
            On 07/17/2018 12:58 PM, Kirill Galinurov wrote:<br>
            > Hi. I use opensips mi_json module to get statistics.<br>
            > But for some commands it returns incorrect JSON.<br>
            > For example /json/dr_reload_status returns<br>
            > <br>
            > {"Partition": [{"value":"sipprovider_def",
            "attributes":{"Date": "Mon <br>
            > Jul 16 07:10:58 2018<br>
            > "}}, {"value":"beeline", "attributes":{"Date": "Mon Jul
            16 07:11:59 2018<br>
            > "}}, {"value":"megafon", "attributes":{"Date": "Mon Jul
            16 07:11:59 2018<br>
            > "}}, {"value":"megafon", "attributes":{"Date": "Mon Jul
            16 07:12:54 2018<br>
            > "}}, {"value":"mts", "attributes":{"Date": "Mon Jul 16
            07:12:54 2018<br>
            > "}}, {"value":"mts", "attributes":{"Date": "Mon Jul 16
            07:13:51 2018<br>
            > "}}, {"value":"beeline", "attributes":{"Date": "Mon Jul
            16 07:13:52 2018<br>
            > "}}]}<br>
            > <br>
            > This is incorrect, because it shoulde not include "\n"
            symbols.<br>
            > <br>
            > <br>
            > ______________________________<wbr>_________________<br>
            > Users mailing list<br>
            > <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
            > <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            > <br>
            <br>
            -- <br>
            Răzvan Crainea<br>
            OpenSIPS Core Developer<br>
               <a href="http://www.opensips-solutions.com"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a><br>
            <br>
            <br>
            <br>
            ------------------------------<br>
            <br>
            Message: 2<br>
            Date: Thu, 19 Jul 2018 12:58:24 +0000<br>
            From: Ben Newlin <<a href="mailto:Ben.Newlin@genesys.com"
              moz-do-not-send="true">Ben.Newlin@genesys.com</a>><br>
            To: OpenSIPS users mailling list <<a
              href="mailto:users@lists.opensips.org"
              moz-do-not-send="true">users@lists.opensips.org</a>><br>
            Subject: Re: [OpenSIPS-Users] mi_json returns invalid JSON<br>
            Message-ID: <<a
              href="mailto:E8BDB991-E1A9-41B1-8D66-6A7F149FF27C@genesys.com"
              moz-do-not-send="true">E8BDB991-E1A9-41B1-8D66-<wbr>6A7F149FF27C@genesys.com</a>><br>
            Content-Type: text/plain; charset=UTF-8<br>
            <br>
            I believe newline characters used within JSON must be
            escaped. So if the JSON actually contains "\n" that is
            invalid. It must be "\\n".<br>
            <br>
            Ben Newlin <br>
            <br>
            On 7/19/18, 3:19 AM, "Users on behalf of Răzvan Crainea"
            <<a href="mailto:users-bounces@lists.opensips.org"
              moz-do-not-send="true">users-bounces@lists.opensips.<wbr>org</a>
            on behalf of <a href="mailto:razvan@opensips.org"
              moz-do-not-send="true">razvan@opensips.org</a>> wrote:<br>
            <br>
                Hi, Kirill!<br>
            <br>
                This doesn't seem to be an invalid JSON, but only a bad
            formatting of <br>
                the date. I agree it should not include the "\n",
            because it is useless, <br>
                but this doesn't make it invalid. Are you experiencing
            trouble with <br>
                using JSON libraries that don't support this format?<br>
            <br>
                Best regards,<br>
                Răzvan<br>
            <br>
                On 07/17/2018 12:58 PM, Kirill Galinurov wrote:<br>
                > Hi. I use opensips mi_json module to get
            statistics.<br>
                > But for some commands it returns incorrect JSON.<br>
                > For example /json/dr_reload_status returns<br>
                > <br>
                > {"Partition": [{"value":"sipprovider_def",
            "attributes":{"Date": "Mon <br>
                > Jul 16 07:10:58 2018<br>
                > "}}, {"value":"beeline", "attributes":{"Date": "Mon
            Jul 16 07:11:59 2018<br>
                > "}}, {"value":"megafon", "attributes":{"Date": "Mon
            Jul 16 07:11:59 2018<br>
                > "}}, {"value":"megafon", "attributes":{"Date": "Mon
            Jul 16 07:12:54 2018<br>
                > "}}, {"value":"mts", "attributes":{"Date": "Mon Jul
            16 07:12:54 2018<br>
                > "}}, {"value":"mts", "attributes":{"Date": "Mon Jul
            16 07:13:51 2018<br>
                > "}}, {"value":"beeline", "attributes":{"Date": "Mon
            Jul 16 07:13:52 2018<br>
                > "}}]}<br>
                > <br>
                > This is incorrect, because it shoulde not include
            "\n" symbols.<br>
                > <br>
                > <br>
                > ______________________________<wbr>_________________<br>
                > Users mailing list<br>
                > <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
                > <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
                > <br>
            <br>
                -- <br>
                Răzvan Crainea<br>
                OpenSIPS Core Developer<br>
                   <a href="http://www.opensips-solutions.com"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a><br>
            <br>
                ______________________________<wbr>_________________<br>
                Users mailing list<br>
                <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
                <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            <br>
            <br>
            <br>
            ------------------------------<br>
            <br>
            Message: 3<br>
            Date: Thu, 19 Jul 2018 13:03:09 +0000<br>
            From: Ben Newlin <<a href="mailto:Ben.Newlin@genesys.com"
              moz-do-not-send="true">Ben.Newlin@genesys.com</a>><br>
            To: OpenSIPS users mailling list <<a
              href="mailto:users@lists.opensips.org"
              moz-do-not-send="true">users@lists.opensips.org</a>><br>
            Subject: Re: [OpenSIPS-Users] mi_json returns invalid JSON<br>
            Message-ID: <<a
              href="mailto:EA885C6A-2909-4210-A99A-B54D52334761@genesys.com"
              moz-do-not-send="true">EA885C6A-2909-4210-A99A-<wbr>B54D52334761@genesys.com</a>><br>
            Content-Type: text/plain; charset=UTF-8<br>
            <br>
            Actually, after further investigation I'm no longer sure
            that is true. According to <a href="http://www.json.org/"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.json.org/</a>
            the "\n" is valid in JSON.<br>
            <br>
            Ben Newlin <br>
            <br>
            On 7/19/18, 8:58 AM, "Ben Newlin" <<a
              href="mailto:Ben.Newlin@genesys.com"
              moz-do-not-send="true">Ben.Newlin@genesys.com</a>>
            wrote:<br>
            <br>
                I believe newline characters used within JSON must be
            escaped. So if the JSON actually contains "\n" that is
            invalid. It must be "\\n".<br>
            <br>
                Ben Newlin <br>
            <br>
                On 7/19/18, 3:19 AM, "Users on behalf of Răzvan Crainea"
            <<a href="mailto:users-bounces@lists.opensips.org"
              moz-do-not-send="true">users-bounces@lists.opensips.<wbr>org</a>
            on behalf of <a href="mailto:razvan@opensips.org"
              moz-do-not-send="true">razvan@opensips.org</a>> wrote:<br>
            <br>
                    Hi, Kirill!<br>
            <br>
                    This doesn't seem to be an invalid JSON, but only a
            bad formatting of <br>
                    the date. I agree it should not include the "\n",
            because it is useless, <br>
                    but this doesn't make it invalid. Are you
            experiencing trouble with <br>
                    using JSON libraries that don't support this format?<br>
            <br>
                    Best regards,<br>
                    Răzvan<br>
            <br>
                    On 07/17/2018 12:58 PM, Kirill Galinurov wrote:<br>
                    > Hi. I use opensips mi_json module to get
            statistics.<br>
                    > But for some commands it returns incorrect
            JSON.<br>
                    > For example /json/dr_reload_status returns<br>
                    > <br>
                    > {"Partition": [{"value":"sipprovider_def",
            "attributes":{"Date": "Mon <br>
                    > Jul 16 07:10:58 2018<br>
                    > "}}, {"value":"beeline", "attributes":{"Date":
            "Mon Jul 16 07:11:59 2018<br>
                    > "}}, {"value":"megafon", "attributes":{"Date":
            "Mon Jul 16 07:11:59 2018<br>
                    > "}}, {"value":"megafon", "attributes":{"Date":
            "Mon Jul 16 07:12:54 2018<br>
                    > "}}, {"value":"mts", "attributes":{"Date": "Mon
            Jul 16 07:12:54 2018<br>
                    > "}}, {"value":"mts", "attributes":{"Date": "Mon
            Jul 16 07:13:51 2018<br>
                    > "}}, {"value":"beeline", "attributes":{"Date":
            "Mon Jul 16 07:13:52 2018<br>
                    > "}}]}<br>
                    > <br>
                    > This is incorrect, because it shoulde not
            include "\n" symbols.<br>
                    > <br>
                    > <br>
                    > ______________________________<wbr>_________________<br>
                    > Users mailing list<br>
                    > <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
                    > <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
                    > <br>
            <br>
                    -- <br>
                    Răzvan Crainea<br>
                    OpenSIPS Core Developer<br>
                       <a href="http://www.opensips-solutions.com"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a><br>
            <br>
                    ______________________________<wbr>_________________<br>
                    Users mailing list<br>
                    <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
                    <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            <br>
            <br>
            <br>
            <br>
            <br>
            ------------------------------<br>
            <br>
            Subject: Digest Footer<br>
            <br>
            ______________________________<wbr>_________________<br>
            Users mailing list<br>
            <a href="mailto:Users@lists.opensips.org"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
            <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            <br>
            <br>
            ------------------------------<br>
            <br>
            End of Users Digest, Vol 120, Issue 29<br>
            ******************************<wbr>********<br>
          </blockquote>
        </div>
        <br>
      </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>