Play mp3 files after a number is called

Hey guys. Using FreePBX 17.0.19.13

I want to make a number that automaticly answers and plays mp3 files of my choosing. I want this to be something like a song streaming station or smh. I have it kinda working when I call 70# and it plays the music on hold but it has many problems- I cant skip any of the sounds (it just goes one by one) and after some time it automaticly transfers me to line2.

I saw many blogs with similar problems but usually people use the command line but I am not sure about using it as I think I will just crash my server.

I wonder does something like I just described exists without using the command line???

As I see not many people know how to resolve this issue,

so i descided to go in the route of using chat.gpt. Together we came up with this system:
I add the songs to the system recordings and name them smh like Song1- :infinity:

then I make announcements wth descripition the same name of the song and then i choose the recording as the song and destination is set to hangup.

Afterwards I go to configuration file editor and to extensions_custom.conf and add this code:

[from-custom-mp3-playback]
exten => s,1,Answer()
exten => s,n(start),Background(custom/Song1) ; Plays first song
exten => s,n,WaitExten(10) ; Wait for DTMF input for 10 seconds
exten => s,n,Background(custom/Song2) ; Plays second song
exten => s,n,WaitExten(10) ; Wait for DTMF input for 10 seconds
exten => s,n,Background(custom/Song3) ; Plays third song
exten => s,n,Hangup()

; DTMF input handling for skipping tracks
exten => 1,1,Goto(s,start+1) ; Press 1 to skip to the next song

For this to be called by my VoIP phones i create a custom extension for example 6001 and set the dial to: local/s@from-custom-mp3-playback

This works in the sense of playing each song one by one with a 10sec pause in between. The issue i’m having now is that I can’t skip songs via pressing number one on my phone instead of going to the nother song it just disconnects me.

The next option I tried using was IVRs like this: IVR name is set to something like MusicPlayer_1 and the announcment is set to Song1
the timeout destination is set to a nother IVR wich is set the same way but the difference is that its Song2 an MusicPlayer2… Than i configure a IVR entry like this: digits 1, destination IVR MusicPlayer_2 .

To connect that to the phone I add a custom extension for exmp. 6000 and set the dial to: local/MusicPlayer_1@from-internal
I thought that this sounds more promising but instead of connecting me to the IVR the phone starts beeping as if the extension was offline or smh…

1 Like

hello, did you get it to work?

I have made it so that it plays songs without me able to skip it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.