Setting Channel Musicclass From AGI
Hi, Since SetMusicOnHold() is being deprecated, how do we set the channel musicclass from an AGI script?
Last time I checked you can’t call dialplan functions from AGI.
Thanks.
— James
Hi, Since SetMusicOnHold() is being deprecated, how do we set the channel musicclass from an AGI script?
Last time I checked you can’t call dialplan functions from AGI.
Thanks.
— James
3 thoughts on - Setting Channel Musicclass From AGI
Actually, you can. Any time you can evaluate or set a channel variable, you can also evaluate or set a dialplan function. Hence, you can use both ‘get variable’ [1] or ‘set variable’ [2]. You could also use ‘exec’ and call the Set dialplan application directly.
[1] https://wiki.asterisk.org/wiki/display/AST/AGICommand_get+variable
[2] https://wiki.asterisk.org/wiki/display/AST/AGICommand_set+variable
Hi Matt, So this actually works (haven’t had a chance to try it)?
SET VARIABLE CHANNEL(musicclass) default
Because musicclass is piece of channel information. Referencing ${musicclass} is not the same thing.
Thanks.
— James
James Lamanna wrote:
It should indeed work, yes.