Change the outgoing CALLERID based on the FROM field of the

Hi Everyone,

I’d like to change the outgoing CALLERID based on the FROM field of the SIP Header.
For exemple :
When my internal number 4000 make a call, the outgoing CALLERID will be +334 222 222 222
And when my internal number 5000 make a call, the outgoing CALLERID will be +334 333 333 333

The FROM field contains my internal number.

I already know how to process the FROM field to obtain the number but I’m stuck after.
Can I use an IF statement to do that ?

It should be like this :
if “in_number” = 4000, CALLERID = +334 222 222 222
if “in_number” = 5000, CALLERID = +334 333 333 333

Any ideas ?
Thanks

BR,

This is a support question, so should be on Asterisk Support.

exten=>_X./4000,n,Set(CALLERID(num)=+334222222222)
exten=>_X./5000,s,Set(CALLERID(num)=+334333333333)
etc.

(Or the hard way:

exten=>_X./ExecIf($["${CALLERID(num)}"=“4000”]?Set(CALLERID(num)=+33422222222)

etc.)