From 068ced69c9d11a76eb7ec38a94820212ca511434 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 7 Feb 2007 17:19:06 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4147 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_caller.h | 1 + src/switch_channel.c | 11 +++++++---- src/switch_rtp.c | 33 --------------------------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/src/include/switch_caller.h b/src/include/switch_caller.h index a288f91a36..f99d15ac5d 100644 --- a/src/include/switch_caller.h +++ b/src/include/switch_caller.h @@ -91,6 +91,7 @@ struct switch_caller_profile { struct switch_caller_profile *originator_caller_profile; struct switch_caller_profile *originatee_caller_profile; struct switch_channel_timetable *times; + struct switch_caller_extension *caller_extension; struct switch_caller_profile *next; }; diff --git a/src/switch_channel.c b/src/switch_channel.c index 04688a1853..a560df4d20 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -109,7 +109,6 @@ struct switch_channel { uint32_t flags; uint32_t state_flags; switch_caller_profile_t *caller_profile; - switch_caller_extension_t *caller_extension; const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS]; int state_handler_index; switch_hash_t *variables; @@ -921,17 +920,21 @@ SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *chann assert(channel != NULL); switch_mutex_lock(channel->profile_mutex); - caller_extension->next = channel->caller_extension; - channel->caller_extension = caller_extension; + caller_extension->next = channel->caller_profile->caller_extension; + channel->caller_profile->caller_extension = caller_extension; switch_mutex_unlock(channel->profile_mutex); } SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_caller_extension(switch_channel_t *channel) { + switch_caller_extension_t *extension; assert(channel != NULL); - return channel->caller_extension; + switch_mutex_lock(channel->profile_mutex); + extension = channel->caller_profile->caller_extension; + switch_mutex_unlock(channel->profile_mutex); + return extension; } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 108e848c2b..b571cbc811 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -756,39 +756,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ bytes = sbytes; } - if (bytes > 0 && rtp_session->recv_msg.header.version == 2) { - uint32_t effective_size = (uint32_t)(bytes - rtp_header_len); - uint32_t new_ms = 0, old_size = 0; - - if (effective_size && rtp_session->packet_size && rtp_session->recv_msg.header.pt == rtp_session->payload && - effective_size != rtp_session->packet_size) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Configured packet size %u != inbound packet size %u: auto-correcting..\n", - rtp_session->packet_size, - effective_size - ); - - old_size = rtp_session->packet_size; - new_ms = (((rtp_session->ms_per_packet / 1000) * effective_size) / old_size); - - rtp_session->ms_per_packet = new_ms * 1000; - rtp_session->packet_size = effective_size; - - if (rtp_session->timer.timer_interface) { - switch_core_timer_destroy(&rtp_session->timer); - if (!switch_strlen_zero(rtp_session->timer_name)) { - if (switch_core_timer_init(&rtp_session->timer, - rtp_session->timer_name, - rtp_session->ms_per_packet / 1000, - rtp_session->packet_size, - rtp_session->pool) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Starting timer [%s] %d bytes per %dms\n", - rtp_session->timer_name, rtp_session->packet_size, rtp_session->ms_per_packet / 1000); - } - } - } - } - } - if (rtp_session->timer.interval) { check = (uint8_t)(switch_core_timer_check(&rtp_session->timer) == SWITCH_STATUS_SUCCESS); }