Asterisk Dialplan Caller ID

Hi @everyone ,

I have a dial plan set up, when i call to the number it reads the customer phone number,but when i dial out, it reads my own number.

I have tried with : exten => s,n,Set(phone=${CALLERID(num)})
and also tried with exten => s,n,Set(phone=${EXTEN}) ,
what am i missing?

By the way, the outgoing call is from a php. generatecall.php.

If anyone can help, i appreciate it

can you post the request that you php generate to make your outgoing call
and the output from asterisk, when it makes the call
and your dialplan

Also to whom does it present “your number”? I’d expect the callee to see your number, especially in North America, post STIR/SHAKEN. What the caller sees is not caller ID, although, if you are doing it through AMI, both parties may actually be callees, which is one reason why the details already requested are needed to understand what you are doing. Also, we have no idea how the rest of your dialplan uses ${phone}.

Sorry for the late reply,

the dial plan looks like this, ivr style for a private survey,

[survey]
exten => s,1,Answer()
exten => s,n,Goto(extensions,s,1)
exten => s,n,Hangup()

As a side note, i put S for incoming and I for outgoing, otherwise it would call and just hung up before the start of the survey. I found that this exten is working OK for incoming and outgoing.

[extensions]
exten => s,1,Answer() ; Answer the line
exten => s,n,Background(ivr/choice_1)
exten => s,n,WaitExten()

exten => i,1,Background(ivr/choice_1)
same => n,WaitExten()
exten => t,1,Set(TIMEOUT(digit)=10) ; Set Digit Timeout to 5 seconds
exten => t,2,Set(TIMEOUT(response)=20) ; Set Response Timeout to 10 seconds
exten => t,3,Hangup()

exten => 1,1,Goto(right,s,1)
exten => 2,1,Goto(wrong,s,2)

For the incoming call, it reads the customer number very well, but when the outgoing starts, it reads the number i`m calling from, and not the number i dialed. I need the numbers dialed to be displayed so i know what numbers and email took the survey.

This is just a demo IVR . I can`t find the extension that reads the number dialed.
[right]
exten => s,1,Playback(ivr/welcome)
exten => s,n,NoOp(First we start by getting the phone number)
exten => s,n,Set(phone=${CALLERID(num)})
exten => s,n,NoOp(7 digits code that received by email for registration)
exten => s,n,Read(emailpin,ivr/emailpin,3,7)
exten => s,n,GotoIf($[LEN(${emailpin}) != 4]?59:13)
exten => s,n,NoOp(4 digits code)
exten => s,n,Read(promopin,ivr/promopin,3,7)
exten => s,n,GotoIf($[LEN(${promopin}) != 4]?69:16)

…and so on.

in witch context do call com in ?
that one should include something like this

exten => _X!,1,Set(NumberDialed=${EXTEN})
same => n,Set(phone=${CALLERID(num)})
same => n,NoOp(Call From "${phone}" to "${NumberDialed}")
...

That worked. thank you. Appreciate your help !!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.