diff options
author | Joshua Colp <jcolp@digium.com> | 2016-10-24 18:20:33 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-10-24 18:20:33 -0500 |
commit | 578e34b445a1aec8d6cb3a2bf743ff69874adcb0 (patch) | |
tree | 78346c028af5a28996d1c261785c057d1d48e802 /res/ari | |
parent | c2036c827cb22e2fbf509d4318b6f177d516c033 (diff) | |
parent | eff97808fb95e4f9de13c90990f8ef5435352f31 (diff) |
Merge "ARI: Detect duplicate channel IDs" into 13
Diffstat (limited to 'res/ari')
-rw-r--r-- | res/ari/resource_channels.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 6baac7a4e..04db70451 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -1109,7 +1109,12 @@ static void ari_channels_handle_originate_with_id(const char *args_endpoint, } if (ast_dial_prerun(dial, other, format_cap)) { - ast_ari_response_alloc_failed(response); + if (ast_channel_errno() == AST_CHANNEL_ERROR_ID_EXISTS) { + ast_ari_response_error(response, 409, "Conflict", + "Channel with given unique ID already exists"); + } else { + ast_ari_response_alloc_failed(response); + } ast_dial_destroy(dial); ast_free(origination); ast_channel_cleanup(other); |