dunno maybe this will work
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4735 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c539af4e44
commit
1b5ea9482f
|
@ -105,6 +105,7 @@ struct switch_rtp_rfc2833_data {
|
||||||
unsigned char out_digit_packet[4];
|
unsigned char out_digit_packet[4];
|
||||||
unsigned int out_digit_sofar;
|
unsigned int out_digit_sofar;
|
||||||
unsigned int out_digit_dur;
|
unsigned int out_digit_dur;
|
||||||
|
uint16_t in_digit_seq;
|
||||||
uint16_t out_digit_seq;
|
uint16_t out_digit_seq;
|
||||||
uint32_t out_digit_ssrc;
|
uint32_t out_digit_ssrc;
|
||||||
int32_t timestamp_dtmf;
|
int32_t timestamp_dtmf;
|
||||||
|
@ -910,12 +911,15 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||||
int end = packet[1]&0x80;
|
int end = packet[1]&0x80;
|
||||||
int duration = (packet[2]<<8) + packet[3];
|
int duration = (packet[2]<<8) + packet[3];
|
||||||
char key = switch_rfc2833_to_char(packet[0]);
|
char key = switch_rfc2833_to_char(packet[0]);
|
||||||
|
uint16_t in_digit_seq = ntohs((uint16_t)rtp_session->recv_msg.header.seq);
|
||||||
|
|
||||||
/* SHEESH.... Curse you RFC2833 inventors!!!!*/
|
/* SHEESH.... Curse you RFC2833 inventors!!!!*/
|
||||||
if ((time(NULL) - rtp_session->dtmf_data.last_digit_time) > 2) {
|
if ((time(NULL) - rtp_session->dtmf_data.last_digit_time) > 2) {
|
||||||
rtp_session->dtmf_data.last_digit = 0;
|
rtp_session->dtmf_data.last_digit = 0;
|
||||||
rtp_session->dtmf_data.dc = 0;
|
rtp_session->dtmf_data.dc = 0;
|
||||||
}
|
}
|
||||||
|
if (in_digit_seq > rtp_session->dtmf_data.in_digit_seq) {
|
||||||
|
rtp_session->dtmf_data.in_digit_seq = in_digit_seq;
|
||||||
|
|
||||||
if (duration && end) {
|
if (duration && end) {
|
||||||
if (key != rtp_session->dtmf_data.last_digit) {
|
if (key != rtp_session->dtmf_data.last_digit) {
|
||||||
|
@ -933,8 +937,10 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||||
rtp_session->dtmf_data.last_digit = 0;
|
rtp_session->dtmf_data.last_digit = 0;
|
||||||
rtp_session->dtmf_data.dc = 0;
|
rtp_session->dtmf_data.dc = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue