[asterisk-users] Outbound DID: in sip.conf or dialplan or db?

A J Stiles asterisk_list at earthshod.co.uk
Tue Mar 27 04:51:37 CDT 2012


On Tuesday 27 March 2012, Roland wrote:
> I am setting up my dialplan with quite some outbound numbers. We have a
> block of 100 DID's, for which some of them will go direct to specific
> phones. I am struggling how to solve this, so I am searching for a little
> advice. These are my concerns.
> 
> I could set the DID in the sip.conf using something like:
> 
> callerid="137-Roland" <31229253137>
> 
> 137 would be my extention number here.
> ..... 
> Any suggestions would  be appreciated! Am I missing any options here?

Assuming there is a reasonable mapping from "outside" numbers to "inside" 
numbers  (your example shows the external number as being 31229253 followed by 
the internal number; note also you can do simple integer maths within a 
dialplan, as unlike some languages + hasn't been appropriated for string 
concatenation),  it shouldn't be that difficult.

If an internal extension wants to call an internal extension, its caller ID 
ought already to be set to its "inside" extension number in sip.conf.  If it 
wants to call an external number, then it needs to set its caller ID to the 
appropriate inbound number.  If it's as simple as adding a prefix, then you 
need something in your dialplan like:

[management]
; 3 digits is internal
exten => XXX,1,Dial(SIP/${EXTEN},90)
exten => XXX,2,Hangup()
; 5 digits or more must be external -- ident as own DDI number
exten => XXXX.,1,Set(CallerID(num)=${DDIPREFIX}${callerID(num)})
exten => XXXX.,2,Dial(${POTS}/${EXTEN},90)
exten => XXXX.,3,Hangup()

Now, chances are, not every internal phone will want to ident as a unique 
external number -- perhaps you want all the phones in one office to ident as a 
single number, and all ring together  (using something like 
Dial(TECH/ext&TECH/ext&TECH/ext ..... )  when called from outside. In this 
case, you just need to configure all these phones into their own context in 
your sip.conf and something like this in your dialplan:

[sales-office]
; 3 digits is internal
exten => XXX,1,Dial(SIP/${EXTEN},90)
exten => XXX,2,Hangup()
; 5 digits or more must be external -- one ident for whole office
exten => XXXX.,1,Set(CallerID(num)=${SALESOFFICE})
exten => XXXX.,2,Dial(${POTS}/${EXTEN},90)
exten => XXXX.,3,Hangup()


-- 
AJS

Answers come *after* questions.



More information about the asterisk-users mailing list