]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 4 May 2006 00:54:58 +0000 (00:54 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 4 May 2006 00:54:58 +0000 (00:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1338 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index 005b10081bd49daec47661e1bc6379894a877453..1ac243727171a97150f7aa8baa769c4d8c4d3b0f 100644 (file)
@@ -577,9 +577,16 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        }
                        if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && rtp_session->from_addr->port && 
                                (rtp_session->from_addr->port != rtp_session->remote_port)) {
+                               const char *err;
+                               char *tx_host;
                                uint32_t old = rtp_session->remote_port;
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Auto Changing port from %u to %u\n", old, rtp_session->from_addr->port);
-                               rtp_session->remote_port = rtp_session->from_addr->port;
+                               char *old_host;
+                               
+                               switch_sockaddr_ip_get(&tx_host, rtp_session->from_addr);
+                               switch_sockaddr_ip_get(&old_host, rtp_session->remote_addr);
+
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Auto Changing port from %s:%u to %s:%u\n", old_host, old, tx_host, rtp_session->from_addr->port);
+                               switch_rtp_set_remote_address(rtp_session, tx_host, rtp_session->from_addr->port, &err);
                        }
                } else {
                        if (rtp_session->recv_msg.header.version == 0 && rtp_session->ice_user) {