[Asterisk-code-review] res_rtp_asterisk: Only raise flash control frame on end. (asterisk[18])

George Joseph asteriskteam at digium.com
Wed Mar 31 11:55:01 CDT 2021


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15721 )

Change subject: res_rtp_asterisk: Only raise flash control frame on end.
......................................................................

res_rtp_asterisk: Only raise flash control frame on end.

Flash in RTP is conveyed the same as DTMF, just with a
specific digit. In Asterisk however we do flash as a
single control frame.

This change makes it so that only on end do we provide
the flash control frame to the core. Previously we would
provide a flash control frame on both begin and end,
causing flash to work improperly.

ASTERISK-29373

Change-Id: I1accd9c6e859811336e670e698bd8bd124f33226
---
M res/res_rtp_asterisk.c
1 file changed, 13 insertions(+), 4 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Verified
  Friendly Automation: Approved for Submit



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index ac01d39..17041fe 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -5479,15 +5479,24 @@
 		rtp->resp = 0;
 		rtp->dtmfsamples = 0;
 		return &ast_null_frame;
+	} else if (type == AST_FRAME_DTMF_BEGIN && rtp->resp == 'X') {
+		ast_debug_rtp(1, "(%p) RTP ignore flash begin from '%s'\n",
+			instance, ast_sockaddr_stringify(&remote_address));
+		rtp->resp = 0;
+		rtp->dtmfsamples = 0;
+		return &ast_null_frame;
 	}
-	ast_debug_rtp(1, "(%p) RTP creating %s DTMF Frame: %d (%c), at %s\n",
-		instance, type == AST_FRAME_DTMF_END ? "END" : "BEGIN",
-		rtp->resp, rtp->resp,
-		ast_sockaddr_stringify(&remote_address));
+
 	if (rtp->resp == 'X') {
+		ast_debug_rtp(1, "(%p) RTP creating flash Frame at %s\n",
+			instance, ast_sockaddr_stringify(&remote_address));
 		rtp->f.frametype = AST_FRAME_CONTROL;
 		rtp->f.subclass.integer = AST_CONTROL_FLASH;
 	} else {
+		ast_debug_rtp(1, "(%p) RTP creating %s DTMF Frame: %d (%c), at %s\n",
+			instance, type == AST_FRAME_DTMF_END ? "END" : "BEGIN",
+			rtp->resp, rtp->resp,
+			ast_sockaddr_stringify(&remote_address));
 		rtp->f.frametype = type;
 		rtp->f.subclass.integer = rtp->resp;
 	}

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

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I1accd9c6e859811336e670e698bd8bd124f33226
Gerrit-Change-Number: 15721
Gerrit-PatchSet: 4
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210331/b68bda8f/attachment.html>


More information about the asterisk-code-review mailing list