[asterisk-bugs] [JIRA] (ASTERISK-25391) AMI GetConfigJSON returns invalid JSON

Kevin Harwell (JIRA) noreply at issues.asterisk.org
Tue Oct 6 14:32:33 CDT 2015


     [ https://issues.asterisk.org/jira/browse/ASTERISK-25391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Harwell closed ASTERISK-25391.
------------------------------------

                  Resolution: Fixed
    Target Release Version/s: 11.20.0

> AMI GetConfigJSON returns invalid JSON
> --------------------------------------
>
>                 Key: ASTERISK-25391
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25391
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/ManagerInterface
>    Affects Versions: 13.5.0
>         Environment: Debian 8
>            Reporter: Bojan Nemčić
>            Severity: Minor
>      Target Release: 11.20.0
>
>
> JSON returned by manager action GetConfigJSON is invalid.
> Example output (formatted the JSON for readibility):
> {code}
> Response: Success
> JSON: 
> {
>     "100": [
>         templates: "tpl1",
>         "type": "friend",
>         "host": "dynamic",
>         "nat": "no",
>         "secret": "1234",
>         "context": "sip-phones",
>         "dtmfmode": "rfc2833",
>         "canreinvite": "no",
>         "allowsubscribe": "yes",
>         "relaxdtmf": "yes",
>         "allow": "!all,alaw,ulaw,ilbc,speex16",
>         "pickupgroup": "1",
>         "callgroup": "1",
>         "language": "hr",
>         "cc_agent_policy": "generic",
>         "cc_monitor_policy": "generic",
>         "progressinband": "yes",
>         "callcounter": "yes"
>     ]
> }
> {code}
> According to [specification|http://json.org/], the inner structure should be an object, not an array (in other words, {{\[}} and {{\]}} characters should be
> {{\{}} and {{\}}}).
> Additionally, {{templates}} key should be quoted.
> Correct output of above should be:
> {code}
> Response: Success
> JSON: 
> {
>     "100": {
>         "templates": "tpl1",
>         "type": "friend",
>         "host": "dynamic",
>         "nat": "no",
>         "secret": "1234",
>         "context": "sip-phones",
>         "dtmfmode": "rfc2833",
>         "canreinvite": "no",
>         "allowsubscribe": "yes",
>         "relaxdtmf": "yes",
>         "allow": "!all,alaw,ulaw,ilbc,speex16",
>         "pickupgroup": "1",
>         "callgroup": "1",
>         "language": "hr",
>         "cc_agent_policy": "generic",
>         "cc_monitor_policy": "generic",
>         "progressinband": "yes",
>         "callcounter": "yes"
>     }
> }
> {code}
> Possible duplicate of ASTERISK-25357, but since the description there is vague I created a new one in case the author was referencing something else.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list