From: Anthony Minessale Date: Wed, 10 Aug 2011 12:57:20 +0000 (-0500) Subject: FS-3416 --resolve X-Git-Tag: v1.2-rc1~51^2~278 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97a7668cf2678645e8003651d594c8a74b059802;p=thirdparty%2Ffreeswitch.git FS-3416 --resolve --- diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c index 2c0b927c0f..f0635275f6 100644 --- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c +++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c @@ -61,6 +61,7 @@ static struct { char *psk; switch_mutex_t *mutex; switch_hash_t *peer_hash; + int loopback; } globals; struct peer_status { @@ -88,6 +89,7 @@ static switch_status_t load_config(void) globals.ttl = 1; globals.key_count = 0; + globals.loopback = 0; if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf); @@ -119,6 +121,8 @@ static switch_status_t load_config(void) } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid ttl '%s' specified, using default of 1\n", val); } + } else if (!strcasecmp(var, "loopback")) { + globals.loopback = switch_true(val); } } @@ -408,8 +412,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load) switch_goto_status(SWITCH_STATUS_TERM, fail); } - if (switch_mcast_loopback(globals.udp_socket, 0) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to disable loopback\n"); + if (switch_mcast_loopback(globals.udp_socket, globals.loopback) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to set loopback to '%d'\n", globals.loopback); switch_goto_status(SWITCH_STATUS_TERM, fail); }