I’m having a issue with gosubs, in this example I’m using a sub to dial out, first argument is destination, second is options, third is timeout, in ARG2 I have a macro which requires ( and ) when the gosub sees the ) character it thinks that the gosub is done and therefore anything afterwards does not get processed, in my case the m (for music on hold) and the 30 (for timeout), I tried using quotes or the “” as a escape character but nothing works.
[testtest]
exten => s,1,gosub(sub_dialing_smart,s,1(sip/test,M(screen)m,30)
[sub_dialing_smart]
exten => s,1,set(__destination1=${ARG1})
exten => s,n,set(__options=${ARG2})
exten => s,n,set(__timeout=${ARG3})
-- Executing [s@testtest:1] Gosub("Console/dsp", "sub_dialing_smart,s,1(sip/test,M(screen)m,30") in new stack
-- Executing [s@sub_dialing_smart:1] Set("Console/dsp", "__destination1=test") in new stack
-- Executing [s@sub_dialing_smart:3] Set("Console/dsp", "__options=M(screen") in new stack
-- Executing [s@sub_dialing_smart:4] Set("Console/dsp", "__timeout=") in new stack