In this brief article we will explain how to implement Call Parking on FreeSwitch.
What is Call Parking?
Call parking is a feature in a telephone system that allows a call to be placed on hold and “parked” at a designated extension, where it can be retrieved by any phone within the system. This can be useful when a call needs to be transferred to someone who is not available at the moment, or when a call needs to be transferred to to yourself in a different room.
How FreeSwitch Implements Call Parking
You can use two functions, valet_park() from mod_valet_parking() or park() from mod_dptools to implement call parking.
Park() is very simple and just sends the call to a “limbo” where it can be retrieved using uuid_bridge or uuid_transfer. You have to implement your own logic of parking.
Valet_park() is more robust and implements the whole logic of call parking.
Valet park options:
<lotname> <extension>|[ask [<min>] [<max>] [<to>] [<prompt>]|auto [in|out] [min] [max]]
Parking a Call
<extension name="park-in">
<condition field="destination_number" expression="^(700)$">
<action application="valet_park" data="{domain} auto in 701 799"/>
</condition>
</extension>
Retrieving a Call
<extension name="park-out">
<condition field="destination_number" expression="^(7\d\d)$">
<action application="answer"/>
<action application="valet_park" data="{domain} $1"/>
</condition>
</extension>
Using DTMF to park a call
During the call you can call *7 to park a call. The application bind_meta_app ties a DTMF number to a function.
<action application="bind_meta_app" data="7 a s valet_park::{domain} auto in 701 799"/>
Announcement
The standard announcement is a bit rude. I want to change to “your call is parked at the extension <extension>
To change the phrase macros associated to valet parking you have to edit:
/etc/freeswitch/lang/en/vm/sounds.xml
You can change the the valet announce changing the phrase macro
valet_announce_ext
valet_lot_full
valet_lot_empty
Change valet_anounce_ext to
<macro name="valet_announce_ext">
<input pattern="^([^\:]+):(.*)$">
<match>
<action function="play-file" data="ivr/ivr-extension_number.wav"/>
<action function="say" data="$2" method="pronounced" type="name_spelled"/>
</match>
</input>
</macro>
Reference
You can find more details on valet parking at:
https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Modules/mod_valet_parking_3966447