Calling GOSUB From Macro On Asterisk 1.8

Home » Asterisk Users » Calling GOSUB From Macro On Asterisk 1.8
Asterisk Users No Comments

    I know we should not be running an Asterisk so old but this customer really does not want to replace this particular installation. 
I am having a problem when calling Gosub from a macro.  It seems that if I call gosub and return to the macro all Macro related variables like MACRO_EXTEN and ARG are gone.  Is that expected or should I look for a problem elsewhere?

    On the CLI I can see the call enter the macro, the use the GOSUB
code and when it returns to try to dial I have something like:
Dial(${ARG1}) (where ARG1 is a parameter sent to the macro).  I get an error:

WARNING[21682] app_dial.c: Dial requires an argument (technology/number)

    This is because the ARG variable is no longer available after the GOSUB.  If I remove the gosub everything works as expected.  I know macros are deprecated but they are in use in most of my servers and it will take a while to replace everything.  Any pointers?


Telecomunicaciones Abiertas de México S.A. de C.V. Carlos Chávez
+52 (55)8116-9161