resource_channels.c: add hangup reason "answered_elsewhere".

In ARI, the channels API allows to hangup a channel with a hangup reason.
This commit adds a new reason "answered_elsewhere".
When using a SIP channel, this will eventually allow Asterisk to add a proper
"Reason" header to a CANCEL message.

ASTERISK-26321

Change-Id: Ia97675bd4acd6a7f58eb467953dfb94559f6583d
This commit is contained in:
Jean Aunis
2016-08-31 12:33:28 +02:00
parent e7d06a8097
commit 91993ebaa5
2 changed files with 4 additions and 1 deletions

View File

@@ -886,6 +886,8 @@ void ast_ari_channels_hangup(struct ast_variable *headers,
cause = AST_CAUSE_CONGESTION;
} else if (!strcmp(args->reason, "no_answer")) {
cause = AST_CAUSE_NOANSWER;
} else if(!strcmp(args->reason, "answered_elsewhere")) {
cause = AST_CAUSE_ANSWERED_ELSEWHERE;
} else {
ast_ari_response_error(
response, 400, "Invalid Reason",

View File

@@ -400,7 +400,8 @@
"normal",
"busy",
"congestion",
"no_answer"
"no_answer",
"answered_elsewhere"
]
}
}