diff options
author | pcadach <pcadach@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-24 12:15:49 +0000 |
---|---|---|
committer | pcadach <pcadach@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-24 12:15:49 +0000 |
commit | 84a040451e6bf500beaacbb5d67902c4b47a265b (patch) | |
tree | 06c3e33cc559ae9b847ae4347efb4858e8100aa7 /main | |
parent | 108937da6576fd22f1458ccc64dab7707a170b65 (diff) |
Small Cisco's RTP DTMF update
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43546 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/rtp.c | 17 |
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) { |