Dynamic Routing - Change MoH dynamically

Hello,

I would like your input if what I am doing is the correct way of handling it. Concept of my personal project is to create a dynamic way to control MoH via Calendar Module while dialing a Queue
.
Call Flow is:
1 - Dial a Queue Number that leads to Time Condition
2 - Time Condition matched by Calendar (if no match, just go normal call flow, nothing special)
3 - If it matches => Dynamic Route no.1 where I run agi script to grab the Event Category of the Calendar Event, store it in variable named category and proceed to Dynamic Route no.2
4 - Dynamic Route no.2 => Asterisk value ${SET(__VQ_MOH=${DYNROUTE_category})} and proceed with the rest of the call flow that leads to the desired Queue.

So whenever I want to choose another MoH, I would create a Calendar Event with Category name = MoH class I want to play.

My question is, is assigning the value to VQ_MOH the right way to “overwrite” MoH class on-the-fly?

I am really not experienced asterisk user, I just read “reverse way” the dialplan about setting MoH Class in context ext-queues and figured that the only independant value is VQ_MOH.

I can see that VQ_MOH passes the value to QMOH (if VQ_MOH is empty then QMOH get the value set in queue.conf, same as in FreePBX GUI). Then QMOH passes the value to MOHCLASS. Finally, MOHCLASS is used to Set(CHANNEL(musicclass)=${MOHCLASS})

Thanks,
N S