Jumping inside a macro with AEL

Home » Asterisk Users » Jumping inside a macro with AEL
Asterisk Users No Comments

Hello,
I am not able to jump to a label from inside a macro. The goto is made
inside a catch while the label is in the body of the macro:

macro recordMessage() {
Answer();
recordagain:
Playback(after-the-tone);
Playback(say-temp-msg-prs-pound);
record(/tmp/${UNIQUEID}.wav);
earagain:
Playback(/tmp/${UNIQUEID});
Background(press-1);
Background(to-hear-msg-again);
Background(press-2);
Background(to-rerecord-yr-message);
Background(press-pound-save-changes);
WaitExten(15);

catch 1 {
goto earagain;
};

catch 2 {
goto recordagain;
};

catch # {
AGI(uploadMedia.php,/tmp/${UNIQUEID}.wav,wav,${TENANTID});
Playback(your-msg-has-been-saved);
};
};

The “goto earagain” fails because the label is searched inside the 1
extension.

How can I jump correctly to the label?

Leandro