summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorPaul Cadach <paul@odt.east.telecom.kz>2006-09-24 12:15:49 +0000
committerPaul Cadach <paul@odt.east.telecom.kz>2006-09-24 12:15:49 +0000
commit04cf782862b536868193657a53081bad3c00b6f3 (patch)
tree06c3e33cc559ae9b847ae4347efb4858e8100aa7 /main
parent56fb349222232ed56ac71c94792cf44ff92dda5a (diff)
Small Cisco's RTP DTMF update
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/rtp.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 3ea8d3155..1e79ea405 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -605,8 +605,7 @@ static struct ast_frame *process_cisco_dtmf(struct ast_rtp *rtp, unsigned char *
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 @@ static struct ast_frame *process_cisco_dtmf(struct ast_rtp *rtp, unsigned char *
/* 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 @@ static struct ast_frame *process_cisco_dtmf(struct ast_rtp *rtp, unsigned char *
*/
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) {