Conference Announce Count Inline

From FreeSWITCH Wiki
Jump to: navigation, search

This example is a very quick and dirty dialplan and conference config that lets you hear how many callers are in conference. First, add this group to your caller controls:

    <group name="plain">
      <control action="mute" digits="0"/>
      <control action="energy up" digits="9"/>
      <control action="energy equ" digits="8"/>
      <control action="energy dn" digits="7"/>
      <control action="vol talk up" digits="3"/>
      <control action="vol talk zero" digits="2"/>
      <control action="vol talk dn" digits="1"/>
      <control action="vol listen up" digits="6"/>
      <control action="vol listen zero" digits="5"/>
      <control action="vol listen dn" digits="4"/>
      <control action="execute_application" digits="#" data="execute_extension ANNOUNCE_CONF_COUNT_PRIVATE XML default"/>

Be sure to have your conference profile use the "plain" caller-controls listed above. (Feel free to customize the controls as you see fit or use the bind_digit_action method found in the Conference_Add_Call_Example.)

Next, add this dialplan to conf/dialplan/default/01_Announce_Conf_Count.xml:

  <!-- Sample dialplan for announcing the call count -->
  <extension name="Announce Conf Count (Inline)">
    <condition field="destination_number" expression="^ANNOUNCE_CONF_COUNT_PRIVATE$">
      <action application="set" data="conf_count=${conference ${conference_name} list count}"/>
      <action application="log" data="INFO ${conf_count}"/>
      <action application="say" data="en number pronounced ${conf_count}"/>

Call the conference and press #. The system will "say" how many callers are in the conference.

Note: You may also execute this announce extension prior to sending the caller into the conference in order to give him a count prior to his joining. Just be sure that the caller understands that the count does not include himself because he hasn't yet joined the conference.