]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 7 Feb 2007 17:19:06 +0000 (17:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 7 Feb 2007 17:19:06 +0000 (17:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4147 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_caller.h
src/switch_channel.c
src/switch_rtp.c

index a288f91a36ef160244170a813fc0dbe921289601..f99d15ac5da89a1dedddf6117e6b3d2cf62695a6 100644 (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;
 };
 
index 04688a1853d7839c36f32740745be41b61c7c60d..a560df4d201d781d34199e7235d8b783a4771f86 100644 (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;
 }
 
 
index 108e848c2b57721cf152959551ec20b982c52b24..b571cbc811fe3c4b4f08deed68a622ec9d1200c8 100644 (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);
                }