]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res/res_ari: Add additional hangup reasons
authorSebastian Damm <damm@sipgate.de>
Thu, 6 Dec 2018 17:23:50 +0000 (18:23 +0100)
committerSebastian Damm <damm@sipgate.de>
Tue, 11 Dec 2018 10:22:27 +0000 (05:22 -0500)
The ARI DELETE /channels command takes a "reason" parameter
Previously, there were only five reasons implemented
This patch adds more reasons to choose from for more
complex setups

ASTERISK-28198 #close

Change-Id: I85996f1076c9946d65c778413f040a845a90fecc

res/ari/resource_channels.c
rest-api/api-docs/channels.json

index bca32f1243439c73bc8392929b0cfd1b8c281727..8aeb0961aee96c05513112e8e52fa8fefafa8605 100644 (file)
@@ -884,6 +884,22 @@ 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, "timeout")) {
+               cause = AST_CAUSE_NO_USER_RESPONSE;
+       } else if (!strcmp(args->reason, "rejected")) {
+               cause = AST_CAUSE_CALL_REJECTED;
+       } else if (!strcmp(args->reason, "unallocated")) {
+               cause = AST_CAUSE_UNALLOCATED;
+       } else if (!strcmp(args->reason, "normal_unspecified")) {
+               cause = AST_CAUSE_NORMAL_UNSPECIFIED;
+       } else if (!strcmp(args->reason, "number_incomplete")) {
+               cause = AST_CAUSE_INVALID_NUMBER_FORMAT;
+       } else if (!strcmp(args->reason, "codec_mismatch")) {
+               cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
+       } else if (!strcmp(args->reason, "interworking")) {
+               cause = AST_CAUSE_INTERWORKING;
+       } else if (!strcmp(args->reason, "failure")) {
+               cause = AST_CAUSE_FAILURE;
        } else if(!strcmp(args->reason, "answered_elsewhere")) {
                cause = AST_CAUSE_ANSWERED_ELSEWHERE;
        } else {
index ec8bae235d32a2909dd6329d9b91965f944e3fe0..08db22467a5615a28abe24f6bcf3f7acc010a510 100644 (file)
                                                                        "busy",
                                                                        "congestion",
                                                                        "no_answer",
+                                                                       "timeout",
+                                                                       "rejected",
+                                                                       "unallocated",
+                                                                       "normal_unspecified",
+                                                                       "number_incomplete",
+                                                                       "codec_mismatch",
+                                                                       "interworking",
+                                                                       "failure",
                                                                        "answered_elsewhere"
                                                                ]
                                                        }