]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5978 [mod_rayo] attempt to fix direct media join
authorChris Rienzo <chris.rienzo@citrix.com>
Wed, 16 Nov 2016 20:11:26 +0000 (15:11 -0500)
committerChris Rienzo <chris.rienzo@citrix.com>
Wed, 16 Nov 2016 20:11:26 +0000 (15:11 -0500)
src/mod/event_handlers/mod_rayo/mod_rayo.c

index c865dd50706072e04904401218d00baafacb5f54..fd72b43378f9d1168d9355e9affd8c448e5c6b22 100644 (file)
@@ -2153,7 +2153,7 @@ static iks *join_call(struct rayo_call *call, switch_core_session_t *session, st
        iks *node = msg->payload;
        iks *response = NULL;
        /* take call out of media path if media = "direct" */
-       const char *bypass = !strcmp("direct", media) ? "true" : "false";
+       int do_direct = !strcmp("direct", media);
 
        /* check if joining to rayo call */
        struct rayo_call *b_call = RAYO_CALL_LOCATE(call_uri);
@@ -2172,8 +2172,10 @@ static iks *join_call(struct rayo_call *call, switch_core_session_t *session, st
                        response = iks_new_error_detailed(node, STANZA_ERROR_CONFLICT, "multiple joined calls not supported");
                } else {
                        /* bridge this call to call-uri */
-                       switch_channel_set_variable(switch_core_session_get_channel(session), "bypass_media", bypass);
-                       if (switch_false(bypass)) {
+                       if (do_direct) {
+                               switch_channel_set_flag(switch_core_session_get_channel(session), CF_BYPASS_MEDIA_AFTER_BRIDGE);
+                       } else {
+                               switch_channel_clear_flag(switch_core_session_get_channel(session), CF_BYPASS_MEDIA_AFTER_BRIDGE);
                                switch_channel_pre_answer(switch_core_session_get_channel(session));
                        }
                        call->pending_join_request = iks_copy(node);