Detect dialed number

hi all…

i’d like to redirect callers based on the number they dialed in. i tried the DIALEDPEERNUMBER and DIALEDPEERNAME vars but they come out empty. how else can i do that?

Asterisk 1.4.17

thanks…

${EXTEN}? You can always copy it to a channel variable.

In theory ${CALLERID(dnis)} serves this purpose, but I’ve never checked how it is actually handled.

[quote=“david55”]${EXTEN}? You can always copy it to a channel variable.

In theory ${CALLERID(dnis)} serves this purpose, but I’ve never checked how it is actually handled.[/quote]

the EXTEN is just showing the current extension. and ${CALLERID(dnis)} didn’t return anything.
i’m interested in the number dialed to access the box. like if there are more than one number used to dial into the box when the machine picks up the call i would like to detect what number was dialed on the outside to reach it.

when you say: “You can always copy it to a channel variable.” what exactly do you mean?

it’s been a while since i worked with asterisk…

thanks…

${DNID} is empty too…

Use the Set application in the first context that handles the call.