Richard Reina
2021-Nov-20 16:51 UTC
[asterisk-users] Substitute Macro() for Gosub in dialplan
Since Macro is deprecated I am trying to eliminate it from my diaplan. I believe I have successfully done so in the example below. ; dial an internal extension exten => 101,1 Macro(ext,100,Dahdi/15) TO: exten => 101,1,Dial(Dahdi/15,30) So far it seems to work. However I also in my dialplan have call routing examples that use macro that I am not able to figure out. exten => s/5553331111,1,Macro(busy); TO: exten => s/5553331111,1,Gosub(subBusy,start,1()); [subBusy] exten => s,1,Answer exten => s,2,Wait(1) exten => s,3,Playtones(480+620/500,0/500) exten => s,4,Wait(12) exten => s,5,Hangup However, after reloading the diaplan and calling from the specified number I get the error: Gosub attempted to reach non-existent destination 'subBusy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20211120/9b8bc867/attachment.html>
asterisk at phreaknet.org
2021-Nov-20 16:55 UTC
[asterisk-users] Substitute Macro() for Gosub in dialplan
On 11/20/2021 11:51 AM, Richard Reina wrote:> Since Macro is deprecated I am trying to eliminate it from my diaplan. I > believe I have successfully done so in the example below. > > ; dial an internal extension > exten => 101,1 Macro(ext,100,Dahdi/15) > > TO: > > exten => 101,1,Dial(Dahdi/15,30) > > So far it seems to work. However I also in my dialplan have call routing > examples that use macro that I am not able to figure out. > > exten => s/5553331111,1,Macro(busy); > > TO: > > exten => s/5553331111,1,Gosub(subBusy,start,1()); > > [subBusy] > exten => s,1,Answer > exten => s,2,Wait(1) > exten => s,3,Playtones(480+620/500,0/500) > exten => s,4,Wait(12) > exten => s,5,Hangup > > However, after reloading the diaplan and calling from the specified number > I get the error: > > Gosub attempted to reach non-existent destination 'subBusyYou are trying to gosub to the extension subBusy,start,1. But you have only defined subBusy,s,1. "s" has no special meaning in a subroutine as it did with Macro. Either change start to s or s to start.