1

I am writing an IVR and would like to get the keypad number the user dialled and store in in a variable. Does anyone know if asterisk defines such a channel variable? I cannot seem to find in in any variable lists.

user3317524
  • 63
  • 1
  • 10

2 Answers2

0

There are 2 main practice in dooing ivr

 exten => s,1,Background(ivr-file-without-extension);play
 exten => s,2,WaitExten(); wait for input
 exten => 1,1,Noop(1 pressed); do something if 1
 exten => 1,2,Set(result=1);for example set variable 

Or

 exten => s,1,Read(result,ivr-file-without-extension,max_digits);
 exten => s,n,Noop(result=${result});

In both variants you can set up ANY variable name, thats why you can't find "magic" variable.

But i highly recommend you first read any single asterisk book for beginners. It is very unlikly you can do working app with your current knowledge(based on question asked).

Alexander Gonchiy
  • 916
  • 11
  • 17
arheops
  • 15,544
  • 1
  • 21
  • 27
0

I actually not clearly about your question. As you said : "to get the keypad number the user dialled and store in in a variable" so it very simple

exten => _X.,1,Noop(User dialed number: ${EXTEN});

So the variable you need is: ${EXTEN}

user3131703
  • 101
  • 3