Not Logged in - No Account?
Logging in allows you to post to forums, track new posts, subscribe to threads, pm (private message) other members, and receive periodic news letters. Once logged in this message disappears. No account? Create one by registering here. Lost your password, request a new password. We respect your privacy and collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for details.
Question: How to play "warning" message on certain outbound destinations?

Hi,
I'd like to warn my FreePBX users when they're dialling an expensive international fixed-line, or worse, international mobile. (This is from the UK).
I've put a long list of international codes as a route, with a route password - which is a great start.
However, ideally I'd like to play an explanatory message too - possibly a Misc Destination / Application / Announcement?
I've tried creating a new Route using "SIP/xxx" to a Misc Destination/Application but no joy. Is it possible to play a Misc Destination from a Route? Thoughts appreciated!
It would GREAT if there was a standard option to play a "route announcement" in addition to the "route password" field in FreePBX.
Thanks in advance,
Alex

I think the solution might involve a custom trunk
The idea would be that you'd make the destination of your route a CUSTOM trunk, then send it to a custom dialplan fragment (either a Dialplan Injection using the Dialplan Injection module, or some code in extensions-custom.conf) that would play the recording to the caller, then go to the part of the dialplan that actually connects the call. The only example I could find of anyone doing something remotely similar was in this PBX in a Flash forum post:
http://pbxinaflash.com/forum/showthread.php?t=862
While this isn't exactly what you want to do, it may give you some ideas for how to do it. If you figure it out, please post how you did it - it might be something good to put into a How-To document.
another aproche would be to
another aproche would be to use trunk-preedial-hook and detect the trunk there and play the appropriate announcement based on the trunk
Moshe Brevda, FreePBX Development Team
New to asterisk? Download the Asterisk book FREE!
Custom trunk worked, thanks
Hi,
Thanks for your suggestions .. going into more depth on the custom trunk side certainly helped.
In the end I created a long list of international mobile codes, created a "route" to detect them and pass them through to a new custom trunk. A simple warning message plays saying that the call will cost around £1 a minute, so look for a cheaper alternative! (Next step may be to look autodial a discount international provider).
At the top of extensions_custom.conf I added :
[mobile-warn-custom]
exten => _X.,1,Answer
exten => _X.,2,Wait(1)
exten => _X.,n(begin),Noop(Playing announcement Expensive-Call-Warning)
exten => _X.,n,Playback(custom/International-Mobile-Warning,noanswer)
exten => _X.,2,Wait(1)
exten => _X.,n,Dial(mISDN/g:out/${EXTEN},300)
The trunk's custom dial string is then:
Local/$OUTNUM$@mobile-warn-custom
Then created a route using all these numbers ... (9 for an external line etc). I may put a more readable list onto Wikipedia's international mobile page for future reference.
The route
00124235.
00124245.
00124255.
0012687.
00147341.
0017672.
00201.
002126.
002162.
002169.
0021891.
002207.
002209.
002215.
002216.
002226.
002233.
002234.
002235.
002236.
002239.
002246.
002267.
002289.
002299.
002307.
002308.
002309.
0023223.
0023230.
0023233.
002327.
0023328.
0023480.
0023490.
0023990.
002402.
002424.
002425.
002426.
0024322.
0024378.
0024381.
0024384.
0024385.
0024386.
0024388.
0024389.
0024390.
0024394.
0024395.
0024396.
0024397.
0024398.
0024399.
002456.
002457.
002485.
002487.
002499.
0025008.
0025191.
002538.
002547.
0025574.
002567.
002577.
002588.
002609.
002613.
0026311.
0026323.
0026391.
002658.
002659.
0026658.
002666.
002677.
0026860.
002693.
00277.
00278.
002917.
0030693.
0030694.
0030697.
0030699.
00316.
003247.
003248.
003249.
00336.
00346.
0035058.
003519.
00352621.
00352628.
00352661.
00352668.
00352691.
00352698.
003538.
003546.
003548.
003556.
0035679.
0035699.
0035796.
0035797.
0035799.
003584.
0035850.
0035948.
0035987.
0035988.
0035989.
003620.
003630.
003670.
003706.
003725.
0037365.
0037368.
0037369.
0037376.
0037378.
0037379.
003749.
0037525.
0037529.
0037533.
0037544.
003774.
003776.
0037866.
0038039.
0038050.
0038063.
0038066.
0038067.
0038068.
0038097.
00381377.
003816.
003826.
003859.
0038761.
0038762.
0038763.
0038765.
0038970.
0038971.
0038975.
0038976.
0038977.
0038978.
0039328.
0039329.
0039333.
0039338.
0039339.
0039340.
0039347.
0039348.
0039349.
0039393.
00407.
004174.
004176.
004177.
004178.
004179.
0042060.
0042072.
0042073.
0042077.
004219.
004237.
0043650.
0043660.
0043664.
0043676.
0043680.
0043681.
0043688.
0043699.
004475.
004477.
004478.
004479.
004530.
004540.
00467.
00474.
00479.
004850.
004851.
004860.
004866.
004869.
004872.
004878.
004879.
004888.
004915.
004916.
004917.
0049700.
005016.
005024.
005025.
005037.
005043.
005048.
005049.
005058.
005063.
005074.
005075.
005076.
005077.
00519.
00521.
00535.
005415.
00557.
00558.
00559.
005698.
005699.
005731.
00584.
005917.
005926.
005938.
005939.
005959.
005978.
0059894.
0059896.
0059898.
0059899.
00601.
00614.
00628.
00639.
006420.
006421.
006424.
006425.
006427.
006428.
006429.
00658.
00659.
00661.
00669.
006707.
006738.
00674555.
0067568.
0067569.
006784.
006785.
006799.
0068577.
007300.
007333.
00770.
007777.
0079.
008170.
008180.
008190.
008210.
008211.
008216.
008217.
008218.
008219.
00849.
008523.
008526.
008528.
008529.
008536.
008559.
0085620.
008613.
008615.
0088016.
0088017.
00880181.
0088019.
008869.
00905.
009192.
009193.
009194.
009197.
009198.
009199.
009230.
009231.
009232.
009233.
009234.
009235.
009236.
009375.
00947.
00959.
009607.
009609.
009613.
0096170.
0096171.
009627.
009639.
009656.
009657.
009659.
0096650.
0096654.
0096655.
0096656.
009677.
00968968.
0097059.
0097150.
0097155.
009725.
009733.
009745.
009746.
0097517.
009769.
0097798.
00989.
009929.
009945.
009957.
009959.
009965.
009989.
2250.
2256.
2389.
9|00124235.
9|00124245.
9|00124255.
9|0012687.
9|00147341.
9|0017672.
9|00201.
9|002126.
9|002162.
9|002169.
9|0021891.
9|002207.
9|002209.
9|002215.
9|002216.
9|002226.
9|002233.
9|002234.
9|002235.
9|002236.
9|002239.
9|002246.
9|002267.
9|002289.
9|002299.
9|002307.
9|002308.
9|002309.
9|0023223.
9|0023230.
9|0023233.
9|002327.
9|0023328.
9|0023480.
9|0023490.
9|0023990.
9|002402.
9|002424.
9|002425.
9|002426.
9|0024322.
9|0024378.
9|0024381.
9|0024384.
9|0024385.
9|0024386.
9|0024388.
9|0024389.
9|0024390.
9|0024394.
9|0024395.
9|0024396.
9|0024397.
9|0024398.
9|0024399.
9|002456.
9|002457.
9|002485.
9|002487.
9|002499.
9|0025008.
9|0025191.
9|002538.
9|002547.
9|0025574.
9|002567.
9|002577.
9|002588.
9|002609.
9|002613.
9|0026311.
9|0026323.
9|0026391.
9|002658.
9|002659.
9|0026658.
9|002666.
9|002677.
9|0026860.
9|002693.
9|00277.
9|00278.
9|002917.
9|0030693.
9|0030694.
9|0030697.
9|0030699.
9|00316.
9|003247.
9|003248.
9|003249.
9|00336.
9|00346.
9|0035058.
9|003519.
9|00352621.
9|00352628.
9|00352661.
9|00352668.
9|00352691.
9|00352698.
9|003538.
9|003546.
9|003548.
9|003556.
9|0035679.
9|0035699.
9|0035796.
9|0035797.
9|0035799.
9|003584.
9|0035850.
9|0035948.
9|0035987.
9|0035988.
9|0035989.
9|003620.
9|003630.
9|003670.
9|003706.
9|003725.
9|0037365.
9|0037368.
9|0037369.
9|0037376.
9|0037378.
9|0037379.
9|003749.
9|0037525.
9|0037529.
9|0037533.
9|0037544.
9|003774.
9|003776.
9|0037866.
9|0038039.
9|0038050.
9|0038063.
9|0038066.
9|0038067.
9|0038068.
9|0038097.
9|00381377.
9|003816.
9|003826.
9|003859.
9|0038761.
9|0038762.
9|0038763.
9|0038765.
9|0038970.
9|0038971.
9|0038975.
9|0038976.
9|0038977.
9|0038978.
9|0039328.
9|0039329.
9|0039333.
9|0039338.
9|0039339.
9|0039340.
9|0039347.
9|0039348.
9|0039349.
9|0039393.
9|00407.
9|004174.
9|004176.
9|004177.
9|004178.
9|004179.
9|0042060.
9|0042072.
9|0042073.
9|0042077.
9|004219.
9|004237.
9|0043650.
9|0043660.
9|0043664.
9|0043676.
9|0043680.
9|0043681.
9|0043688.
9|0043699.
9|004475.
9|004477.
9|004478.
9|004479.
9|004530.
9|004540.
9|00467.
9|00474.
9|00479.
9|004850.
9|004851.
9|004860.
9|004866.
9|004869.
9|004872.
9|004878.
9|004879.
9|004888.
9|004915.
9|004916.
9|004917.
9|0049700.
9|005016.
9|005024.
9|005025.
9|005037.
9|005043.
9|005048.
9|005049.
9|005058.
9|005063.
9|005074.
9|005075.
9|005076.
9|005077.
9|00519.
9|00521.
9|00535.
9|005415.
9|00557.
9|00558.
9|00559.
9|005698.
9|005699.
9|005731.
9|00584.
9|005917.
9|005926.
9|005938.
9|005939.
9|005959.
9|005978.
9|0059894.
9|0059896.
9|0059898.
9|0059899.
9|00601.
9|00614.
9|00628.
9|00639.
9|006420.
9|006421.
9|006424.
9|006425.
9|006427.
9|006428.
9|006429.
9|00658.
9|00659.
9|00661.
9|00669.
9|006707.
9|006738.
9|00674555.
9|0067568.
9|0067569.
9|006784.
9|006785.
9|006799.
9|0068577.
9|007300.
9|007333.
9|00770.
9|007777.
9|0079.
9|008170.
9|008180.
9|008190.
9|008210.
9|008211.
9|008216.
9|008217.
9|008218.
9|008219.
9|00849.
9|008523.
9|008526.
9|008528.
9|008529.
9|008536.
9|008559.
9|0085620.
9|008613.
9|008615.
9|0088016.
9|0088017.
9|00880181.
9|0088019.
9|008869.
9|00905.
9|009192.
9|009193.
9|009194.
9|009197.
9|009198.
9|009199.
9|009230.
9|009231.
9|009232.
9|009233.
9|009234.
9|009235.
9|009236.
9|009375.
9|00947.
9|00959.
9|009607.
9|009609.
9|009613.
9|0096170.
9|0096171.
9|009627.
9|009639.
9|009656.
9|009657.
9|009659.
9|0096650.
9|0096654.
9|0096655.
9|0096656.
9|009677.
9|00968968.
9|0097059.
9|0097150.
9|0097155.
9|009725.
9|009733.
9|009745.
9|009746.
9|0097517.
9|009769.
9|0097798.
9|00989.
9|009929.
9|009945.
9|009957.
9|009959.
9|009965.
9|009989.
9|2250.
9|2256.
9|2389.
Created a book page
Alex - I created a book page based on what you wrote above, giving you credit of course. Hope you don't mind. This will hopefully help anyone else who is trying to do something similar (assuming they can find the How-To section in the first place, since there is no link to it on the main page).
Thanks for sharing your solution!
Update
Hi - glad you found my solution of interest :)
A couple of tweaks, I noticed 3 of the international destinations weren't captured correctly.
2250.
2256.
2389.
9|2250.
9|2256.
9|2389.
should be ..
002250.
002256.
002389.
9|002250.
9|002256.
9|002389.
Of course, the '9|xxxx.' variants are only required if you use 9 for an outside line etc.
Got it, thanks
Sorry it took me a couple days to notice your previous post, but I have made the corrections.