If you're not using the ${ACCOUNTCODE} variable, you could do what I
did:
Here is an example of a sip.conf entry I have, stripped of non-relevant
detail:
[109]
accountcode=2065559999109 <----notice this is a combo of cid for trunks
-------------------------and extensions fused together
context=default
type=friend
username=109
host=dynamic
allow=ulaw
callerid=Chris Office <201>
Now when anyone calls intra-office, their 'callerid' extension shows up.
Here's some of my extensions.conf:
[trunk-outbound]
exten => _1NXXNXXXXXX,1,SetCIDNum(${ACCOUNTCODE:0:10})
exten => _1NXXNXXXXXX,2,Dial(${OUT-TRUNK}/${EXTEN})
exten => _1NXXNXXXXXX,3,Congestion()
exten => _1NXXNXXXXXX,103,Busy()
The SetCIDNum is all I need for Caller ID from Teliax, and the :0:10
strips the first 10 digits off the ACCOUNTCODE to make it work.
I'm sure there are prettier ways, but its something to consider using if
you have no need for account codes.
Chris Coulthurst
chris@shuksan.com
|-----Original Message-----
|From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-
|bounces@lists.digium.com] On Behalf Of Jodie Crouch
|Sent: Saturday, June 04, 2005 10:39 PM
|To: asterisk-users@lists.digium.com
|Subject: [Asterisk-Users] SetCallerID based on extension
|
|I am going through previous posts, but I am not finding anything. I
|apologize if this has been covered already.
|
|I want to be able to change the CallerID for outbound calls based on
|the extension making the calls. However, I don't really need this
|level of granularity. I have one asterisk box serving many markets.
|I want to set the CallerID to a local number in each market. So, of
|someone in Dallas, TX calls out it shows our Dallas number. If
|someone in Arizona calls out, I want it to show our Arizona number. I
|figured the best way to do this would be based on the extension, but
|if someone else has a better idea, please let me know.
|
|So, if we are going to set the caller id based on the extension, then
|this is what I need to know how to do.
|
|Right now, outbound is configured as below, in the extensions.conf
file.
|
|exten => _1NXXXXXXXXX,1,Dial(SIP/9725432876/${EXTEN})
|exten => _1NXXXXXXXXX,2,Hangup
|
|
|Please let me know how I can create this same process but change the
|CallerID to 2134531762 instead of 9725432876 when someone calls from
|extension 112 and to 9725432876 for extension 317.
|
|Thanks!
|Jodie
|_______________________________________________
|Asterisk-Users mailing list
|Asterisk-Users@lists.digium.com
|http://lists.digium.com/mailman/listinfo/asterisk-users
|To UNSUBSCRIBE or update options visit:
| http://lists.digium.com/mailman/listinfo/asterisk-users