- dejitter can be completely disabled by specifying 0ms
This commit is contained in:
parent
4c699c5ab7
commit
91fa3538dd
@ -1,5 +1,6 @@
|
|||||||
0.7.1
|
0.7.1
|
||||||
=====
|
=====
|
||||||
|
22-Mar-2008: - dejitter can be completely disabled by specifying 0ms
|
||||||
09-Mar-2008: - libosip2-3.1.0 (changes MD5 related function names)
|
09-Mar-2008: - libosip2-3.1.0 (changes MD5 related function names)
|
||||||
04-Feb-2008: - 'Default Target' plugin: incoming calls to unknown
|
04-Feb-2008: - 'Default Target' plugin: incoming calls to unknown
|
||||||
are redirected to a "catch-all" target.
|
are redirected to a "catch-all" target.
|
||||||
|
|||||||
@ -148,9 +148,10 @@ rtp_dscp = 46
|
|||||||
# Dejitter value
|
# Dejitter value
|
||||||
# Artificial delay to be used to de-jitter RTP data streams.
|
# Artificial delay to be used to de-jitter RTP data streams.
|
||||||
# This time is in microseconds.
|
# This time is in microseconds.
|
||||||
|
# 0 - completely disable dejitter (default)
|
||||||
#
|
#
|
||||||
rtp_input_dejitter = 25000
|
rtp_input_dejitter = 0
|
||||||
rtp_output_dejitter = 25000
|
rtp_output_dejitter = 0
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Default Expiration timeout for Registrations
|
# Default Expiration timeout for Registrations
|
||||||
|
|||||||
@ -191,11 +191,17 @@ static void *rtpproxy_main(void *arg) {
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
||||||
#ifdef USE_DEJITTER
|
#ifdef USE_DEJITTER
|
||||||
/* calculate time until next packet to send from dejitter buffer */
|
if ((configuration.rtp_input_dejitter > 0) ||
|
||||||
if (!dejitter_delay_of_next_tx(&sleep_tv, ¤t_tv)) {
|
(configuration.rtp_output_dejitter > 0)) {
|
||||||
|
/* calculate time until next packet to send from dejitter buffer */
|
||||||
|
if (!dejitter_delay_of_next_tx(&sleep_tv, ¤t_tv)) {
|
||||||
|
sleep_tv.tv_sec = 5;
|
||||||
|
sleep_tv.tv_usec = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
sleep_tv.tv_sec = 5;
|
sleep_tv.tv_sec = 5;
|
||||||
sleep_tv.tv_usec = 0;
|
sleep_tv.tv_usec = 0;
|
||||||
};
|
}
|
||||||
#else
|
#else
|
||||||
sleep_tv.tv_sec = 5;
|
sleep_tv.tv_sec = 5;
|
||||||
sleep_tv.tv_usec = 0;
|
sleep_tv.tv_usec = 0;
|
||||||
@ -206,7 +212,10 @@ static void *rtpproxy_main(void *arg) {
|
|||||||
|
|
||||||
#ifdef USE_DEJITTER
|
#ifdef USE_DEJITTER
|
||||||
/* Send delayed Packets that are timed to be send */
|
/* Send delayed Packets that are timed to be send */
|
||||||
dejitter_flush(¤t_tv, LOCK_FDSET);
|
if ((configuration.rtp_input_dejitter > 0) ||
|
||||||
|
(configuration.rtp_output_dejitter > 0)) {
|
||||||
|
dejitter_flush(¤t_tv, LOCK_FDSET);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* exit point for this thread in case of program terminaction */
|
/* exit point for this thread in case of program terminaction */
|
||||||
@ -326,12 +335,46 @@ static void *rtpproxy_main(void *arg) {
|
|||||||
dst_addr.sin_port= htons(rtp_proxytable[i].remote_port);
|
dst_addr.sin_port= htons(rtp_proxytable[i].remote_port);
|
||||||
|
|
||||||
#ifdef USE_DEJITTER
|
#ifdef USE_DEJITTER
|
||||||
dejitter_calc_tx_time(&rtp_buff, &(rtp_proxytable[i].tc),
|
if ((configuration.rtp_input_dejitter > 0) ||
|
||||||
¤t_tv, &ttv);
|
(configuration.rtp_output_dejitter > 0)) {
|
||||||
dejitter_delayedsendto(rtp_proxytable[i].rtp_tx_sock,
|
dejitter_calc_tx_time(&rtp_buff, &(rtp_proxytable[i].tc),
|
||||||
rtp_buff, count, 0, &dst_addr,
|
¤t_tv, &ttv);
|
||||||
&ttv, ¤t_tv,
|
dejitter_delayedsendto(rtp_proxytable[i].rtp_tx_sock,
|
||||||
&rtp_proxytable[i], NOLOCK_FDSET);
|
rtp_buff, count, 0, &dst_addr,
|
||||||
|
&ttv, ¤t_tv,
|
||||||
|
&rtp_proxytable[i], NOLOCK_FDSET);
|
||||||
|
} else {
|
||||||
|
/*&&& duplicated code - needs cleanup! */
|
||||||
|
sts = sendto(rtp_proxytable[i].rtp_tx_sock, rtp_buff,
|
||||||
|
count, 0, (const struct sockaddr *)&dst_addr,
|
||||||
|
(socklen_t)sizeof(dst_addr));
|
||||||
|
if (sts == -1) {
|
||||||
|
if (errno != ECONNREFUSED) {
|
||||||
|
osip_call_id_t callid;
|
||||||
|
|
||||||
|
ERROR("sendto() [%s:%i size=%i] call failed: %s",
|
||||||
|
utils_inet_ntoa(rtp_proxytable[i].remote_ipaddr),
|
||||||
|
rtp_proxytable[i].remote_port, count, strerror(errno));
|
||||||
|
|
||||||
|
/* if sendto() fails with bad filedescriptor,
|
||||||
|
* this means that the opposite stream has been
|
||||||
|
* canceled or timed out.
|
||||||
|
* we should then cancel this stream as well.*/
|
||||||
|
|
||||||
|
WARN("stopping opposite stream");
|
||||||
|
callid.number=rtp_proxytable[i].callid_number;
|
||||||
|
callid.host=rtp_proxytable[i].callid_host;
|
||||||
|
/* don't lock the mutex, as we own the lock already */
|
||||||
|
sts = rtp_relay_stop_fwd(&callid,
|
||||||
|
rtp_proxytable[i].direction,
|
||||||
|
-1, NOLOCK_FDSET);
|
||||||
|
if (sts != STS_SUCCESS) {
|
||||||
|
/* force the streams to timeout on next occasion */
|
||||||
|
rtp_proxytable[i].timestamp=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
sts = sendto(rtp_proxytable[i].rtp_tx_sock, rtp_buff,
|
sts = sendto(rtp_proxytable[i].rtp_tx_sock, rtp_buff,
|
||||||
count, 0, (const struct sockaddr *)&dst_addr,
|
count, 0, (const struct sockaddr *)&dst_addr,
|
||||||
@ -391,7 +434,10 @@ static void *rtpproxy_main(void *arg) {
|
|||||||
callid.number=rtp_proxytable[i].callid_number;
|
callid.number=rtp_proxytable[i].callid_number;
|
||||||
callid.host=rtp_proxytable[i].callid_host;
|
callid.host=rtp_proxytable[i].callid_host;
|
||||||
#ifdef USE_DEJITTER
|
#ifdef USE_DEJITTER
|
||||||
dejitter_cancel(&rtp_proxytable[i]);
|
if ((configuration.rtp_input_dejitter > 0) ||
|
||||||
|
(configuration.rtp_output_dejitter > 0)) {
|
||||||
|
dejitter_cancel(&rtp_proxytable[i]);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
INFO("RTP stream %s@%s (media=%i) has expired",
|
INFO("RTP stream %s@%s (media=%i) has expired",
|
||||||
callid.number, callid.host,
|
callid.number, callid.host,
|
||||||
@ -530,7 +576,10 @@ int rtp_relay_start_fwd (osip_call_id_t *callid, client_id_t client_id,
|
|||||||
|
|
||||||
#ifdef USE_DEJITTER
|
#ifdef USE_DEJITTER
|
||||||
/* Initialize up timecrontrol for dejitter function */
|
/* Initialize up timecrontrol for dejitter function */
|
||||||
dejitter_init_time(&rtp_proxytable[i].tc, dejitter);
|
if ((configuration.rtp_input_dejitter > 0) ||
|
||||||
|
(configuration.rtp_output_dejitter > 0)) {
|
||||||
|
dejitter_init_time(&rtp_proxytable[i].tc, dejitter);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -693,7 +742,10 @@ int rtp_relay_start_fwd (osip_call_id_t *callid, client_id_t client_id,
|
|||||||
|
|
||||||
#ifdef USE_DEJITTER
|
#ifdef USE_DEJITTER
|
||||||
/* Initialize up timecrontrol for dejitter function */
|
/* Initialize up timecrontrol for dejitter function */
|
||||||
dejitter_init_time(&rtp_proxytable[freeidx].tc, dejitter);
|
if ((configuration.rtp_input_dejitter > 0) ||
|
||||||
|
(configuration.rtp_output_dejitter > 0)) {
|
||||||
|
dejitter_init_time(&rtp_proxytable[freeidx].tc, dejitter);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*local_port=port;
|
*local_port=port;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user