[asterisk-bugs] [JIRA] (ASTERISK-24284) ARI bridge creating fails with 500 error. Incorrect type parameter parsing

Matt Jordan (JIRA) noreply at issues.asterisk.org
Thu Aug 28 20:37:29 CDT 2014


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

Matt Jordan updated ASTERISK-24284:
-----------------------------------

    Description: 
Bridge create query

{noformat}
curl -v -u "user":"password" -X POST "http://localhost:8088/ari/bridges?bridgeId=16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d&type=mixing,holding,dtmf_events,proxy_media"
{noformat}

returns 500 error. When type param contains spaces, it works.

{noformat}
 curl -v -u "user":"password" -X POST "http://localhost:8088/ari/bridges?bridgeId=16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d&type=mixing, holding, dtmf_events, proxy_media"
{noformat}

Returned data is:
{noformat}
{"id":"16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d","channels":[],"name":"","technology":"simple_bridge","bridge_class":"stasis","creator":"Stasis","bridge_type":"mixing"}
{noformat}

As you can see type contains only mixing param and this is incorrect behavior. But at least it works.

When I am using the same parameters separated with commas and spaces in my ari client code it returns 500 error. Weird thing. In previous Asterisk version my client had the same code and here is example how it worked.

Request: 

{noformat}
{ type: 'mixing, holding, dtmf_events, proxy_media',
  bridgeId: 'b1cc1a44-0091-49db-ad62-97d165d70c05' }
{noformat}

Response:

{noformat}
{"id":"b1cc1a44-0091-49db-ad62-97d165d70c05","channels":[],"name":"","technology":"holding_bridge","bridge_class":"base","creator":"Stasis","bridge_type":"holding"}
{noformat}

Returned body had only holding type, which is also wrong. Another weird thing. I think the new ARI has some errors in its param parser. 


  was:
Bridge create query
 
curl -v -u "user":"password" -X POST "http://localhost:8088/ari/bridges?bridgeId=16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d&type=mixing,holding,dtmf_events,proxy_media"

returns 500 error. When type param contains spaces, it works.

 curl -v -u "user":"password" -X POST "http://localhost:8088/ari/bridges?bridgeId=16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d&type=mixing, holding, dtmf_events, proxy_media"

Returned data is:
{"id":"16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d","channels":[],"name":"","technology":"simple_bridge","bridge_class":"stasis","creator":"Stasis","bridge_type":"mixing"}

As you can see type contains only mixing param and this is incorrect behavior. But at least it works.

When I am using the same parameters separated with commas and spaces in my ari client code it returns 500 error. Weird thing. In previous Asterisk version my client had the same code and here is example how it worked.

Request: 

{ type: 'mixing, holding, dtmf_events, proxy_media',
  bridgeId: 'b1cc1a44-0091-49db-ad62-97d165d70c05' }

Response:

{"id":"b1cc1a44-0091-49db-ad62-97d165d70c05","channels":[],"name":"","technology":"holding_bridge","bridge_class":"base","creator":"Stasis","bridge_type":"holding"}

Returned body had only holding type, which is also wrong. Another weird thing. I think the new ARI has some errors in its param parser. 



> ARI bridge creating fails with 500 error. Incorrect type parameter parsing
> --------------------------------------------------------------------------
>
>                 Key: ASTERISK-24284
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24284
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>    Affects Versions: 12.5.0
>            Reporter: Pavel Kukin
>
> Bridge create query
> {noformat}
> curl -v -u "user":"password" -X POST "http://localhost:8088/ari/bridges?bridgeId=16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d&type=mixing,holding,dtmf_events,proxy_media"
> {noformat}
> returns 500 error. When type param contains spaces, it works.
> {noformat}
>  curl -v -u "user":"password" -X POST "http://localhost:8088/ari/bridges?bridgeId=16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d&type=mixing, holding, dtmf_events, proxy_media"
> {noformat}
> Returned data is:
> {noformat}
> {"id":"16e1bbaf-2d96-4bf2-a591-0dc9ab0d8d2d","channels":[],"name":"","technology":"simple_bridge","bridge_class":"stasis","creator":"Stasis","bridge_type":"mixing"}
> {noformat}
> As you can see type contains only mixing param and this is incorrect behavior. But at least it works.
> When I am using the same parameters separated with commas and spaces in my ari client code it returns 500 error. Weird thing. In previous Asterisk version my client had the same code and here is example how it worked.
> Request: 
> {noformat}
> { type: 'mixing, holding, dtmf_events, proxy_media',
>   bridgeId: 'b1cc1a44-0091-49db-ad62-97d165d70c05' }
> {noformat}
> Response:
> {noformat}
> {"id":"b1cc1a44-0091-49db-ad62-97d165d70c05","channels":[],"name":"","technology":"holding_bridge","bridge_class":"base","creator":"Stasis","bridge_type":"holding"}
> {noformat}
> Returned body had only holding type, which is also wrong. Another weird thing. I think the new ARI has some errors in its param parser. 



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



More information about the asterisk-bugs mailing list