Paging: Ability to grant caller moderator status/controls, auto-generate random pin.

Conference: Add missing caller-controls and moderator-controls parameters in autoload_config.
This commit is contained in:
Nate Jones
2015-04-30 09:45:41 +00:00
parent 1f3c104435
commit b38be32c9c
4 changed files with 25 additions and 10 deletions

View File

@@ -3,8 +3,9 @@
<condition field="destination_number" expression="^\*724$" >
<action application="set" data="caller_id_name=Page" />
<action application="set" data="caller_id_number=" />
<action application="set" data="pin_number=" />
<action application="set" data="pin_number={v_pin_number}" />
<action application="set" data="extension_list=101-103,105" />
<action application="set" data="moderator=false" />
<action application="set" data="set api_hangup_hook=conference page-${destination_number} kick all" />
<action application="lua" data="page.lua" />
</condition>

View File

@@ -2,8 +2,9 @@
<extension name="page-extension" number="*8[ext]" continue="false" app_uuid="1b224444-de8b-448d-b2d1-19feaac3effa">
<condition field="destination_number" expression="^\*8(\d{2,7})$">
<action application="set" data="extension_list=$1"/>
<action application="set" data="pin_number="/>
<action application="set" data="pin_number={v_pin_number}"/>
<action application="set" data="mute=true"/>
<action application="set" data="moderator=false" />
<action application="lua" data="page.lua"/>
</condition>
</extension>

View File

@@ -51,7 +51,7 @@ if ( session:ready() ) then
sounds_dir = session:getVariable("sounds_dir");
destinations = session:getVariable("destinations");
if (destinations == nil) then
destinations = session:getVariable("extension_list");
destinations = session:getVariable("extension_list");
end
destination_table = explode(",",destinations);
caller_id_name = session:getVariable("caller_id_name");
@@ -129,7 +129,7 @@ if ( session:ready() ) then
sub_table = explode("-",value);
for destination=sub_table[1],sub_table[2] do
--get the destination required for number-alias
destination = api:execute("user_data", destination .. "@" .. domain_name .. " attr id");
destination = api:execute("user_data", destination .. "@" .. domain_name .. " attr id");
--prevent calling the user that initiated the page
if (sip_from_user ~= destination) then
@@ -172,7 +172,12 @@ if ( session:ready() ) then
--send main call to the conference room
if (destination_count > 0) then
session:execute("conference", "page-"..destination_number.."@page+flags{endconf}");
if (session:getVariable("moderator") ~= nil and session:getVariable("moderator") == "true") then
moderator_flag = ",moderator";
else
moderator_flag = "";
end
session:execute("conference", "page-"..destination_number.."@page+flags{endconf"..moderator_flag.."}");
else
session:execute("playback", "tone_stream://%(500,500,480,620);loops=3");
end

View File

@@ -1,4 +1,4 @@
<!-- http://wiki.freeswitch.org/wiki/Mod_conference -->
<!-- http://wiki.freeswitch.org/wiki/Mod_conference -->
<!-- None of these paths are real if you want any of these options you need to really set them up -->
<configuration name="conference.conf" description="Audio Conference">
<!-- Advertise certain presence on startup . -->
@@ -6,7 +6,7 @@
<!--<room name="3001@$${domain}" status="FreeSWITCH"/>-->
</advertise>
<!-- These are the default keys that map when you do not specify a caller control group -->
<!-- These are the default keys that map when you do not specify a caller control group -->
<!-- Note: none and default are reserved names for group names. Disabled if dist-dtmf member flag is set. -->
<caller-controls>
<group name="default">
@@ -45,7 +45,7 @@
<profiles>
<!--If no profile is specified it will default to "default"-->
<profile name="default">
<!-- Directory to drop CDR's
<!-- Directory to drop CDR's
'auto' means $PREFIX/logs/conference_cdr/<conference_uuid>.cdr.xml
a non-absolute path means $PREFIX/logs/<value>/<conference_uuid>.cdr.xml
absolute path means <value>/<conference_uuid>.cdr.xml
@@ -70,7 +70,7 @@
<!-- Name of the caller control group to use for this profile -->
<param name="caller-controls" value="default"/>
<!-- Name of the caller control group to use for the moderator in this profile -->
<param name="moderator-controls" value="default"/>
<param name="moderator-controls" value="moderator"/>
<!-- TTS Engine to use -->
<!--<param name="tts-engine" value="cepstral"/>-->
<!-- TTS Voice to use -->
@@ -148,7 +148,7 @@
<param name="energy-level" value="15"/>
<param name="auto-gain-level" value="0"/>
<param name="caller-controls" value="default"/>
<param name="moderator-controls" value="default"/>
<param name="moderator-controls" value="moderator"/>
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
@@ -172,6 +172,8 @@
<param name="interval" value="20"/>
<param name="energy-level" value="15"/>
<param name="auto-gain-level" value="0"/>
<param name="caller-controls" value="default"/>
<param name="moderator-controls" value="moderator"/>
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
@@ -198,6 +200,8 @@
<param name="interval" value="20"/>
<param name="energy-level" value="15"/>
<param name="auto-gain-level" value="0"/>
<param name="caller-controls" value="default"/>
<param name="moderator-controls" value="moderator"/>
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
@@ -224,6 +228,8 @@
<param name="interval" value="10"/>
<param name="energy-level" value="15"/>
<param name="auto-gain-level" value="0"/>
<param name="caller-controls" value="default"/>
<param name="moderator-controls" value="moderator"/>
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
@@ -257,6 +263,8 @@
<param name="rate" value="8000"/>
<param name="interval" value="20"/>
<param name="energy-level" value="300"/>
<param name="caller-controls" value="default"/>
<param name="moderator-controls" value="default"/>
<!--<param name="sound-prefix" value="$${sounds_dir}/en/us/callie"/>-->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>