[OpenSIPS-Users] Users Digest, Vol 120, Issue 29

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Jul 24 07:58:04 EDT 2018


Hi Kirill,

I just pushed a fix for that extra '\n':
https://github.com/OpenSIPS/opensips/commit/01f8f0867431ddb9e085f4cee460e3e748314887

The fix is on all branches, so update from GIT and give it a try.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
   http://opensips.org/training/OpenSIPS_Bootcamp_2018/

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180724/1ed9cba1/attachment-0001.html>


More information about the Users mailing list