[Asterisk-Users] Last Number Redial for Analog Phones

Jim Sneeringer j at snee.us
Mon Mar 8 08:33:07 MST 2004


I am trying to implement a Last Number Redial feature for standard analog
phones connected to a Digium FXO card, using global variables (since the
information must survive between calls).  I am using a different global
variable for each channel, since the last number should be saved for each
channel.  Whenever an external call is made, the number is saved in a
variable that ends with the name of the channel.  (For simplicity, I am
going to assume that he variable name is simply the channel name.)  I can
set the global variable successfully using

   exten => s,1,SetGlobalVar(${CHANNEL},${ARG1})

My problem is that I don't know how to read the contents of that variable
without testing for separately for each channel, because the name of the
variable is in a variable, and I can't figure out how to dereference it
twice.  For example, if I try to redial using

   exten => #3,1,Dial(${TRUNK}/${CHANNEL})

then it will try to dial the NAME of the channel instead of the number
stored in the global variable with that name.  I guess I want to do
something like this:

   exten => #3,1,Dial(${TRUNK}/${${CHANNEL}})

but it doesn't seem to work, nor does anything else I can think of.

Can anyone suggest a solution to the problem or a better approach to redial?





More information about the asterisk-users mailing list