I have set up a class with streaming audio. This is not a production system.
I only have one inbound route specification and in it a specify the class that points to the mpg123 app and the URI of the stream. I also have an extension that specifies the URI of another stream.
I then dial the DID which is routed to this particular extension. After answering, I the extension puts the incoming call on hold and I hear the specified class. Then I put the incoming call on hold and all I hear is the default MOH files, not the class specified in the incoming route.
[2019-06-04 23:00:26] VERBOSE[12410][C-00000007] pbx.c: Executing [18054676070@from-internal:4] Set("PJSIP/601-00000009", "MOHCLASS=default") in new stack
[2019-06-04 23:00:26] VERBOSE[12410][C-00000007] pbx.c: Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/601-00000009", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
[2019-06-04 23:01:11] VERBOSE[12440][C-00000007] res_musiconhold.c: Started music on hold, class 'default', on channel 'PJSIP/VoIP.ms-0000000a'
This should not be “default”. The setting in the inbound route is “wagner”
The inbound rule MOH is working. If the caller dials my DID then puts it on hold, the stream plays. If the called extension puts the caller on hold, the default MOH plays. I think what your telling me is that this is the way it’s supposed to work
The original title of this post was incorrect. I changed it. I still don’t understand when the stream specified in FM/FM MOH is played. It says it is going to play the MOH instead of ringing, but it doesn’t.
Right now, if the calling phone puts the call on hold, nothing is being played, not even the default. If the called extension puts the call on hold, the stream plays.
Music on Hold is determined by the channel that is holding the call. So if you set your MoH in an Inbound Route then send the call to the extension, if the extension puts the call on hold Asterisk will look at the mohsuggest setting for the peer/endpoint and use that if there is no MoH specified for that channel or the channel being held doesn’t have a musicclass set on it.
So now you’re making outbound calls. The default MoH is used for outbound calls unless set on the outbound channel (i.e. Outbound Routes) to tell it to use something else. Otherwise when an extension makes an outbound call and puts the call on hold, it will use the default musicclass because that was what was assigned to the outbound channel and the extension isn’t suggesting or setting an alternative.
Try setting the proper Music on Hold for the Outbound Route and see if the issue persists.
I once had two outbound routes. One of them had the MOH set correctly and that was the one I deleted when I decided I no longer needed it. After updating the remaining outbound route, MOH his working correctly now.