Music on Hold - Press HOLD? (SOLVED)

So I setup my musiconhold.conf to use a shoutcast internet radio. Here’s the musiconhold.conf:


; Shoutcast Streaming
application=/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0

In my extensions.conf I have:


exten => 100,1,Dial(SIP/100,20)
exten => 100,2,VoiceMail(100,u)

exten => 101,1,Dial(SIP/101,20)
exten => 101,2,VoiceMail(101,u)

exten => 199,1,VoiceMailMain(${CALLERID(num)},s)

exten => 102,1,Answer
exten => 102,2,Playback(pls-hold-while-try)
exten => 102,3,SetMusiconHold(default)
exten => 102,4,WaitmusiconHold(60)
exten => 102,4,Hangup[/code]

It works when I call 102, it will play the music perfectly. What I want, is when I’m on the phone with someone, and I press “Hold”, instead of being silence, to play the shoutcast MOH. What do I need to do?

If I understand the question properly, the answer is modify the firmware in the phone as the phone will have sent Asterisk SDP saying


which means that it is not listening to any audio that Asterisk might send to it.

Music on hold is only ever sent to the remote party from that initiating the hold.

(You might be able to configure the phone to make an enquiry call to the music stream.)

There’s nothing in the Asterisk configs I could change? I thought “music on hold” was for when…you were on hold? :open_mouth:

What about a hackish way, like if someone is put on hold, they get transferred to the MOH extension?

The person who is on hold is the person who has been put on hold, i.e. the passive party. The person putting them on on hold is not on hold.

Um…I know. I am saying, if it’s called Music on Hold, then it should play music for the person, when I put them on hold.

What would the point be of MOH if it doesn’t play? I have my default class setup, but it’s not playing on hold. There is no configuration for any kind of MOH in any of my sip clients (Ekiga, Linphone, Sipdroid).

It plays to the remote party. You appeared to be expecting it to play to the person who pressed the hold key.

No, I’m not, as stated several times. Are we done with that question? I haven’t received any useful info from you yet. If I press hold, the person I’m talking with should hear the music on hold I setup in musiconhold.conf. I don’t see how this is hard to understand.

Anyone else?

In that case, what is your phone sending to Asterisk? What evidence do you have that Asterisk is actually being told to go on hold? You need to provide a console trace showing evidence of an attempt to go on hold, or failing that, a SIP trace showing a re-invite that would put the party on hold.

A CLI trace showing successful MOH from a simple file source would be a useful control.

Whilst I personally wouldn’t want to stream MP3 as MOH, a lot of people do do it successfully.

At a wild guess, you may have a phone that is broken in a way that requires ignoresdpversion to be turned on.

Thanks for the info. I was able to partially get it working, here’s my extensions.conf for my extension now:

exten => 100,1,Dial(SIP/100,20,m) exten => 100,2,VoiceMail(100,u)

I added “,m” to the Dial, now when ringing I hear the streaming music and when on hold the other person hears the music. This will do the job, but is there another parameter, other than Dial, I might be able to use just for the Hold part?

You need to provide enough information to work out why it isn’t working. That’s why Asterisk provides copious logging.

However, I would guess that you have part of your configuration that is overriding the MOH source and the m parameter is giving a higher precedence specification for the source. If that is the case, there may be a bug, as I wouldn’t expect m to set the music class for both directions.

This theory still doesn’t work well, as default should be used if you specify an invalid class.

After much googling, the solution ended up being really simple.

Put this in sip.conf. It was needed to tell the system what class to use for basic Music on Hold. I also removed the “,m” in my extensions, and now dialing is normal tones, and if I put them on hold they hear streaming live internet radio. Awesome.