Hmmm. Not having much luck with this. I'm trying to call the DUNDILOOKUP function and assign it to a variable in an AGI script. I've tried setting with EXEC CMD and with SET VARIABLE. In both cases, it's treating DUNDILOOKUP literally, rather than calling a funciton. I've tried this: EXEC "Set" "DIALPATH=${DUNDILOOKUP(2944093|180net)}" and also: SET VARIABLE DIALPATH ${DUNDILOOKUP(2944093|180net)} in both cases, DIALPATH is set to a literal "${DUNDILOOKUP2944093|180net}" What am I doing wrong here? Doug.
What is you AGI written in??> -----Original Message-----snip> Doug.
Python... but it doesn't matter. The examples I pasted where what I am sending to stdout, so the scripting application shouldn't be an issue.> -----Original Message----- > From: Alexander Lopez [mailto:Alex.Lopez@OpSys.com] > Sent: Thursday, June 15, 2006 3:31 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: RE: [Asterisk-Users] Executing a Function from AGI > > > What is you AGI written in?? > > > -----Original Message----- > snip > > Doug. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
I'm getting nowhere with this. Is it even possible to set a variable to the result of a function call in AGI???> -----Original Message----- > From: Douglas Garstang > Sent: Thursday, June 15, 2006 3:22 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] Executing a Function from AGI > > > Hmmm. Not having much luck with this. I'm trying to call the > DUNDILOOKUP function and assign it to a variable in an AGI script. > I've tried setting with EXEC CMD and with SET VARIABLE. In > both cases, it's treating DUNDILOOKUP literally, rather than > calling a funciton. > > I've tried this: > EXEC "Set" "DIALPATH=${DUNDILOOKUP(2944093|180net)}" > > and also: > SET VARIABLE DIALPATH ${DUNDILOOKUP(2944093|180net)} > > in both cases, DIALPATH is set to a literal > "${DUNDILOOKUP2944093|180net}" > > What am I doing wrong here? > > Doug. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
In article <645FEC31A18FE54A8721500CDD55A7B603507405@mail.oneeighty.com>, Douglas Garstang <dgarstang@oneeighty.com> wrote:> Hmmm. Not having much luck with this. I'm trying to call the DUNDILOOKUP > function and assign it to a variable in an AGI script. I've tried > setting with EXEC CMD and with SET VARIABLE. In both cases, it's > treating DUNDILOOKUP literally, rather than calling a funciton. > > I've tried this: > EXEC "Set" "DIALPATH=${DUNDILOOKUP(2944093|180net)}" > > and also: > SET VARIABLE DIALPATH ${DUNDILOOKUP(2944093|180net)} > > in both cases, DIALPATH is set to a literal "${DUNDILOOKUP2944093|180net}" > > What am I doing wrong here?I think you need to do "GET VARIABLE DUNDILOOKUP(2944093|180net)", with no ${}, and then do whatever you need with the return value, such as passing it to "SET VARIABLE DIALPATH ...". Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org
On Thu, Jun 15, 2006 at 03:21:32PM -0600, Douglas Garstang wrote:> I've tried this: > EXEC "Set" "DIALPATH=${DUNDILOOKUP(2944093|180net)}" > > and also: > SET VARIABLE DIALPATH ${DUNDILOOKUP(2944093|180net)} > > in both cases, DIALPATH is set to a literal "${DUNDILOOKUP2944093|180net}""get full variable" evaluates a channel expression, but "set variable" cannot be used this way. Use "GET FULL VARIABLE" to get the value and then use "SET VARIABLE" to store this value in the DIALPATH variable. -- Stefan Tichy <asterisk@pi4tel.de>
> -----Original Message----- > From: Time Bandit [mailto:timebandit001@gmail.com] > Sent: Thursday, June 15, 2006 4:49 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [Asterisk-Users] Executing a Function from AGI > > > > I'm getting nowhere with this. Is it even possible to set a > variable to the result of a function call in AGI??? > <snip> > > > SET VARIABLE DIALPATH ${DUNDILOOKUP(2944093|180net)} > > > > > > in both cases, DIALPATH is set to a literal > > > "${DUNDILOOKUP2944093|180net}" > > > > > > What am I doing wrong here? > You are telling it to assign the value ${DUNDILOOKUP2944093|180net} to > the variable DIALPATH, and it seems it is doing exactly that > > Remember that you're in an AGI, not in the dialplan, so your variable > doesn't get interpreted > > And to answer your question, I think you should call the function, get > the result, then assign that to your variableStill not having any luck! I tried sending this to stdout: SET VARIABLE DIALPATH DUNDILOOKUP(2944093|180net) I must be missing something still. I assigned DIALPATH to the function.
> -----Original Message----- > From: Stefan Tichy [mailto:asterisk@pi4tel.de] > Sent: Friday, June 16, 2006 7:26 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] Re: Executing a Function from AGI > > > On Thu, Jun 15, 2006 at 03:21:32PM -0600, Douglas Garstang wrote: > > I've tried this: > > EXEC "Set" "DIALPATH=${DUNDILOOKUP(2944093|180net)}" > > > > and also: > > SET VARIABLE DIALPATH ${DUNDILOOKUP(2944093|180net)} > > > > in both cases, DIALPATH is set to a literal > "${DUNDILOOKUP2944093|180net}" > > "get full variable" evaluates a channel expression, but "set > variable" cannot be used this way. > > Use "GET FULL VARIABLE" to get the value and then use "SET VARIABLE" > to store this value in the DIALPATH variable.Oh... Thanks... This doesn't seem to be documented anywhere. Where did you find out about this? Doug.