]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Expand hook flash recognition.
authorNaveen Albert <mail@interlinked.x10host.com>
Thu, 13 May 2021 13:50:02 +0000 (09:50 -0400)
committerJoshua Colp <jcolp@sangoma.com>
Mon, 17 May 2021 13:55:38 +0000 (08:55 -0500)
Some ATAs send hook flash events as application/hook-flash, rather than a DTMF
event. Now, we also recognize hook-flash as a flash event.

ASTERISK-29370

Change-Id: I1c3b82a040dff3affcd94bad8ce33edc90c04725

channels/chan_sip.c

index b13b892644dd4d37fe6b88df45042ad3404fb59e..1c9ba5f9c2d8e02fcda817e1dfabe1aae8c80f00 100644 (file)
@@ -22626,6 +22626,18 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
        const char *c = sip_get_header(req, "Content-Type");
 
        /* Need to check the media/type */
+
+       if (!strcasecmp(c, "application/hook-flash")) {
+               /* send a FLASH event, for ATAs that send flash as hook-flash not dtmf */
+               struct ast_frame f = { AST_FRAME_CONTROL, { AST_CONTROL_FLASH, } };
+               ast_queue_frame(p->owner, &f);
+               if (sipdebug) {
+                       ast_verbose("* DTMF-relay event received: FLASH\n");
+               }
+               transmit_response(p, "200 OK", req);
+               return;
+       }
+
        if (!strcasecmp(c, "application/dtmf-relay") ||
            !strcasecmp(c, "application/vnd.nortelnetworks.digits") ||
            !strcasecmp(c, "application/dtmf")) {