git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4147 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-02-07 17:19:06 +00:00
parent 8ae5585824
commit 068ced69c9
3 changed files with 8 additions and 37 deletions

View File

@ -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;
};

View File

@ -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;
}

View File

@ -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);
}