Update valet_park_auto

- Use lua valet_park
This commit is contained in:
FusionPBX 2024-04-12 12:00:52 -06:00 committed by GitHub
parent d8a8d4997e
commit 92969d904c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 15 deletions

View File

@ -1,7 +1,12 @@
<extension name="valet_park_auto" number="park+5900" context="${domain_name}" continue="false" app_uuid="c192ee50-084d-40d8-8d9a-6959369382c8" enabled="false" order="470">
<condition field="destination_number" expression="^(?:(?:park\+\*?)|(?:\*))(5900)$"/>
<condition field="${sip_h_Referred-By}" expression="sip:(.*)@.*" break="never">
<action application="valet_park" data="5900@${domain_name} auto in 5901 5999"/>
<anti-action application="valet_park" data="5900@${domain_name} auto out 5901 5999"/>
<extension name="valet_park_auto" number="park+*5900" context="${domain_name}" continue="false" app_uuid="c192ee50-084d-40d8-8d9a-6959369382c8" enabled="true" order="470">
<condition field="destination_number" expression="^(park\+)?\*(5900)$">
<action application="answer" data="" enabled="true"/>
<action application="set" data="valet_announce_slot=enable" enabled="false"/>
<action application="set" data="valet_hold_music=${hold_music}" enabled="true"/>
<action application="set" data="valet_parking_orbit_exten=${referred_by_user}" enabled="true"/>
<action application="set" data="valet_parking_timeout=900" enabled="true"/>
<action application="set" data="valet_parking_direction=in"/>
<action application="set" data="valet_parking_display=enable"/>
<action application="lua" data="app.lua valet_park" enabled="true"/>
</condition>
</extension>

View File

@ -37,17 +37,18 @@ if ( session:ready() ) then
domain_uuid = session:getVariable("domain_uuid") or '';
uuid = session:getVariable("uuid") or '';
context = session:getVariable("context") or '';
valet_parking_auto = session:getVariable("valet_parking_auto") or '';
caller_id_number = session:getVariable("caller_id_number") or '';
valet_parking_direction = session:getVariable("valet_parking_direction") or '';
valet_parking_display = session:getVariable("valet_parking_display") or '';
valet_announce_slot = session:getVariable("valet_announce_slot") or '';
end
--auto park when valet_parking_auto value to in
if (valet_parking_auto == 'in') then
--auto park when direction set to in
if (valet_parking_direction == 'in') then
--get the the valet park current details
if (session:ready()) then
command = "valet_info park@"..domain_name;
command = "valet_info park@"..context;
valet_info_result = api:executeString(command);
end
@ -62,7 +63,7 @@ if (valet_parking_auto == 'in') then
end
--log the destinations
freeswitch.consoleLog("NOTICE", "[valet park] destination_number *"..destination_number.."\n");
freeswitch.consoleLog("NOTICE", "[valet park] "..caller_id_number.."@"..context.." destination_number *"..destination_number.."\n");
--update the phone display - requires attended transfer
if (valet_parking_display == 'enable') then
@ -74,15 +75,13 @@ if (valet_parking_auto == 'in') then
end
--announce the park extension
if (valet_announce_slot ~= 'disable') then
session:execute("say", "en name_spelled iterated *"..destination_number);
if (valet_announce_slot == 'enable') then
session:execute("say", "en name_spelled iterated *"..destination_number);
end
--transfer the call to the available parking lot
if (session:ready()) then
--uuid_transfer,<uuid> [-bleg|-both] <dest-exten> [<dialplan>] [<context>],Transfer a session,mod_commands
command = 'uuid_transfer '..uuid..' -bleg *'..destination_number..' XML '..context;
response = api:executeString(command);
session:execute("valet_park", "park@"..context.." *"..destination_number);
end
end