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;
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);
}
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,
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,
}
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);
return -1;
}
+ if (ts) {
+ rtp_session->last_write_ts = ts;
+ }
+
rtp_session->last_write_seq = rtp_session->seq;
return (int) bytes;