[Freeswitch-users] announce count mod conference
David Bolen
db3l.net at gmail.com
Wed Jan 25 01:49:00 MSK 2012
Rodney <notlikeme75 at yahoo.com> writes:
> yes i would love to implement the announce conference count to user
> before entering but cant figure out how to "calculate" that.
I use a small script to control entry into the conference (it also
handles some messaging around moderators), and get a conference count
through the "conference xxx list count" api command, then play it to
the current caller with a custom phrase before adding them.
I ended up announcing which person they are ("you are the nth listener
in the conference"), which obviously also lets them know the current
count. I think I just chose that due to the existing recorded
messages I was reusing sounding better that way.
E.g., something like (in the lua script):
conf_count = tonumber(api:executeString("conference " ..
conf_name_api ..
" list count"));
session:sayPhrase("gp_conf_size", tostring(conf_count+1), "en");
Using the phrase definition:
<macro name="gp_conf_size">
<input pattern="^(\d+)$">
<match>
<action function="play-file" data="ivr/ivr-you_are_the.wav"/>
<action function="say" data="$1" method="counted" type="persons"/>
<action function="play-file" data="conference/conf-listener_in_conference.wav"/>
</match>
</input>
</macro>
There's a race condition if two people are entering simultaneously,
since the count won't increment for the new person until the phrase
finishes playing and they are technically put into conference, but I
don't have any high entry rate conferences and was willing to accept
that.
-- David
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list