[Freeswitch-users] Managing a conference in JS

Birgit Arkesteijn birgit at westhawk.co.uk
Wed Oct 15 03:03:27 PDT 2008


Hi Mike,

Thanks for your answer.

I take it that apiExecute, translates to session.execute();?

I've tried, but so far I cannot manage to do the below all in the same 
script: The call to session.excute("conference", ...) doesn't return 
until the session hangs up. Therefore I don't know how to bridge, 
transfer or dial the next person into the conference.

I found 'bgapi', but I don't know how to incorporate this into a js script.

Quick snippet of what I've done.
Script "conference1.js":

var cSession = new 
Session("{ignore_early_media=true,call_timeout=5}sofia/gateway/westhawk/0662");
while (cSession.ready()) {
     console_log("info", "put cSession in conf");
     cSession.execute("conference", "522 at default");
     console_log("info", "after put cSession in conf");
}

(end of script)

On the console, I run the script as:
 > jsrun conference1.js.

I only get the second 'console_log' until hangup.

Cheers, Birgit



On 14/10/08 18:38, Michael Jerris wrote:
> On Oct 14, 2008, at 1:13 PM, Birgit Arkesteijn wrote:
> 
>> Hi all,
>>
>> I'm trying to manage a conference call in js. I found an example on  
>> the
>> FS wiki:
>> http://wiki.freeswitch.org/wiki/Examples_confcall_js
>>
>> I know that using
>> session.execute("conference", route + "@default");
>> I can drop a existing (originated) call into a conference.
>>
>> Reading http://wiki.freeswitch.org/wiki/Mod_conference, I see that  
>> it's
>> possible to create a conference and controls things from within the
>> conference.
>> How could I do that in JS?
>>
>> In other words:
>> Is it possible to do in one JS script:
>> - create an empty conference
> 
> Conferences are completely dynamic, there is no need to create them.
> 
>> - dial someone from that conference (and drop them in)
> 
> Use apiExecute, for the first member you should use originate, not  
> conference dial
> 
>> - dial another person from that same conference (and drop them in)
> 
> apiExecute conference dial fsapi command
> 
>> - dial a third person ...
>> - dial a Nth person ...
>>
>> - wait until all (or all but one) hang up and drop the conference
> 
> Conferences are completely dynamic, there is no need to destroy them.


-- 
-- Birgit Arkesteijn, birgit at westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- Company no: 1769350
-- Registered Office:
-- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK.
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>




More information about the FreeSWITCH-users mailing list