[Freeswitch-users] How to play a file to conference moderator?

Avi Marcus avi at avimarcus.net
Thu Apr 30 09:49:33 UTC 2020


I'm setting up a conference system for a school, and a feature is instead
of simply unmuting, the student raises their hand.

I hacked together something with execute_application javascript that saves
to coredb sqlite, so we can get a timestamp. (modifying to add a flag
wouldn't be good enough, we want to save the order).

Then I want to play a notice only to the moderator that someone has a
question.
I set up something super-hacky, and was wondering if there's a more robust
way. Or a simple code change to add this functionality (I'm not a C coder,
but it wasn't obvious to add "saymember moderator X" without a bunch more
code)

Since I need the moderator's member id to the conference, which isn't set
until after he joins, I did this:

<action application="set" data="api_result=${jsrun
conference/setModerator.js myConference ${uuid}}" />
<action application="conference" data=" myConference at school
++flags{endconf|moderator}"/>

Then setModerator.js does a uuid get var to get his id:

var memberID = apiExecute("uuid_getvar", argv[1] + " conference_member_id");
console_log("DEBUG","Got ID @ "+i+": " + memberID);
memberID = parseInt(memberID,10);
if(memberID && memberID>0){ //NaN is falsy, we're good.
var saveString="insert/conference_"+argv[0]+"/moderator/"+memberID;
console_log("DEBUG","Done, saving: " + memberID + ", string:"+saveString);
apiExecute("hash",saveString);

I put in a wait and repeat, but I guess starting up v8 takes long enough
that the variable is set by then.

This seems very hacky, is there a better way to do this?

Thanks,
-Avi Marcus
1-718-989-9485 (USA)
02-372-1570 (Israel)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20200430/3e2d1b12/attachment.html>


More information about the FreeSWITCH-users mailing list