]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7500: change variable names to reflect audio vs video %NEEDS_DOC
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 12 May 2015 20:52:53 +0000 (15:52 -0500)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:30 +0000 (12:47 -0500)
remote_media_ip_reported => remote_audio_ip_reported and remote_video_ip_reported
new vars remote_audio_ip and remote_video_ip like remote_media_ip but specific to audio and video
remote_media_port_reported => remote_audio_port_reported and remote_audio_port_reported
remote_media_port => remote_audio_port and remote_video_port
rtp_auto_adjust => rtp_auto_adjust_audio and rtp_auto_adjust_video

src/switch_rtp.c

index b4a2e8a9506325427274ca4bd9629630166c7256..f35b48c70fff2e2d0d1c542d19b8880ee6a4e5f4 100644 (file)
@@ -6318,12 +6318,23 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                                                                          switch_sockaddr_get_port(rtp_session->rtp_from_addr));
 
                                        if (channel) {
-                                               switch_channel_set_variable(channel, "remote_media_ip_reported", switch_channel_get_variable(channel, "remote_media_ip"));
-                                               switch_channel_set_variable(channel, "remote_media_ip", tx_host);
+                                               char varname[80] = "";
+
+                                               switch_snprintf(varname, sizeof(varname), "remote_%s_ip_reported", rtp_type(rtp_session));
+                                               switch_channel_set_variable(channel, varname, switch_channel_get_variable(channel, "remote_media_ip"));
+
+                                               switch_snprintf(varname, sizeof(varname), "remote_%s_ip", rtp_type(rtp_session));
+                                               switch_channel_set_variable(channel, varname, tx_host);
+
+                                               switch_snprintf(varname, sizeof(varname), "remote_%s_port_reported", rtp_type(rtp_session));
                                                switch_snprintf(adj_port, sizeof(adj_port), "%u", switch_sockaddr_get_port(rtp_session->rtp_from_addr));
-                                               switch_channel_set_variable(channel, "remote_media_port_reported", switch_channel_get_variable(channel, "remote_media_port"));
-                                               switch_channel_set_variable(channel, "remote_media_port", adj_port);
-                                               switch_channel_set_variable(channel, "rtp_auto_adjust", "true");
+                                               switch_channel_set_variable(channel, varname, switch_channel_get_variable(channel, "remote_media_port"));
+
+                                               switch_snprintf(varname, sizeof(varname), "remote_%s_port", rtp_type(rtp_session));
+                                               switch_channel_set_variable(channel, varname, adj_port);
+
+                                               switch_snprintf(varname, sizeof(varname), "rtp_auto_adjust_%s", rtp_type(rtp_session));
+                                               switch_channel_set_variable(channel, varname, "true");
                                        }
                                        rtp_session->auto_adj_used = 1;
                                        switch_rtp_set_remote_address(rtp_session, tx_host, switch_sockaddr_get_port(rtp_session->rtp_from_addr), 0, SWITCH_FALSE, &err);
@@ -6340,7 +6351,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                                if ((rtp_session->rtp_bugs & RTP_BUG_ALWAYS_AUTO_ADJUST)) {
                                        switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
                                } else {
-                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "Correct ip/port confirmed.\n");
+                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "Correct %s ip/port confirmed.\n", rtp_type(rtp_session));
                                        switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
                                }
                                rtp_session->auto_adj_used = 0;