[Freeswitch-dev] Need help in bridging two sessions in module

Juan Backson juanbackson at gmail.com
Wed Sep 23 05:00:48 PDT 2009


Hello,

In my scenario, I have other_session that is doing playback of a media file
within an infinitely loop.
What I need to do is to be able stop the "other_session" from doing the
playback, and then bridge the current session to it.

With the following code, I can get the current session and the other_session
to bridge, but I can't get media between the two sessions.

Also, is there anyway to stop the playback? Right now, after the brdiging,
other_session still hears moh.

    switch_core_session_t * other_session =
switch_core_session_locate(bridge_to_uuid);
                switch_channel_t *other_channel =
switch_core_session_get_channel(other_session);

                switch_caller_profile_t *cloned_profile;
                cloned_profile = switch_caller_profile_clone(other_session,
switch_channel_get_caller_profile(channel));
                switch_assert(cloned_profile);
                switch_channel_set_originator_caller_profile(other_channel,
cloned_profile);

                cloned_profile = switch_caller_profile_clone(session,
switch_channel_get_caller_profile(other_channel));
                switch_assert(cloned_profile);
                switch_assert(cloned_profile->next == NULL);
                switch_channel_set_originatee_caller_profile(channel,
cloned_profile);


                switch_core_media_bug_resume(session);
                switch_core_media_bug_resume(other_session);
                switch_ivr_multi_threaded_bridge(session,other_session,
NULL, other_session, session);
                switch_core_media_bug_pause(session);
                switch_core_media_bug_pause(other_session);


thx,
jb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20090923/f979d81b/attachment.html 


More information about the FreeSWITCH-dev mailing list