Change the outgoing CALLERID based on the FROM field of the

General discussions about Asterisk.

Moderators: Moderator, Support

Change the outgoing CALLERID based on the FROM field of the

Postby usmc » Sat Nov 21, 2015 6:01 pm

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,
usmc
Newsterisk
 
Posts: 1
Joined: Sat Nov 21, 2015 5:48 pm

Re: Change the outgoing CALLERID based on the FROM field of the

Postby david55 » Mon Nov 30, 2015 10:01 am

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.)
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am


Return to Asterisk General

Who is online

Users browsing this forum: No registered users and 1 guest