Background Music

AlwaysONS

New Member
Joined
Mar 7, 2008
Messages
52
Reaction score
0
I was looking for a way to play background music to a telephone. My use was for a nurse to set a telephone in a exam room to play music until the doctor was ready to see the patient. I found this is another forum (#$%$box) and thought maybe someone would find a use for it...

How it works:


The system sets each real caller who joins a meeting as a "MARKED" user, but does not set the music 'call' as marked. This way, when the last user leaves a meeting, it will disconnect the music automatically. This differences is achieved by using a variable in the .call file.


Installation:
Open the /etc/asterisk/extensions_custom.conf file
Past the code below between the ======= symbols
Save the code.
Open FreePBX
Create a ringgroup (i used number 600, whatever number you use, match it to the variable in the dialplan
SetVar(meetroom=600)
In the 'extension list' in the ringgroup put in any invalid extension number
Point the ring group to a custom failover destination
custom-meetme-music,s,1
Create a Queue. I used 5000 in my example, you can use any number you want, just match it to the variable in the dialplan
SetVar(meetmemusicnumber=5000)
Leave the queue defaults. This will allow a system to queue a call forever. For this code, it will just play music forever.
Save your changes, click the "RELOAD" button on the screen and call your ring group number and test.
=======
[custom-meetme-music]
exten => s,1,NoOp(&& MeetMe with Music Dial Plan &&)
exten => s,n,SetVar(meetroom=600)
;set this to be the same number you dial to get to the meeting room.
;this code used a ring group "600" to execute this code
exten => s,n,SetVar(meetmemusicnumber=5000)
;the queue number you assign to play music
exten => s,n,MeetMeCount(${meetroom}|count)
exten => s,n,Gotoif,$[${meetmemusic} = 1]?joinmusic
exten => s,n,Gotoif,$[${count} > 0]?joincaller
exten => s,n,NoOp(&& Creating .call file to bridge music &&)
exten => s,n,system(echo "Channel: Local/${meetmemusicnumber}@from-internal/n" >> /etc/asterisk/${meetmemusicnumber}.call)
exten => s,n,system(echo "MaxRetries: 1" >> /etc/asterisk/${meetmemusicnumber}.call)
exten => s,n,system(echo "WaitTime:5" >> /etc/asterisk/${meetmemusicnumber}.call)
exten => s,n,system(echo "Context: from-internal" >> /etc/asterisk/${meetmemusicnumber}.call)
exten => s,n,system(echo "Extension: ${meetroom}" >> /etc/asterisk/${meetmemusicnumber}.call)
exten => s,n,system(echo "Priority: 1" >> /etc/asterisk/${meetmemusicnumber}.call)
exten => s,n,system(echo "SetVar: meetmemusic=1" >> /etc/asterisk/${meetmemusicnumber}.call)
exten => s,n,system(chown asterisk:asterisk ${meetmemusicnumber}.call)
exten => s,n,Wait(1)
exten => s,n,system(mv /etc/asterisk/${meetmemusicnumber}.call /var/spool/asterisk/outgoing)
exten => s,n,Goto(joincaller)
exten => s,n(joinmusic),SetVar(meetmemusic=0)
exten => s,n,NoOp(&& STARTING THE MUSIC &&)
exten => s,n,MeetMe(${meetroom}|dsx))
exten => s,n(joincaller),MeetMe(${meetroom}|Adsx)
=======================



It is working great and the customer likes the feature... I couldn't find another way to setup background music to a telephone. If there is an easier way please let me know.

Richie
 
Aastra phones have this feature built into the auto discovery scripts that are out.

Still, good to see for non aastra users.
 

Members online

Forum statistics

Threads
26,686
Messages
174,406
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top