[Asterisk-code-review] chan_sip: Expand hook flash recognition. (asterisk[16])

Friendly Automation asteriskteam at digium.com
Mon May 17 08:43:03 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15886 )

Change subject: chan_sip: Expand hook flash recognition.
......................................................................

chan_sip: Expand hook flash recognition.

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
---
M channels/chan_sip.c
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8acc5a1..94eeeac 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22626,6 +22626,18 @@
 	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")) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15886
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I1c3b82a040dff3affcd94bad8ce33edc90c04725
Gerrit-Change-Number: 15886
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210517/3f22dcaa/attachment.html>


More information about the asterisk-code-review mailing list