提交 8345331f authored 作者: Michael Jerris's avatar Michael Jerris

fix 160 timestamps on 2833 dtmf

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7168 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 7cc7ce29
......@@ -105,7 +105,7 @@ struct switch_rtp_rfc2833_data {
unsigned int out_digit_sofar;
unsigned int out_digit_dur;
uint16_t in_digit_seq;
int32_t timestamp_dtmf;
uint32_t timestamp_dtmf;
char last_digit;
unsigned int dc;
time_t last_digit_time;
......@@ -818,7 +818,7 @@ static void do_2833(switch_rtp_t *rtp_session)
rtp_session->te,
rtp_session->dtmf_data.timestamp_dtmf,
&flags);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%d dur=%d seq=%d\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%u dur=%d seq=%d\n",
loops == 1 ? "middle" : "end", rtp_session->dtmf_data.out_digit, rtp_session->dtmf_data.timestamp_dtmf,
rtp_session->dtmf_data.out_digit_sofar, rtp_session->seq);
}
......@@ -845,7 +845,6 @@ static void do_2833(switch_rtp_t *rtp_session)
rtp_session->dtmf_data.timestamp_dtmf = rtp_session->last_write_ts + samples;
switch_rtp_write_manual(rtp_session,
rtp_session->dtmf_data.out_digit_packet,
4,
......@@ -856,7 +855,7 @@ static void do_2833(switch_rtp_t *rtp_session)
switch_log_printf(SWITCH_CHANNEL_LOG,
SWITCH_LOG_DEBUG,
"Send start packet for [%c] ts=%d dur=%d seq=%d\n",
"Send start packet for [%c] ts=%u dur=%d seq=%d\n",
rtp_session->dtmf_data.out_digit,
rtp_session->dtmf_data.timestamp_dtmf,
rtp_session->dtmf_data.out_digit_sofar,
......@@ -1447,8 +1446,11 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
}
if (send) {
uint32_t last_ts = ntohl(send_msg->header.ts);
rtp_session->last_write_ts = ntohl(send_msg->header.ts);
if (last_ts) {
rtp_session->last_write_ts = last_ts;
}
rtp_session->last_write_seq = rtp_session->seq;
if (rtp_session->timer.interval) {
switch_core_timer_check(&rtp_session->timer);
......@@ -1662,6 +1664,10 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
return -1;
}
if (ts) {
rtp_session->last_write_ts = ts;
}
rtp_session->last_write_seq = rtp_session->seq;
return (int) bytes;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论