]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
solution for MODAPP-94
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 20 May 2008 17:25:17 +0000 (17:25 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 20 May 2008 17:25:17 +0000 (17:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8491 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_esf/mod_esf.c

index 430f7e6ab53b1e5df75f9714924ca0875b47269d..a3b729125763c168f6142f492886a2a49cff89c4 100644 (file)
@@ -76,6 +76,8 @@ SWITCH_STANDARD_APP(bcast_function)
        switch_port_t mcast_port = 34567;
        switch_port_t mcast_control_port = 6061;
        char *mcast_port_str = "34567";
+       const char *esf_broadcast_ip = NULL;
+
 
        if (!switch_strlen_zero((char *) data)) {
                mydata = switch_core_session_strdup(session, data);
@@ -165,13 +167,18 @@ SWITCH_STANDARD_APP(bcast_function)
             }
         }
 
-               switch_find_local_ip(guess_ip, sizeof(guess_ip), AF_INET);
-               if (!(rtp_port = switch_rtp_request_port(guess_ip))) {
+               if (!(esf_broadcast_ip = switch_channel_get_variable(channel, "esf_broadcast_ip"))) {
+                       switch_find_local_ip(guess_ip, sizeof(guess_ip), AF_INET);
+                       esf_broadcast_ip = guess_ip;
+               }
+
+
+               if (!(rtp_port = switch_rtp_request_port(esf_broadcast_ip))) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP Port Error\n");
                        goto fail;
                }
 
-               rtp_session = switch_rtp_new(guess_ip,
+               rtp_session = switch_rtp_new(esf_broadcast_ip,
                                                                         rtp_port,
                                                                         mcast_ip,
                                                                         mcast_port,