Change moh class after queue when putting a call on hold


We have an inbound route that puts the incoming calls into a queue. Into the queue we set a proper moh class in order to announce the answer from an operator.

When the call is answered, and, in case it’s put on hold, we need to play a different moh class.

We are unable to set this because when putting on hold, the moh class is inherited from the setting given on the queue.

Is there any method to override this?

Thanks in advance


anyone can give me an advice on this? Investigating a bit deeply queue moh class is defined into extension_additional.conf with this

exten => 1,n,ExecIf($["${MOHCLASS}"!=""]?Set(CHANNEL(musicclass)=${MOHCLASS}))

and after that we are unable to change it, in order to play a different musicclass when a call is answered (it exit from the queue) and put on hold.

I really searched a lot, and I can’t find any solution. Any help will be very appreciated.


Hi. This is something I am trying to achieve too. Did you ever find a solution?

I have a few systems where this has been achieved. It’s a little messy but it works as intended.

For each queue, set up the main queue as normal and then set up a separate ‘call delivery’ queue. The first queue only has one agent - which is the second queue. The second queue (call delivery) has the actual agents you want taking calls. Agents log in and out of the second queue only.

The first queue can have your initial hold music set, and the second one can have your post-queue music. The second queue needs to have ‘queue no answer’ set to ON, and 'failover destination’s set to CONGESTION. This should mean that callers will only go through the second queue when an agent answers, and therefore they will get the correct hold music applied.

I hope that helps, let me know if you need further info.


WOW, WOW. WOW… Thank you so much, this works perfectly. Fortunately since I only have one set of phones that need to ring for all my queues I can actually have just one secondary queue q350 with the agents and all my primary queues q380, q381, q390, q391 (which are language and time conditions dependent) have q350 set as as the only agent. Everything works as you described with the MoH being updated as the caller is whisked through q350 straight to an agent.

It might be a little messy, but gives a great customer experience to the caller since we can rescue them from a queue without having to wait for announcements to be made.

Glad this worked for you :slight_smile:

Finally i figure it out how to do this but it only works on FreePBX (Freepbx doesn’t matter that much) and Asterisk 13.17.2, i tried the 13.18.0 and up but doesn’t work so this is how i did: Go to Queue select any Music on hold (for example music 1) than click SUBMIT than click APPLY now again go to Queue and change to INHERIT click SUBMIT and CLICK APPLY. now when the customer will call will hear the MUSIC 1 and when you put on hold will hear the DEFAULT music that is located on SETTING - MUSIC ON HOLD - DEFAULT . If anyone knows a better way to do it because i am stuck at asterisk version 13.17.2 because of the Music on Hold.Thanks