Sometimes you want to play an announcement to your users before completing certain outbound calls, such as those to international or long distance numbers that might incur extra costs for your company or department. There is no direct manner for accomplishing this in FreePBX, but this guide will show you a relatively easy work-around to accomplish the same goal.
We assume that you already have an Outbound Route in mind that has the Dial Patterns you wish to match to play the warning message.
First, we will want to create a new Misc Destination that alters the originally dialed number (temporarily). This essentially tags the call for retrieval by the new Outbound Route we will create in a later step. Navigate your FreePBX GUI to Applications > Misc Destinations and click Add Misc Destination. Include the following details:
Pass to Trunk*999${CALLERID(dnid)}
You can use whatever name you want for the Description. You can also use something other than *999 in front of the {CALLERID(dnid)}. Just be sure the digits you choose aren't in use by another Feature Code or Dial Pattern, you maintain the {CALLERID(dnid)} portion, and note that it is CaSe SeNsItIvE. You'll also need to substitute the same alternative in the new Outbound Route you will create in Step 4 below.
Submit this new Misc Destination and move on to the next step. Do NOT Apply Config yet.
Next you will navigate to Admin > System Recordings and create your new announcement to be played to users. We won't go into detail on how to create a new System Recording. You can follow this guide here if you are new to this:
https://sangomakb.atlassian.net/wiki/spaces/PG/pages/20578785/PBX+GUI+-+System+Recordings+Module+User+Guide
Once you have created your new recording, Submit and move on to the next step. Do NOT Apply Config yet.
Now navigate to Applications > Announcements to create a new announcement using the Recording you just created in Step 2. Set the Destination After Playback to the Misc Destination you created in the first step. Ensure all 3 toggles on the page are set to No.
Once you have entered the information, Submit and move on to the next step. Do NOT Apply Config yet.
Navigate to Connectivity > Outbound Routes and create a new outbound route. This will be the route that actually passes the call to your trunk. You'll want to choose your normal Trunks in the Trunk Sequence for Matched Routes on the Route Settings tab. Then switch to the Dial Patterns tab. You'll only want to enter the *999 (or whatever you chose on the Misc Destination Dial field) in the Prefix field and a single dot ( . ) in the Match Pattern field.
Once you have entered the information, Submit and move on to the next step. Do NOT Apply Config yet.
Now edit your ORIGINAL Outbound Route and remove the existing Trunk entries (choose the blank option at the top of the drop-down list) and change the Optional Destination on Congestion to Announcements and select the new announcement you previously created.
Once you have altered the original Outbound Route, you can Submit' and then you must now Apply Config'' for all of your changes to take effect.
Now outbound calls matching the Dial Patterns in the original route will trigger the announcement before passing the call to the trunk normally. This is how it works: