0

I need to rewrite a Caller id: this code seems to work but I want to set it for a multiple condition(for example, if number is 1005 rewrite to 383838, if number is 1006 then rewrite to 848481, etc) Anyone know how to do?

exten => _X.,1,Gotoif($[${CALLERID(num)}=1004]?2)
exten => _X.,2,SET(CALLERID(all)=My company<1234489>)

1 Answer 1

2

Use callerid matching in dialplan.

exten => _X./_1005,1,SET(CALLERID(all)=My company<1234489>)
exten => _X./_1006,1,SET(CALLERID(all)=My company<848481>)

exten => _X.,2,Noop(doing something for all)

See end of page: https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.