One of our clients recently had a question about his system using FreePBX 2.5.1 and Asterisk 1.4 regarding using specific lines to reach staff.

He runs a support queue for his company. During the day he has a regular IVR with Call queues enabled to handle customer calls and direct them to the appropriate staff member to deal with customer inquiries etc. After hours the menu functions the same way, however there are less staff to answer the phones so mainly the emergency extension is the only one being monitored, for – well, emergencies!

Of course, the people monitoring for emergencies don’t want to get a call asking what the company address is at 4 o’clock in the morning. So our client wanted the ability to set his system up so all calls to the emergency queue would be directed out a specific channel on his DID with a specific CallerID.

This enables his staff to set their cell phones to “ignore all calls except for those from this number”. Of course they set “this number” to the one being used by the outbound PRI channel on the PBX.

Setup of is type of scenario is detailed below.

  1. Login to your FreePBX Control Panel.

  2. Go to the Trunks Menu and add a new ZAP trunk. Note this is different if you’re using SIP or IAX. Here, we’re using a T1 PRI.

  3. When you create the new trunk, put in the following configuration variables.

     Outbound Caller ID: "emer" <5555551212>  
     Never Override CallerID: <checked>  
     Maximum Channels: <set to max cellular phones used>  
     Disable Trunk: <unchecked>  
     Dial Rules: .  
     Outbound Dial Prefix: <blank>  
     Zap Identifier: g2
    
  4. Your new trunk is now created in Asterisk.

  5. Click on the Outbound Routes link item on the left of the FreePBX Control Panel.

  6. Add a new Route and put in the following information:

     Route Name: Emergency  
     Route Password: <blank>  
     PIN Set: None  
     Emergency Dialing: <unchecked>  
     Intra Company Route: <unchecked>  
     Music On Hold: Default  
     Dial Patters:
    
     **2133|NXXXXXX  
     2133|NXXXXXXXXX  
     **  
     Trunk Sequence: g2
    

Note the above and the “2133” used. This number can be anything you want, we just chose something we knew wouldn’t be used in the next step of the configuration. This number will get stripped out before getting sent out the trunk so it’s really not a big deal what you pick here. Just use something that won’t be used anywhere.

  1. Click on Submit changes in this menu to add your new route

  2. Click on the Ring Groups Menu on the left side of FreePBX 2.5.1 Interface

  3. Edit, or Create a new Ring Group for the Emergency Group and ensure that it has the following settings along with your own configuration customizations if you have made them (merge these in):

     Ring Strategy: Ringall  
     Ring Time: 50 Seconds (Time appropriately for Cell Voicemail!)  
     Extension List:
    
     **21335555551212#  
     21335555551212#**
    
     Announcement: Change to your own if you want  
     Play MOH: Ring  
     CID Name Prefix: CompanyName  
     Confirm Calls: Checked  
     Remote Announce: Same as "Announcement"
    
     Destination if no answer: Hangup (or whatever you need)
    

Note that the 2133 prefix’s the cellular phone example numbers above. If you changed that earlier make sure to change it here when you’re changing the mobile phone number.

  1. Click on the submit button and you’re done adding your ring group to the configuration for this portion.

  2. Click the “Queues” button on the left side of the FreePBX Management Interface and either modify or create a new queue for your Emergency staff.

  3. When creating the new Queue use similar information to the following:

    Queue Number: A extension for queue  
    CID Name: EMR-  
    Wait Time: No  
    Alert Info: Blank  
    Static Agents:
    
    **1234**,0
    

Note that 1234 in this section is the number of your Ring Group used for the Emergency Dialing feature for Outbound calls.

Set your Agent Timeout to something respectible.

Agent Timeout: **40 seconds**

Keep scrolling down the settings and set the “fail over destination” to your Emergency Queue (to itself).

  1. Now you should ssh to the FreePBX server and create a change in the zaptel/dahdi configuration.

  2. Edit the file like this

    # nano /etc/asterisk/zapata.conf
    
  3. Change it to something like this matching your system. We originally were using all 23 channels for the main line. Now we’ve separated it out into two groups (g1 and g2). G2 is the Trunk you setup earlier.

So, we started with:

group = 1  
context=ext-did  
switchtype=national  
signalling=pri_cpe  
stripmsd=1  
channel=1-23

We ended with:

group = 1  
context=ext-did  
switchtype=national  
signalling=pri_cpe  
stripmsd=1  
channel=1-22

group = 2  
context=ext-did  
switchtype=national  
signalling=pri_cpe  
stripmsd=0  
channel=23
  1. Exit and save the zapata.conf file.

  2. Now you are ready to add this to your IVR menu and start testing.

  3. Go back to FreePBX and go to the IVR menu option on the left of the Administration Panel. Find your IVR menu tree and add a new menu option to it that will dial your Emergency Queue.

  4. You’re done. Give your menu a call, and hit the emergency queue!

If it doesn’t work, try the instructions again. If it still doesn’t work, leave us a comment and we’ll try to give you hand. Have you done something similar with FreePBX and Asterisk? Tell us about it below, we’d love to hear what other cool things people are doing.

We hope you enjoyed this howto!