VoIPowering Your Office with Asterisk: Transferring, Parking, and Hunting
Re-routing calls within an organizationas opposed to simply ringing the extension initially dialedis a vital telephony function. It's easy with Asterisk.
Today's theme is "No Escape," or "How to use Asterisk to hunt you down and find you no matter where you are." We'll cover transferring calls, parking calls, and setting up hunt groups that ring every phone you own until you pick up. We'll also set up a ring group, which is handy for ringing a whole department from a single extension.
It all starts with manually transferring phone calls. This is a basic function that you probably want all of your users to be able to do. When a call goes astray, it's better for them to say "I'll transfer you to the right person" than "Oops, I am too helpless to transfer your call, so you must call back, navigate our convoluted voicemail again, and for gosh sakes get it right this time."
A variation on transferring calls is call parking. Call parking uses hold-and-transfer so you can "park" a call, then pick it up on any other line. This is useful in all sorts of scenarios. Suppose you need to go to another room to get some information for your callerjust park the call, then pick up the closest phone and resume the call. Or you might be troubleshooting something that requires you to move around to different locations while remaining in touch with another person. Call parking makes it easy to carry on an intermittent, movable conversation.
Before you can do that, you have to be able to transfer calls. This is done by adding the lowercase t to users' contexts, like this:
exten => 250,1,Dial(SIP/alrac,10,rt)
Transferring a call is as easy as hitting the pound key on your telephone,
then entering the extension number. Asterisk will say "transfer" after you press
the pound key, then play a dial tone until you dial the extension number.
Asterisk has twenty reserved parking slots, 701720. Transfer the call you want to park to extension #700, and Asterisk will automatically park it in the first empty slot and tell you the number of the parked extension, so resuming the call is as easy as picking up any phone and dialing that extension.
First, add include => parkedcalls to your default context, or any context that you need this feature in.
Next, you should have an unmodified /etc/asterisk/features.conf file that was created at installation. Make sure it contains these lines:
parkext => 700
parkpos => 701-720
context => parkedcalls
parkingtime => 180
Enter restart (you must restart the server; a reload is not enough)
on the Asterisk console, then try it out. You can test this with internal extensions
in your test lab, or call in from an outside line. (Cell phones are great for
testing external configurations.) Answer the phone, then transfer the call by
pressing #700. Asterisk will say the parked extension number. You'll have 180
seconds, or three minutes, to resume the call by dialing the extension. The caller
on hold will be treated to your pleasant hold music.
If it times out, it will ring back at the extension originally called, where it will be treated like any call: You can answer it, or let it go to voicemail.
The lowercase t allows only the person receiving the call to transfer it. This means you can "park" a call only once. If you add an uppercase T, like this:
exten => 250,1,Dial(SIP/alrac,10,rT)
then you can make transfers whether you're on the receiving or the calling end. This means when you un-park a call, you can park and transfer it yet again.
Obviously this is a huge potential security holeyou don't want outside callers to have transfer powers. Be very careful how you use this feature, and limit it to internal users only.
Private Hunt Group
Asterisk can be configured to hunt you down no matter where you are. A hunt group is a list of phone numbers (or "endpoints," to use the proper telephony term) that are rung sequentially until you answer. This example shows two office phones and a cell phone. Your callers only need to know extension 100; Asterisk does the rest. Each phone rings for twenty seconds, then, if there is no answer, Asterisk rings the next one:
exten => 100,1,Dial(SIP/350,20,r)
exten => 100,2,Dial(SIP/351,20,r)
exten => 100,3,Dial(Zap/1/1231234567,20,r)
exten => 100,4,VoiceMail(u350@local-vm-users)
exten => 100,dial+101,VoiceMail(b350@local-vm-users)
A variation on this theme is to ring all numbers at the same time. This
is called a ring group. You can use this to ring all the phones in a particular
department at the same time, or to ring all of your own phoneswhatever you like.
Configure it this way:
exten => 666,1,Dial(SIP/604&SIP/605&SIP/606,40,tr)
exten => 666,2,VoiceMail(s699@local-vm-users)
This example rings extensions 604, 605, and 606 simultaneously when anyone calls extension 666, the Customer Service department. If no one answers the call within 40 seconds it goes to voicemail.
Naturally you probably want call queuing instead of dumping callers into voicemail, so next week we'll look at that.