Intercepting Calls on Asterisk (or CallGroups) as the clever people call it.
Say that your client has a switchboard, and six extensions in the office. Someone calls the office, knows the extension they want to reach and by the magics of Asterisk IVRs they manage to connect themselves directly to Joe. Now, Joe is at the water cooler chatting with a colleague and is thus unable to hear his phone ring. Martha at the switchboard however does hear it ringing, and feels the urge to answer it. How would you set up the Asterisk server to allow this?
Well, it is really quite simple:
What you need to do is assign a callgroup and a pickupgroup as shown below. But first, what is a:
callgroup:
A callgroup is simply a way of grouping extensions that share some common function, ie. all the extension in the "Sales" department
pickupgroup:
The pickupgroup directive, when assigned to an extension, shows which callgroups' calls can be intercepted or picked up by the relevant extension
Practical:
Open up sip.conf (usually it can be found in /etc/asterisk/sip.conf)
Here you will find many sections, called "Contexts"
Find the context matching your Switchboard extension ie. [100]. It might look something like this:
-------
[100]
type=peer
host=dynamic
context=international
disallow=all
allow=g729
qualify=yes
secret=superawesomepassword
nat=yes
canreinvite=no
canredirect=no
----------
To the bottom of this add the pickupgroup directive:
pickupgroup=1
This tells Asterisk that extension 100 can intercept any call ringing on any phone in callgroup 1
Now, no extensions have yet been assigned to callgroup 1 so to remedy that, find the context matching the extension that you want to place in the callgroup and simply add the callgroup directive, like so:
[101]
type=peer
.
.
.
callgroup=1
The switchboard (ext 100) will now be able to pick up a call ringing on extension 101 simply by pressing *2# on their handset (sometimes just *2)
And there you go, Asterisk callgroups in a nutshell. Of course there is much more you can do with callgroups, and we will take a look at that in the future.
Good blog, i love it!
ReplyDeleteThere is just one thing, instead of *2# it is *8# to take up the call in asterisk 13.