[asterisk-commits] pcadach: trunk r43546 - /trunk/main/rtp.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sun Sep 24 05:15:51 MST 2006
Author: pcadach
Date: Sun Sep 24 07:15:49 2006
New Revision: 43546
URL: http://svn.digium.com/view/asterisk?rev=43546&view=rev
Log:
Small Cisco's RTP DTMF update
Modified:
trunk/main/rtp.c
Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?rev=43546&r1=43545&r2=43546&view=diff
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Sun Sep 24 07:15:49 2006
@@ -605,8 +605,7 @@
char resp = 0;
struct ast_frame *f = NULL;
unsigned char seq;
- unsigned int datalen;
- unsigned int flag;
+ unsigned int flags;
unsigned int power;
/* We should have at least 4 bytes in RTP data */
@@ -616,14 +615,9 @@
/* The format of Cisco RTP DTMF packet looks like next:
+0 - sequence number of DTMF RTP packet (begins from 1,
wrapped to 0)
- +1 (bits 7-0) - count of bytes carrying DTMF information (if DTMF
- information repeates 3 times, i.e. packet have 6
- bytes of DTMF information, this value equal to 6).
- Last bit should always be zero (because DTMF info
- is multiple of 2 bytes) but really uses as described
- below.
+ +1 - set of flags
+1 (bit 0) - flaps by different DTMF digits delimited by audio
- or repeated digit without audio
+ or repeated digit without audio???
+2 (+4,+6,...) - power level? (rises from 0 to 32 at begin of tone
then falls to 0 at its end)
+3 (+5,+7,...) - detected DTMF digit (0..9,*,#,A-D,...)
@@ -649,13 +643,12 @@
*/
seq = data[0];
- datalen = data[1] & ~1;
- flag = data[1] & 1;
+ flags = data[1];
power = data[2];
event = data[3] & 0x1f;
if (option_debug > 2 || rtpdebug)
- ast_log(LOG_DEBUG, "Cisco DTMF Digit: %02x (len=%d, seq=%d, repeat=%d, power=%d, history count=%d)\n", event, len, seq, flag, power, datalen / 2 - 1);
+ ast_log(LOG_DEBUG, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02x, power=%d, history count=%d)\n", event, len, seq, flags, power, (len - 4) / 2);
if (event < 10) {
resp = '0' + event;
} else if (event < 11) {
More information about the asterisk-commits
mailing list