How to update caller ID on callee channel


I’m trying to update the caller ID on the callee channel using Asterisk 20.2 with PJSIP. This is to emulate a DID-based environment that goes as follows:

  1. Caller XXX dials DID (12345)
  2. DID directs the call towards my Asterisk box
  3. Asterisk then dials a new B number (78910)
  4. Asterisk should not show the original caller ID XXX to the new B number, but rather the DID (12345) only

So far, I’ve tried setting this in a pre-dial handler, but it fails.

The pre-dial handler:

exten => updatefrom,1,Set(${CALLERID(num)}=1000)

The Dial() application:

exten => 12345,n,Dial(PJSIP/1234567890@mytrunk,b(handler^updatefrom^1))

I read somewhere that the CALLERID variables cannot be changed, but I’m not sure and I can’t find it again either.

In short, I’d like to all references of the original caller ID on the outbound call to the new callee on Asterisk.

Appreciate the help.

Please ignore… found it. I should have spent the time reading the docs better than typing this long message…

For others seeking the same:

exten => 1000,n,Set(CALLERID(num)=101010101)
exten => 1000,n,Dial(PJSIP/1234567890@mytrunk,2)

There’s no need to do this through pre-dial handlers.

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