Default music on hold not being respected.

This is how the section is currently set in v3.2.4-5

exten => moh,1,NoOp(Set Music on Hold)
 same => n,GotoIf($[${DB_EXISTS(${TENANT}/queues/${QUEUE_NUMBER}/moh)}]?:return)
 same => n,ExecIf($["${DB(${TENANT}/queues/${QUEUE_NUMBER}/moh)}"!=""]?Set(CHANNEL(musicclass)=${DB(${TENANT}/queues/${QUEUE_NUMBER}/moh)}):))
 same => n(return),Return()

Previous versions of the v3 line and currently the v4 has it like this:

exten => moh,1,NoOp(Set Music on Hold)
 same => n,GotoIf($[${DB_EXISTS(${TENANT}/queues/${QUEUE_NUMBER}/moh)}]?:try_extension)
 same => n,ExecIf($["${DB(${TENANT}/queues/${QUEUE_NUMBER}/moh)}"!=""]?Set(CHANNEL(musicclass)=${DB(${TENANT}/queues/${QUEUE_NUMBER}/moh)}):))
 same => n,Return()
 same => n(try_extension),ExecIf($[${DB_EXISTS(${TENANT}/extensions/${CALL_DESTINATION}/moh)}]?Set(CHANNEL(musicclass)=${DB(${TENANT}/extensions/${CALL_DESTINATION}/moh)}):)
 same => n,Return()

No sure exactly why it worked before or works in v4 currently, as to what I understand of the dialplan logic, it checks if the moh value exists for the queue, if there is a value and the value is not empty it sets the channel musicclass value to the value of set in the moh on the queue. In theory, there was always a value set in the queues moh setting, not sure if before it considered ringback as a nonexistant value and thats why it applies the music on hold value of the extension.

Couldn’t a better change be if the desired behavior is to inherit the music on hold of the queue, to first check if ringback is set as moh value for the queue, if it is set the music on hold to the value of the extensions otherwise keep using the value of the queue? I would still think having the option to define different music on hold for the queues, parking and regular hold is better than just inheriting the value but i guess some people do want moh inheritance. I just dont believe anybody would want that if ringback is set. Again not all queues need to be long queues and a lot of people prefer ringing than music on hold for short periods.

Something like that would work @miguel ?

exten => moh,1,NoOp(Set Music on Hold)
same => n,GotoIf($[${DB_EXISTS(${TENANT}/queues/${QUEUE_NUMBER}/moh)}]?:try_extension)
same => n,GotoIf($["${DB(${TENANT}/queues/${QUEUE_NUMBER}/moh)}"="ringback"]?try_extension)
same => n,ExecIf($["${DB(${TENANT}/queues/${QUEUE_NUMBER}/moh)}"!=""]?Set(CHANNEL(musicclass)=${DB(${TENANT}/queues/${QUEUE_NUMBER}/moh)}):))
same => n,Return()
same => n(try_extension),ExecIf($[${DB_EXISTS(${TENANT}/extensions/${CALL_DESTINATION}/moh)}]?Set(CHANNEL(musicclass)=${DB(${TENANT}/extensions/${CALL_DESTINATION}/moh)}):)
same => n,Return()