0

I am using Asterisk for voice calling.

I am using below context If user call back-

[from-pstn]
exten =>  _X.,1,Playback(demo-thanks)

suppose my number is 74900 on which user can call back.

what I want if user call on 749001, 749002 then i could recognize what user has exactly dialed. currently when user dials 749001 then asterisk console shows-

Executing [74900@from-pstn:1] Playback("DAHDI/i1/usernumber-1e", "demo-thanks") in new stack

How can I get exact number dialed by user ?

Himanshu Matta
  • 77
  • 1
  • 2
  • 8

1 Answers1

1

Use the built-in EXTEN variable to access the number user dialed in. Example:

[from-pstn]
exten => _X.,1,Playback(demo-thanks)
same => n,SayNumber(${EXTEN})

See Using the CONTEXT, EXTEN, PRIORITY, UNIQUEID, and CHANNEL Variables.

LiuYan 刘研
  • 218
  • 1
  • 2
  • 14
  • I tried this ...still getting result up to 74900 – Himanshu Matta Feb 23 '13 at 11:37
  • @HimanshuMatta, is `749001` a valid [DID](http://en.wikipedia.org/wiki/Direct_inward_dialing) number? – LiuYan 刘研 Feb 23 '13 at 12:24
  • Valid number is 74900 but when someone dials 749001 then also call comes but with extension 74900 not with 749001 it's possible to get exact extension or not ? – Himanshu Matta Feb 23 '13 at 14:05
  • @HimanshuMatta, I'm afraid it's not possible, because telecom service provider doesn't send `749001` to you even the user dialed it. In your case, you need setup an IVR to let user press `1` or `2` to forward call to extension `749001` and/or `749002` – LiuYan 刘研 Feb 23 '13 at 15:43