mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merge "ARI: Detect duplicate channel IDs" into 13
This commit is contained in:
@@ -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);
|
||||
|
@@ -253,6 +253,7 @@ static void ast_ari_channels_originate_cb(
|
||||
case 500: /* Internal Server Error */
|
||||
case 501: /* Not Implemented */
|
||||
case 400: /* Invalid parameters for originating a channel. */
|
||||
case 409: /* Channel with given unique ID already exists. */
|
||||
is_valid = 1;
|
||||
break;
|
||||
default:
|
||||
@@ -483,6 +484,7 @@ static void ast_ari_channels_originate_with_id_cb(
|
||||
case 500: /* Internal Server Error */
|
||||
case 501: /* Not Implemented */
|
||||
case 400: /* Invalid parameters for originating a channel. */
|
||||
case 409: /* Channel with given unique ID already exists. */
|
||||
is_valid = 1;
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user