[Asterisk-code-review] ARI: Detect duplicate channel IDs (asterisk[13])
Mark Michelson
asteriskteam at digium.com
Wed Oct 19 16:17:06 CDT 2016
Hello Anonymous Coward #1000019, Joshua Colp,
I'd like you to reexamine a change. Please visit
https://gerrit.asterisk.org/4150
to look at the new patch set (#2).
Change subject: ARI: Detect duplicate channel IDs
......................................................................
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
---
M include/asterisk/channel.h
M include/asterisk/channel_internal.h
M main/cdr.c
M main/channel.c
M main/channel_internal_api.c
M res/ari/resource_channels.c
M res/res_ari_channels.c
M rest-api/api-docs/channels.json
8 files changed, 101 insertions(+), 6 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/50/4150/2
--
To view, visit https://gerrit.asterisk.org/4150
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibba7ae68842dab6df0c2e9c45559208bc89d3d06
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-code-review
mailing list