Asterisk: outgoing call does not set CALLERID in dialplan

I use Asterisk PBX to call a softphone, I use this command: "Launch SIP / 100 extension 4004", in the dialplan I need to get the CALLERID variable, but in this case it is always empty!

PS: If I call the extension (4004), set out CALLERID, and I can get it with a software telephone (100) ${CALLERID(num)}.

How to get the caller ID in the original case?

+5
source share
3 answers

latest solution i am using now:

  • I call my extension from php script (originally created SIP / 100 777 extension)
  • I am writing my extension to a text file (file_put_contents)
  • (CALLERID (num) = ${caller_id}

.

+2

, . - , . .

Action: Originate
Channel: local/12345@outgoing
Application: Echo
CallerID: Asterisk <12345>

extensions.conf:

[outgoing]
exten => 12345,1,NoOp()
same => n,Verbose(1, Outgoing Caller ID: {$CALLERID(all)})
same => n,Dial(SIP/${EXTEN})
same => n,Hangup()

- :

exten => 12345,1,NoOp()
same => n,Set(CALLERID(num)=54321)
same => n,Set(CALLERID(name)=Asterisk)
same => n,Verbose(1, Outgoing Caller ID: {$CALLERID(all)})
same => n,Dial(SIP/${EXTEN})
same => n,Hangup()

, AMI, , , .

. " " CallerID.

+9

, , Asterisk 1.8 Asterisk .

I asked on the forums before, and they said that the function will be added later. So what I did was modify app_originate.c to allow passing a number and a name.

Here is what I wrote last year: https://github.com/cmendes0101/asterisk-originate-callerid

Been in production for over a year and works well. It was written for 1.8. It was an easy modification, so if you are using a different version, you can simply distinguish the changes and make these small changes to your version for this to happen.

+4
source

All Articles