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

Michael Jerris mike at jerris.com
Wed Sep 23 07:52:38 PDT 2009


Looks like you want to do nearly exactly what uuid_bridge does.  Take  
a look at that code and use or adapt.  Is the other channel in park or  
something is not letting go of it so it can enter the bridge?

Mike

On Sep 23, 2009, at 8:00 AM, Juan Backson <juanbackson at gmail.com> wrote:

> 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
> _______________________________________________
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org



More information about the FreeSWITCH-dev mailing list