How To Store Extension in a variable-Asterisk PBX


Does anyone know how to store the extension of an incoming caller (caller provisioned on the PBX) in a variable. I need to do this within the asterisk dialplan just after the call is answered.

[code];Answer call
exten => 1234,1,Answer()

;Store caller’s extension in a variable[/code]

Use the Set application combined with a local variable or the astdb