Gonzalo Servat
2008-Mar-15 22:25 UTC
[asterisk-users] Calling a Macro with arguments in AstApplication/AstApplicationData
Hi All, This question is probably more for the LDAP experienced users/developers as I'm sure it would work fine if I weren't using LDAP (but I am, and I'm almost there with the setup!!!). I've setup an extension with the following: AstExtension: 210 AstApplication: Macro AstApplicationData: call-ext,SIP/testuser&IAX2/testuser,210 When I dial this extension, I see the following in the log: -- Executing Macro("SIP/testuser-082b11f8", "call-ext,SIP/testuser&IAX2/testuser,210") [Mar 15 16:14:06] DEBUG[6060]: pbx.c:2679 pbx_extension_helper: Launching 'Set' -- Executing [s at macro-call-ext:1] Set("SIP/testuser-remote-082b11f8", "LOCAL(arg1)=SIP/testuser&IAX2/testuser") in new stack [Mar 15 16:14:06] ERROR[6060]: app_stack.c:370 local_write: Tried to set LOCAL(arg1), but we aren't within a Gosub routine .. which means I'm not able to access these arguments inside the Macro :( FWIW, I've defined this Macro in extensions.ael (not .conf). Any ideas?? Thanks in advance! - Gonzalo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080315/c5854fb7/attachment.htm
Gonzalo Servat
2008-Mar-16 01:41 UTC
[asterisk-users] Calling a Macro with arguments in AstApplication/AstApplicationData
On Sat, Mar 15, 2008 at 8:25 PM, Gonzalo Servat <gservat at gmail.com> wrote:> [..snip..] > > AstExtension: 210 > AstApplication: Macro > AstApplicationData: call-ext,SIP/testuser&IAX2/testuser,210 > > When I dial this extension, I see the following in the log: > > -- Executing Macro("SIP/testuser-082b11f8", > "call-ext,SIP/testuser&IAX2/testuser,210") > [Mar 15 16:14:06] DEBUG[6060]: pbx.c:2679 pbx_extension_helper: Launching > 'Set' > -- Executing [s at macro-call-ext:1] Set("SIP/testuser-remote-082b11f8", > "LOCAL(arg1)=SIP/testuser&IAX2/testuser") in new stack > [Mar 15 16:14:06] ERROR[6060]: app_stack.c:370 local_write: Tried to set > LOCAL(arg1), but we aren't within a Gosub routineFound a solution to this so I'm replying to myself just incase anyone else runs into this problem. Probably not the best solution but it works. Since I'm using AEL, pbx_ael creates the macro for me in the dialplan and it automatically adds: Set(LOCAL(argument)=value); .. for every macro argument. Turns out I can just use ${ARG1} and ${ARG2} (etc) in the macro itself and it works fine! Best regards, Gonzalo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080315/b24b6844/attachment.htm