• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1866
  • Last Modified:

Personalized ringback tones in Asterisk

In Asterisk, when I use the Dial() application to connect a call, I need to play music to the caller instead of the normal ringback tone. I have used the m option to specify the music-on-hold class - e.g. exten=5000,1,Dial(5000,10,m(${ClassName})). This allows me to select one of a pre-defined set of music-on-hold classes.
However, I need more flexibility. I need to be able to specify the music filename on a per-call basis e.g. exten=5000,1,Dial(5000,10,m(${FileName}).
Is there a way to do this?
0
EHeaney
Asked:
EHeaney
  • 2
  • 2
1 Solution
 
grbladesCommented:
The only way to do it would be to create lots of classes with each one configured to play back a specific filename. If you create a class with the same name as the filename to be played back then you can just specify that class name in the dial command.
0
 
EHeaneyAuthor Commented:
Thanks grblades. Unfortunately, I can't use that approach.
What I am trying to do is to allow each Asterisk user to record his/her own set of MOH files. When a caller calls that user, a higher-level application will determine which of these files to play (instead of ring-back tone), on a per-call basis.
If I use the MOH classes, I would need to create an entry in the musiconhold.conf file for every music file in the system. This could number in the thousands (100 users with 10 files each).
Looks like re-design time...
0
 
grbladesCommented:
http://blog.tmcnet.com/blog/tom-keating/asterisk/asterisk-160-beta5.asp
"* In conjunction with the realtime music on hold, a general section has
been added to musiconhold.conf, its sole variable is cachertclasses. If this
is set, then music on hold classes found in realtime will be cached in memory."

http://www.voip-info.org/wiki-Asterisk+RealTime

You should be able to have the musiconhold configuration stored in a database. The dialplan could then choose which file to play and update the music on hold configuration dynamically using a database call and then call the dial command to use that music on hold class.

I have never tried using asterisk realtime but its the only way I can think of doing it given the fact you want the audio to be played while the phone is ringing.
0
 
EHeaneyAuthor Commented:
Thanks for your help.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now