[Home]

Summary:ASTERISK-24751: Integer values in json payload to ARI cause asterisk to crash
Reporter:jeffrey putnam (jputnam)Labels:
Date Opened:2015-02-02 15:30:09.000-0600Date Closed:2015-02-27 12:24:44.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:
Versions:SVN 13.0.2 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Linux (both ubuntu and centos). Attachments:
Description:Sending the following request to asterisk via ari causes asterisk to crash.

{noformat}
def do_one_call(call_to='SIP/666', sleeptime=10) :
   channel_base= str(uuid4())

   params = {
               'endpoint' : "SIP/666",
               'channelId' : channel_base,
               'extension' : '200',
               'priority' : '1',
               'context' : 'testphone', # this exists
            }

   vars = {
            "variables" : {
                  "digits" : "1217",
                  "code" : "3567",
                  "language" : "en-US",
                  "foo" : 1,
          } }

   headers = {"content-type" : "application/json" }
   request = post(url, params=params, data=json.dumps(vars), auth=auth, headers=headers)
do_one_call()
{noformat}

I have a properly registered and running sip phone at 666.  

Extensions.conf context testphone has this at extension 200 :

{noformat}
exten => 200,1,NoOp(testphone 200)
same =>     n,Answer()
same =>     n,Playback(silence/4)
same =>     n,Hangup()
same =>     n,NoOp(testphone 200 done)
{noformat}

Changing the value of "foo" above to "1" and everthing works.   gdb on the core dump shows asterisk failing at config.c:290 in trying to evalue strlen of a null value.  

Workaround - make sure all parameters in json payload are passed in as strings.  
Comments: