[Asterisk-code-review] res rtp asterisk: Avoid merging command and regular T.140 te... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Jul 20 12:37:22 CDT 2018


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/9510 )

Change subject: res_rtp_asterisk: Avoid merging command and regular T.140 text packets
......................................................................


Patch Set 6: Code-Review+1

(1 comment)

https://gerrit.asterisk.org/#/c/9510/6/res/res_rtp_asterisk.c
File res/res_rtp_asterisk.c:

https://gerrit.asterisk.org/#/c/9510/6/res/res_rtp_asterisk.c@6111
PS6, Line 6111: 		if (red->t140.datalen > 0) {
              : 			const unsigned char *primary = red->buf_data;
              : 
              : 			/* There is something already in the T.140 buffer */
              : 			if (primary[0] == 0x08 || primary[0] == 0x0a || primary[0] == 0x0d) {
              : 				/* Flush the previous T.140 packet if it is a command */
              : 				ast_rtp_write(instance, &rtp->red->t140);
              : 			} else {
              : 				primary = frame->data.ptr;
              : 				if (primary[0] == 0x08 || primary[0] == 0x0a || primary[0] == 0x0d) {
              : 					/* Flush the previous T.140 packet if we are buffering a command now */
              : 					ast_rtp_write(instance, &rtp->red->t140);
              : 				}
              : 			}
              : 		}
This is the code I kept pointing out but you kept missing the fact that it was nested within an if block.  There are two data buffers involved.  The frame's buffer data and the t140 accumulation buffer.

I also fixed the typos you had in the commit message.



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifbe993311410fa855cb8aa4a12084db75f413462
Gerrit-Change-Number: 9510
Gerrit-PatchSet: 6
Gerrit-Owner: Emmanuel BUU <emmanuel.buu at ives.fr>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 20 Jul 2018 17:37:22 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180720/c38dcbdf/attachment.html>


More information about the asterisk-code-review mailing list