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

Bojan Nemčić (JIRA) noreply at issues.asterisk.org
Fri Sep 11 07:27:34 CDT 2015


Bojan Nemčić created ASTERISK-25391:
---------------------------------------

             Summary: 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


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 {{\}}}). 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 https://issues.asterisk.org/jira/browse/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