diff --git a/src/channels/chan_voicemngr.c b/src/channels/chan_voicemngr.c index 2c9d6d22c4ff420df7b29de2256dfb43aebc30a9..21f15277cdcd9040aacbb0ca8ec86489e1091675 100644 --- a/src/channels/chan_voicemngr.c +++ b/src/channels/chan_voicemngr.c @@ -77,7 +77,7 @@ static int chan_voicemngr_in_conference(const struct chan_voicemngr_pvt *p); static int cwtimeout_cb(const void *data); static int cwbeep_cb(const void *data); static int r4hanguptimeout_cb(const void *data); -static void chan_voicemngr_generate_rtp_packet(struct chan_voicemngr_subchannel *p, uint8_t *packet_buf, int type, int marker, int dtmf_timestamp, int seqno); +static void chan_voicemngr_generate_rtp_packet(struct chan_voicemngr_subchannel *p, uint8_t *packet_buf, int type, int marker, int dtmf_timestamp, int seqno, int len); static void chan_voicemngr_process_rtcp_packet(struct chan_voicemngr_subchannel *p, uint8_t *rtcp_frame, uint32_t rtcp_size); static int chan_voicemngr_mute_connection(struct chan_voicemngr_subchannel *p); static int chan_voicemngr_unmute_connection(struct chan_voicemngr_subchannel *p); @@ -1658,7 +1658,7 @@ static int chan_voicemngr_write(struct ast_channel *ast, struct ast_frame *frame pvt_lock(sub->parent, "TELCHAN write frame"); /* generate the rtp header */ - chan_voicemngr_generate_rtp_packet(sub, ap->rtp, RTP_PT_CN, 0, 0, frame->seqno); + chan_voicemngr_generate_rtp_packet(sub, ap->rtp, RTP_PT_CN, 0, 0, frame->seqno, frame->len); sip_client_id = chan_voicemngr_get_sip_client_id(sub); if (sip_client_id >= 0 && sip_client_id < MAX_SIP_CLIENTS) { @@ -1694,7 +1694,7 @@ static int chan_voicemngr_write(struct ast_channel *ast, struct ast_frame *frame pvt_lock(sub->parent, "TELCHAN write frame"); /* generate the rtp header */ - chan_voicemngr_generate_rtp_packet(sub, ap->rtp, map_ast_codec_id_to_rtp(frame->subclass.format), 0, 0, frame->seqno); + chan_voicemngr_generate_rtp_packet(sub, ap->rtp, map_ast_codec_id_to_rtp(frame->subclass.format), 0, 0, frame->seqno, frame->len); sip_client_id = chan_voicemngr_get_sip_client_id(sub); if (sip_client_id >= 0 && sip_client_id < MAX_SIP_CLIENTS) { @@ -5407,7 +5407,7 @@ static int chan_voicemngr_close_connection(struct chan_voicemngr_subchannel *sub } /* Generate rtp payload, 12 bytes of header and 160 bytes of ulaw payload */ -static void chan_voicemngr_generate_rtp_packet(struct chan_voicemngr_subchannel *sub, uint8_t *packet_buf, int type, int marker, int dtmf_timestamp, int seqno) +static void chan_voicemngr_generate_rtp_packet(struct chan_voicemngr_subchannel *sub, uint8_t *packet_buf, int type, int marker, int dtmf_timestamp, int seqno, int len) { unsigned short* packet_buf16 = (unsigned short*)packet_buf; unsigned int* packet_buf32 = (unsigned int*)packet_buf; @@ -5421,7 +5421,7 @@ static void chan_voicemngr_generate_rtp_packet(struct chan_voicemngr_subchannel packet_buf[1] |= marker?0x80:0x00; packet_buf16[1] = htons(seqno ? seqno : sub->sequence_number++); //Add sequence number packet_buf32[1] = htonl(sub->time_stamp); //Add timestamp - sub->time_stamp += sub->period*8; + sub->time_stamp += len*8; packet_buf32[2] = sub->ssrc; }