How to set outbound CallerID based on extension?

I’ve spent the past hour scouring the web trying to find an answer to this, and alas I seem to have failed. So I turn to you fellow forum users…

I have an Asterisk system setup with 10 different extensions for each of my employees. They all have their own SIP phone (Aastras) on their desk, and they all have their own physical phone number (purchased from Voicepulse). I’m using Voicepulse Connect for my outgoing.

How do I set the outbound caller ID so that when each person dials, their own direct desk phone # shows up?

Everything I’ve seen says I need to setup my extensions.conf as such:

exten => _1NXXNXXXXXX,1,Set(CALLERID(num)=)
exten => _1NXXNXXXXXX,2,Dial,IAX2/${VOICEPULSE_GATEWAY_OUT_A}/${EXTEN}

etc…

But I don’t want a single CallerID for every outbound call – I want each person’s callerID to show when they call from their desk.

I have callerid=“Name” set in sip.conf, but that doesn’t seem to help – Voicepulse is still showing up as “unknown/blocked” unless I specifically issue a Set(CALLERID(num) command. I can’t for the life of me find a variable to use that references the specific calling party’s caller ID.

Any suggestions? Thanks!!

–Noah

HI
to make out side call with caller id try the below mention things for IAX or SIP

[out-call context]
exten => _1XXXXXXXXXX/7070,1,Set(CALLERID(num)=6467177791)
exten => _1XXXXXXXXXX,n,Dial(SIP/${EXTEN}@SWITCH,T)
now here 7070 is extension when he make out call its caller id is 6467177791 on second line we just dail out with sip peeer swtich which we mention in sip.conf

Amit

Hi

You could add a varible to the sip.conf of each handset and set the callerID(num) to this when the call is made.

also you may want to make sure the trust rpid is set to yes

Ian

[quote=“ianplain”]Hi

You could add a varible to the sip.conf of each handset and set the callerID(num) to this when the call is made.

also you may want to make sure the trust rpid is set to yes

Ian[/quote]

Perfect – that’s exactly the info I’m looking for. Can you tell me how I actually access that variable in extensions.conf?

If you set the caller ID in the sip.conf to the number you want the outside caller to see like this:

[1]
type=friend
secret=secret
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=sip-phones
; CID reflects DID number
callerid=“Joe Smith” <15555551212>
mailbox=1

Now, if you use the callerid in the sip.conf to display another number, say the local extension for example:

[1]
type=friend
secret=secret
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=sip-phones
; CID reflects inside extension, not DID number
callerid=“Joe Smith” <1>
mailbox=1

Then in the extensions.conf you can set up a lookup table for each internal extension that maps the CID to the correct external number:

exten => _9NXXXXXX,1,NoOp
; Joe smith’s caller ID is set to one in sip.conf
exten => _9NXXXXXX,n,GotoIf($[ ${CALLERID(number)} = 1 ]?joe_smith)
exten => _9NXXXXXX,n(joe_smith),Set(CALLERID(number)=15555551212)
.
.
.
exten => _9NXXXXXX,n,Dial($outbound_trunk/${EXTEN:1})

Big note here: All of this assumes that your provider will pass along what you hand them for the CID.

I use a variation on this for locations rather then people. With a SIP or IAX based provider the concept of a local 7 digit number is lost. I use a lookup table to map users to area codes, so even though I have phones connecting to my server from across the US, they can dial 7 digit local numbers like they would form a normal telephone.