Hi, Mr. Spencer written the article "Using DUNDi with a Cluster of Asterisk Servers <http://www.voip-magazine.com/content/view/3644/0/1/0/> " in the VoIP Magazine and the piece follow: [lookupdundi] exten => _X,1,Goto(${ARG1},1) switch => DUNDi/priv exten => i,1,Goto(lookupmysql,${INVALID_EXTEN},1) I didn't get understand the usage ARG1 argument in the context. Do use ARG1 variable only into macro? Is not this usage apparent contradiction with Asterisk documents? Do anyone get explain this? Regards, Cleviton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070515/225ce6ed/attachment.htm
On 5/15/07, cleviton.araujo@caixa.gov.br <cleviton.araujo@caixa.gov.br> wrote:> > > > Hi, > > Mr. Spencer written the article "Using DUNDi with a Cluster of Asterisk > Servers" in the VoIP Magazine and the piece follow: > > [lookupdundi] > exten => _X,1,Goto(${ARG1},1) > switch => DUNDi/priv > exten => i,1,Goto(lookupmysql,${INVALID_EXTEN},1) > > > I didn't get understand the usage ARG1 argument in the context. Do use ARG1 > variable only into macro? Is not this usage apparent contradiction with > Asterisk documents? Do anyone get explain this? > > > Regards, > > Cleviton >Cleviton, You can pass arguments into a macro: exten => 500,1,Macro(something,${EXTEN}) [macro-something] exten => s,1,Dial(SIP/${ARG1},60) This is perfectly valid. You can pass multiple arguments and read them with ${ARG1}, ${ARG2}, etc, etc: http://www.voip-info.org/wiki-Asterisk+variables#Macrospecificvariables -- Kristian Kielhofner
Kristian Kielhofner wrote:> On 5/15/07, cleviton.araujo@caixa.gov.br > <cleviton.araujo@caixa.gov.br> wrote: >> Hi, >> >> Mr. Spencer written the article "Using DUNDi with a Cluster of >> Asterisk Servers" in the VoIP Magazine and the piece follow: >> >> [lookupdundi] >> exten => _X,1,Goto(${ARG1},1) >> switch => DUNDi/priv >> exten => i,1,Goto(lookupmysql,${INVALID_EXTEN},1) >> >> >> I didn't get understand the usage ARG1 argument in the context. Do >> use ARG1 variable only into macro? Is not this usage apparent >> contradiction with Asterisk documents? Do anyone get explain this? >> >> >> Regards, >> >> Cleviton >> > > Cleviton, > > You can pass arguments into a macro: > > exten => 500,1,Macro(something,${EXTEN}) > > [macro-something] > exten => s,1,Dial(SIP/${ARG1},60) > > This is perfectly valid. You can pass multiple arguments and read > them with ${ARG1}, ${ARG2}, etc, etc: > > http://www.voip-info.org/wiki-Asterisk+variables#Macrospecific > variablesKristian, I think Cleviton's point was that [lookupdundi] does not appear to be a macro, and so how can it have arguments if it just a normal context / extension? Kind regards, Sebastian
> Mr. Spencer written the article "Using DUNDi with a Cluster of Asterisk > Servers <http://www.voip-magazine.com/content/view/3644/0/1/0/> " in the > VoIP Magazine and the piece follow: > > [lookupdundi] > exten => _X,1,Goto(${ARG1},1) > switch => DUNDi/priv > exten => i,1,Goto(lookupmysql,${INVALID_EXTEN},1) > > > I didn't get understand the usage ARG1 argument in the context. Do use > ARG1 variable only into macro? Is not this usage apparent contradiction > with Asterisk documents? Do anyone get explain this?Exten => _X,1,Goto should have actually been Exten => _X.,1,Goto You can disregard this exten, it was meant to be a catch-all in this context, but the switch statement is really what is invoked when you send a call to this context, not the exten => _X. JR