Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


titleRewriting Caller ID

Changing the value of CALLERID(num) variable inside of extension handler matched by Caller ID can immediately throw the call to another handler. Consider the following example:

No Format

exten => s/_1XX,1,Set(CALLERID(num)=200) ; <- Example call starts here
same  =>        2,Hangup() 				               ; <- This line is NEVER reached normally because of the assignment above

exten => s/_2XX,1,SayDigits(1)
same  =>        2,SayDigits(2)           ; <- This is where the dialplan proceeds instead
same  =>        3,SayDigits(3)
same  =>        4,SayDigits(4)

You'd expect the call with Caller ID 100 to hang up, but instead you'd hear Asterisk saying "two, three, four".
As soon as the Caller ID changes, the next priority Asterisk goes to will be inside extension handler that matches the new Caller ID.