summaryrefslogtreecommitdiff
path: root/rest-api
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2016-10-17 14:18:57 -0500
committerMark Michelson <mmichelson@digium.com>2016-10-20 12:58:37 -0500
commit98378133c05bf683792337612f964663b63c72d6 (patch)
tree6be5f327bed047e45eeae87dc3f26cc0b74ea5eb /rest-api
parent230dd6f9af3a3d59f0e2654eb3d509a1ce63574f (diff)
ARI: Detect duplicate channel IDs
ARI and AMI allow for an explicit channel ID to be specified when originating channels. Unfortunately, there is nothing in place to prevent someone from using the same ID for multiple channels. Further complicating things, adding ID validation to channel allocation makes it impossible for ARI to discern why channel allocation failed, resulting in a vague error code being returned. The fix for this is to institute a new method for channel errors to be discerned. The method mirrors errno, in that when an error occurs, the caller can consult the channel errno value to determine what the error was. This initial iteration of the feature only introduces "unknown" and "channel ID exists" errors. However, it's possible to add more errors as needed. ARI uses this feature to determine why channel allocation failed and can return a 409 error during origination to show that a channel with the given ID already exists. ASTERISK-26421 Change-Id: Ibba7ae68842dab6df0c2e9c45559208bc89d3d06
Diffstat (limited to 'rest-api')
-rw-r--r--rest-api/api-docs/channels.json8
1 files changed, 8 insertions, 0 deletions
diff --git a/rest-api/api-docs/channels.json b/rest-api/api-docs/channels.json
index 75feeb105..522cc00c4 100644
--- a/rest-api/api-docs/channels.json
+++ b/rest-api/api-docs/channels.json
@@ -142,6 +142,10 @@
{
"code": 400,
"reason": "Invalid parameters for originating a channel."
+ },
+ {
+ "code": 409,
+ "reason": "Channel with given unique ID already exists."
}
]
}
@@ -368,6 +372,10 @@
{
"code": 400,
"reason": "Invalid parameters for originating a channel."
+ },
+ {
+ "code": 409,
+ "reason": "Channel with given unique ID already exists."
}
]