FS-7285 allow eavesdrop to bridge only one leg

Add channel variables eavesdrop_bridge_aleg and eavesdrop_bridge_bleg,
and if one is set to true on the eavesdrop channel, bridge that leg from
the target.  If neither is specified, bridge both.
This commit is contained in:
Dave Olszewski committed 2015-02-14 14:45:15 -08:00
1 parent 69a7b5fd11
commit 2890afc918
3 files changed
+27 -3

No files matched your search

@@ -818,11 +818,21 @@ SWITCH_STANDARD_APP(eavesdrop_function)
switch_channel_t *channel = switch_core_session_get_channel(session);
const char *require_group = switch_channel_get_variable(channel, "eavesdrop_require_group");
const char *enable_dtmf = switch_channel_get_variable(channel, "eavesdrop_enable_dtmf");
const char *bridge_aleg = switch_channel_get_variable(channel, "eavesdrop_bridge_aleg");
const char *bridge_bleg = switch_channel_get_variable(channel, "eavesdrop_bridge_bleg");
if (enable_dtmf) {
flags = switch_true(enable_dtmf) ? ED_DTMF : ED_NONE;
}
/* Defaults to both, if neither is set */
if (switch_true(bridge_aleg)) {
flags |= ED_BRIDGE_READ;
}
if (switch_true(bridge_bleg)) {
flags |= ED_BRIDGE_WRITE;
}
if (!strcasecmp((char *) data, "all")) {
switch_cache_db_handle_t *db = NULL;
char *errmsg = NULL;