From 1fd3a7849e3a1136f5722221a9f1874a5587b6d6 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Wed, 1 Jun 2016 13:48:00 -0500 Subject: ARI: Ensure proper channel state on operations. ARI was recently outfitted with operations to create and dial channels. This leads to the ability to try funny stuff. You could create a channel and then immediately try to play back media on it. You could create a channel, dial it, and while it is ringing attempt to make it continue in the dialplan. This commit attempts to fix this by adding a channel state check to operations that should not be able to operate on outbound channels that have not yet answered. If a channel is in an invalid state, we will send a 412 response. ASTERISK-26047 #close Reported by Mark Michelson Change-Id: I2ca51bf9ef2b44a1dc5a73f2d2de35c62c37dfd8 --- rest-api/api-docs/channels.json | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'rest-api') diff --git a/rest-api/api-docs/channels.json b/rest-api/api-docs/channels.json index aafd231a1..34436c7b8 100644 --- a/rest-api/api-docs/channels.json +++ b/rest-api/api-docs/channels.json @@ -453,6 +453,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -501,6 +505,10 @@ { "code": 422, "reason": "Endpoint is not the same type as the channel" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -533,6 +541,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -565,6 +577,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] }, @@ -591,6 +607,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -671,6 +691,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -720,6 +744,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] }, @@ -763,6 +791,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -795,6 +827,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] }, @@ -821,6 +857,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -862,6 +902,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] }, @@ -888,6 +932,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -921,6 +969,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] }, @@ -947,6 +999,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -1021,6 +1077,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } @@ -1095,6 +1155,10 @@ { "code": 409, "reason": "Channel not in a Stasis application" + }, + { + "code": 412, + "reason": "Channel in invalid state" } ] } -- cgit v1.2.3