[Freeswitch-users] bridging calls using mod_managed

Michael Lutz mytemike72 at gmail.com
Thu Jan 19 10:52:58 MSK 2012


Hi,

Is there someone who can explain me why after executing a bridge
function in mod.managed, the hangup hook is executed immediately, and
my main code execution continues.
And, even stranger, Context.session.bridged() returns false for both legs!

This code snippet is the example, it skips the while loop (check for
bridge) but does detect the answered(), even session.ready() returns
false...

FreeSWITCH.Native.Api fsApi = new FreeSWITCH.Native.Api();
ManagedSession leg_b = new
ManagedSession("{ignore_early_media=true,origination_caller_id_number="
+ orig + ",originate_timeout=20}sofia/external/" + route);
if (leg_b.Ready())
{
    if (leg_b.answered())
    {
        leg_a.answer();
        string apiResult =
fsApi.ExecuteString(string.Format("uuid_bridge {1} {0}",
leg_a.GetUuid(), leg_b.GetUuid()));
        while (leg_a.bridged() && leg_b.bridged())
        {
            leg_a.sleep(500, 0); // Slow the loop down...
        }
    }
}


Thanks,
Michael Lutz



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list