This may be the wrong place to ask this and if it is I’m sorry. I’m completely new to VOIP/SIP/Asterix/FreePBX and all it entails, but I’m hoping someone can help me.
I work with a small UK charity and we need to arrange something where our service users can dial a number and listen to a message during the current pandemic/isolation.
All I need is something that will answer a call, play an MP3 (ideally from another server) and then hang up the call automatically.
A quick Google shows that Asterisk supports the command
MP3Player(http://link.to/stream.m3u) and this would be ideal.
What I need to know is, is it possible to configure this using FreePBX? And how?
My Googling has led me to believe that the way to do it is to pass all incoming calls to a specific virtual extension and then to create a “dial plan” for that extension which answers the call, runs
MP3Player() and then hangs up. However I am none-the-wiser as to how to do this using the FreePBX front end.
Could anyone help?
Do you have an existing FreePBX system and are planning to add this service? If not, I recommend a platform such as Twilio or one of their competitors, which will save you the effort and learning curve of setting up a PBX.
Otherwise, you could use MP3Player by putting in /etc/asterisk/extensions_custom.conf:
exten => s,1,MP3Player(http://link.to/stream.m3u)
exten => s,n,Return()
Then, create a Custom Destination with Target:
Set Return to Yes and Destination to Terminate Call -> Hangup.
Finally, point the Inbound Route for the number in question to the custom destination.
If your message is static or rarely changes, don’t bother with any of this. Just upload it as a System Recording, create an Announcement that plays it, point the Announcement to Terminate Call -> Hangup, and point the Inbound Route to your Announcement.
Stewart1, many thanks for taking the time to reply and so comprehensively.
I looked at Twilio but I can’t see any way of achieving this functionality with their service, and so looked to hosted FreePBX instead. I will take another look in case I missed something.
The message is likely to change at least weekly, maybe more often depending on the developments and government advice and we already host it for internet playback, so pointing to the same source is preferable as we simply update in one place then.
I understand the part to add to
/etc/asterisk/extensions_custom.conf I can do that easily.
This may seem a very stupid question but how do I create the custom destination with that target? Do I add that to a .conf file too? Or is that from the GUI?
Thank you again.
In the GUI, Admin -> Custom Destinations. Hover over the question marks to see how to set this up.
Yep, setup a FreePBX box, setup a phone number to come into it (easy to get a VOIP number).
Point the number to an ANNOUNCEMENT and then HANGUP after its done.
Callers will come in, hear the announcement and when its done playing, it will hangup.
No special programming or anything, mostly pointing and clicking and maybe a little bit of config to stick in the GUI.
@Stewart1 Many thanks for your help. I’m sorry I haven’t replied earlier, I had a short unexpected spell in hospital and am now slowly catching up again.
I followed your instructions and the end points seem to have been created properly. I’m getting some errors about the stream timing out which need investigating but I’m definitely on the right track. Thank you!
There are actually 6 such streams, 5 of which change every week and ultimately will be accessed through an IVR. This is just a functional test. As they change so often and are around an hour each in length I’m not sure recording system announcements will work so well. That said I’m also looking at ControlPlayback() which requires system recordings but gives the user the ability to move around the message. A lot to think about!
I did set up the process at Twilio, but the incoming call cost at USD0.01/minute would be ruinous if too many people got hold of the number.
Well, it turns out one can play mp3 files using ControlPlayback() so all sorted.
Thank you all for your help.
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.