Search code examples
javascriptfreeswitch

Checking if a session is bridged to another one


I've got a js Freeswitch script where caller has to call another number after a digit.
I've just made a bridge in this way

let callee_number = <called number>;
let paramBLeg = "{ignore_early_media=true,hangup_after_bridge=true,origination_caller_id_number=<caller>,origination_caller_id_name=<caller>}";
let gateway = "<gateway id>";

let BLeg= paramBLeg+"sofia/gateway/"+gateway+"/"+callee_number;

session.execute("bridge", BLeg);

But I can't have a feed if Leg A is bridged with Leg B.
How can I check it?


Solution

  • maybe you need this https://freeswitch.org/confluence/plugins/servlet/mobile?contentId=3965124#content/view/3965124

    if (session:bridged() == true) do
    -- Do something
    end