${EXTEN} variables

I’m trying to create a dial plan were i after a person have dial an extension and press one to confirmed i can dial that extension. I’m using the ${EXTEN} variable but is only picking up the 1 that is dialed to confirm

any help?

thank you in advance

read the book

downloads.oreilly.com/books/9780596510480.pdf

yeah I have the same book and I having a hard time… thats why im looking for outside help…

thank you though

let me explain my problem again

when some calls my ivr they are ask to dial a 10 digit number, after that, asterisk looks it up a my database and it identifies it, after repeating the digits back to the caller, they are ask to dial 1 for yes 2 for no, if dialed 1 (yes) i need to execute an AGI and send with it the previous 10 digits that were dialed, im using ${EXTEN} but is only sending the 1 (last digit that was dialed to confirm).

  1. What application are you using to retrieve the number? Read? WaitExten? You didn’t show the relevant part of your dialplan.

  2. How are you reading it back to them? If using the variable set by Read, then use that variable for the dial instead of extension. If you are using WaitExten then going to another extension, set a variable to be the extension you are going to, and pass that into the AGI.

  3. AGI’s can take variables as an input parameter. (On 1.4, I believe 1.2 is a bit different here)

[quote=“psuarez”]yeah I have the same book and I having a hard time… thats why im looking for outside help…

thank you though

let me explain my problem again

when some calls my ivr they are ask to dial a 10 digit number, after that, asterisk looks it up a my database and it identifies it, after repeating the digits back to the caller, they are ask to dial 1 for yes 2 for no, if dialed 1 (yes) i need to execute an AGI and send with it the previous 10 digits that were dialed, im using ${EXTEN} but is only sending the 1 (last digit that was dialed to confirm).[/quote]

after ask to dialed the 10 digits im reading it back like this

exten => _XXXXXXXXXX,3,SayDigits(${EXTEN})
exten => _XXXXXXXXXX,4,GoTo(default2|${EXTEN}|1)

then sending it to a context in mysql using realtime, if the 10 digits do not exist in my database im asking to dial the number gain, If the 10 digits do exist im my database im sending (using GoTo) it to a download context were. is ask to confirm the 10 digits by pressing 1 to start an execute the agi

thank you I appreciate the fast responses.

What does the default2 context look like?

default2 is in mysql realtime

after the 10 digits are diled it goes to mysql and looks for it as it was an extension if the number is there, it is send to the download context

exten => _XXXXXXXXXX,1,GoTo(TTMdownloadE|000|1)

In the download context it is asked to press 1 to confirm and start download

if press 1, i execute the AGI, and that is were my problem lays i need to send those 10 digits with the agi like:

Agi(agi:http://XXXX.XXXXX.com/XXXX/poll_request.asp?ani=(${EXTEN})

but it is only sending the 1 that is dialed to confirm

That is your problem then… You are losing the extension once you issue the Goto there. Set a variable to be the ${EXTEN} prior to the GoTo, then pass that variable to the AGI.

exten => _XXXXXXXXXX,1,Set(ANI=${EXTEN})
exten => _XXXXXXXXXX,n,GoTo(TTMdownloadE|000|1)

then

Agi(agi:http://XXXX.XXXXX.com/XXXX/poll_request.asp?ani=(${ANI})

[quote=“psuarez”]default2 is in mysql realtime

after the 10 digits are diled it goes to mysql and looks for it as it was an extension if the number is there, it is send to the download context

exten => _XXXXXXXXXX,1,GoTo(TTMdownloadE|000|1)

In the download context it is asked to press 1 to confirm and start download

if press 1, i execute the AGI, and that is were my problem lays i need to send those 10 digits with the agi like:

Agi(agi:http://XXXX.XXXXX.com/XXXX/poll_request.asp?ani=(${EXTEN})

but it is only sending the 1 that is dialed to confirm[/quote]

that work perfect!! Im setting the variable for ani before I read it back like:

exten => _XXXXXXXXXX,1,DigitTimeout(3)
exten => _XXXXXXXXXX,2,Set(ANI=${EXTEN})
exten => _XXXXXXXXXX,3,Playback(youhave)
exten => _XXXXXXXXXX,4,SayDigits(${EXTEN})
exten => _XXXXXXXXXX,5,GoTo(default2|${EXTEN}|1)

them when i execute the agi it send the 10 digits number

thank you very much for your help!!