[Freeswitch-users] Prevent parking on top of another call
Brian Wiese
brian.wiese.freeswitch at gmail.com
Wed Oct 30 05:49:26 MSK 2013
Spencer:
The following dialplan is what I'm using for valet park. There are
four extensions as follows:
1. park-in, 50100 - FreeSWITCH automatically assigns an available
parking slot number when a call is transferred to this extension.
2. park-in-directed, 501XX - Allows the user to transfer a call to
specific slot number 1XX (101 to 199). If a blind transfer is
attempted to a slot that is already occupied, the call recalls to the
extension performing the park; if an attended transfer, the user is
prompted to enter another slot number.
3. park-recall, ParkRecall10XXX - If the caller is parked for more
than two minutes they are transferred to this extension and sent back
to the extension that parked the call.
4. park-out, 511XX - Retrieve the call parked in slot 1XX.
This dialplan assumes extensions are five digits long and start with
"10". Extension 10900 is the attendant.
I've also posted this to the FreeSWITCH pastebin in case your mail
client eats the XML: http://pastebin.freeswitch.org/21586
===================
<extension name="park-in">
<condition field="destination_number" expression="^50100$">
<action application="set" data="effective_callee_id_name=Call Park"/>
<action application="answer"/>
<action application="sleep" data="1500"/>
<action application="set" data="valet_parking_timeout=120"/>
<action application="set"
data="valet_parking_orbit_exten=ParkRecall${caller_id_number}"/>
<action application="valet_park" data="call_park auto in 101 199"/>
</condition>
</extension>
<extension name="park-in-directed">
<condition field="destination_number" expression="^50(1\d{2})$">
<action application="set" data="park_orbit_in_use=${regex
${valet_info call_park}|<extension
uuid="[\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12}">$1</extension>}"
inline="true"/>
<action application="set" data="park_orbit=$1" inline="true"/>
</condition>
<condition field="destination_number" expression="^50100$" break="never">
<action application="set" data="park_orbit_in_use=true"
inline="true"/> <!-- Orbit 100 is invalid, so make it "always in
use"... (We shouldn't get here anyway due to the park-in extension.)
-->
</condition>
<condition regex="all" break="on-true"> <!-- Make blind transfers to
in-use orbits recall to extension -->
<regex field="${park_orbit_in_use}" expression="^true$"/>
<regex field="${sip_h_Referred-By}" expression="^<sip:(\d{5})@.*$"/>
<action application="set" data="ringback=${us-ring}"/>
<action application="set" data="call_timeout=30"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="bridge"
data="{ignore_display_updates=true}user/$1@$${domain_name}"/>
<action application="transfer" data="10900 XML default"/>
</condition>
<condition regex="all" break="on-true"> <!-- Make attended transfers
to in-use orbits prompt for new orbit -->
<regex field="${park_orbit_in_use}" expression="^true$"/>
<regex field="${sip_h_Referred-By}" expression="^$"/>
<action application="answer"/>
<action application="send_display" data="Orbit ${park_orbit} Busy -
Enter Orbit Number|50${park_orbit}"/>
<action application="playback"
data="tone_stream://%(250,150,480,620);loops=3"/>
<action application="play_and_get_digits" data="3 3 10 0 #
tone_stream://%(60000,0,350,440)
tone_stream://%(250,150,480,620);loops=3 park_orbit ^1(?:0[1-9]|1\d)$
5000"/>
<action application="transfer" data="50${park_orbit}"/>
</condition>
<condition field="${sip_h_Referred-By}"
expression="^<sip:(\d{5})@.*$" break="never"> <!-- Orbit is not in
use... Park the call! -->
<action application="set" data="valet_parking_timeout=120"/>
<action application="set" data="valet_parking_orbit_exten=ParkRecall$1"/>
<action application="set" data="valet_announce_slot=false"/>
<action application="valet_park" data="call_park ${park_orbit}"/>
<anti-action application="set"
data="effective_callee_id_name=Directed Call Park"/>
<anti-action application="answer"/>
<anti-action application="send_display" data="Call Park Orbit
${park_orbit}|50${park_orbit}"/>
<anti-action application="set" data="valet_parking_timeout=120"/>
<anti-action application="set"
data="valet_parking_orbit_exten=ParkRecall${caller_id_number}"/>
<anti-action application="valet_park" data="call_park ${park_orbit}"/>
</condition>
</extension>
<extension name="park-recall">
<condition field="destination_number" expression="^ParkRecall(10\d{3})$">
<action application="set" data="ringback=${us-ring}"/>
<action application="set" data="call_timeout=30"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="bridge"
data="{origination_caller_id_name='Recall-${effective_caller_id_name}'}user/$1@$${domain_name}"/>
<action application="transfer" data="10900 XML default"/>
</condition>
</extension>
<extension name="park-out">
<condition field="destination_number" expression="^51(1\d{2})$">
<action application="set" data="park_orbit_in_use=${regex
${valet_info call_park}|<extension
uuid="[\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12}">$1</extension>}"
inline="true"/>
<action application="set" data="park_orbit=$1" inline="true"/>
</condition>
<condition field="${sip_h_Referred-By}"
expression="^<sip:(\d{5})@.*$" break="never"> <!-- Make sure someone
didn't transfer another call to this orbit! If they did, transfer the
call right back to their extension! -->
<action application="set" data="ringback=${us-ring}"/>
<action application="set" data="call_timeout=30"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="bridge"
data="{ignore_display_updates=true}user/$1@$${domain_name}"/>
<action application="transfer" data="10900 XML default"/>
</condition>
<condition field="${park_orbit_in_use}" expression="^true$" break="never">
<action application="answer"/>
<action application="valet_park" data="call_park ${park_orbit}"/>
<anti-action application="set" data="effective_callee_id_name=Call
Pickup - Orbit Empty"/>
<anti-action application="answer"/>
<anti-action application="playback"
data="tone_stream://%(500,500,480,620);loops=10"/>
</condition>
</extension>
===================
Hope this helps!
~Brian
On Tue, Oct 29, 2013 at 2:47 PM, Spencer Thomason
<spencer at 5ninesolutions.com> wrote:
>
> Hello,
> Does anyone have any suggestions as to prevent a blind transfer from
> parking on top of another call when using valet parking?
>
> Thanks!
> Spencer
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list