Use the
FollowMe() application. First you must configure the application in /etc/asterisk/followme.conf:;
; Configure what to do when FollowMe() is requested for Russell. ; We are going to try his desk phone first, and then try to call ; his cell phone. ; [russell] ; ; FollowMe() will use this context in the Asterisk dialplan ; to make outbound calls. ; context = trusted ; ; Call this number first. Give up after 20 seconds. ; number = 7101,20 ; ; Call this number second. Give up after 20 seconds. ; number = 12565551212,20 [leif] context = trusted number = 7102,20 number = 12565559898,20
Now create extensions in the dialplan that will utilize the
FollowMe() application to locate the called party:[public_extensions]
exten => 7001,1,FollowMe(russell)
exten => 7002,1,FollowMe(leif)
[trusted]
exten => 7101,1,Dial(SIP/russell_desk)
exten => 7102,1,Dial(SIP/leif_desk)
exten => _1NXXNXXXXXX,1,Dial(SIP/${NUMBER}@outbound_provider)Admittedly, everything that the
FollowMe() application does for you can be implemented directly in the dialplan. However, it takes more work. If this application does what you want, then save yourself the extra effort and just use FollowMe().When the
FollowMe() application executes, it is going to load the list of phone numbers that were configured in followme.conf and dial them in the order they were specified. When one of the outbound calls is answered, a prompt will be played requesting that the call be acknowledged by pressing a key. One of the main reasons for requiring acknowledgment is that it ensures that if the call is answered by voicemail that FollowMe() continues and tries other numbers.There are some additional options available in the followme.conf file, but they are rarely used. For additional information on the current set of available options, see configs/followme.conf.sample in the Asterisk source. For some additional information about the syntax of
FollowMe() in the dialplan, check the documentation built in to Asterisk:*CLI> core show application FollowMe
Learn more about this topic from Asterisk Cookbook.
Asterisk has a wealth of features to help you customize your PBX to fill very specific business needs. This short cookbook offers recipes for tackling dialplan fundamentals, making and controlling calls, and monitoring channels in your PBX environment. Each recipe includes a simple code solution you can put to work immediately, along with a detailed discussion that offers insight into why and how the recipe works.

Help


