Asterisk question to get a number and a name for whom call i

How can I get a number and a name for whom the call is sent in file extensions.conf of [from-pri] and [from-sip] contexts?
There is dialplan function CALLERID(all) which is used to get the caller name and number.
But i didn`t find the function to get a number and a name for whom call is addressed.
Thanks!

I think you are looking for the EXTEN variable :wink:

OK. Thats right. But then I use extension => _X., n, NoOp(EXTEN = ${EXTEN}) in console appears verbose log like "EXTEN = 3700". But the destinations number has 10 digits in itself like as caller number has 10 digits too.
Why in EXTEN there are only 4 digits?

I don’t believe your extensions are 10 digits. You mean when you call on of the other sip phones internally, you have to dial 10 digits?

I imagine that your have DID’s for your incoming numbers, which are 10 digits, but depending on how you have this setup with your phone company, will depend on how many of the digits they are sending in on your pri (usually only the last 1-5).

You would have to post some of your dialplan to be able to validate that.

As mazzic says, this depends on your setup with your phone company, but the following may work:

${CALLERID(dnid)}

DNID stands for “dialed number identifier”

Cheers,
Raman