From 1d07b72c74b08aecd4ab7094978a4aa36dce710b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 18 Jun 2013 16:19:02 -0500 Subject: [PATCH] only refuse loopback endoint not profiles named loopback --- src/switch_ivr_bridge.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index b5ecfacabd..453c6a7339 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -277,7 +277,13 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } if (bypass_media_after_bridge) { - if (switch_stristr("loopback", switch_channel_get_name(chan_a)) || switch_stristr("loopback", switch_channel_get_name(chan_b))) { + const char *source_a = switch_channel_get_variable(chan_a, "source"); + const char *source_b = switch_channel_get_variable(chan_b, "source"); + + if (!source_a) source_a = ""; + if (!source_b) source_b = ""; + + if (switch_stristr("loopback", source_a) || switch_stristr("loopback", source_b)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_WARNING, "Cannot bypass media while bridged to a loopback address.\n"); bypass_media_after_bridge = 0; }