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

Roland asterisk at rolandow.com
Tue Mar 27 03:59:24 CDT 2012


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.

I think the downside of this is, that I should configure this for each SIP
account. I could specify a default callerid, which our main DID, in a
template, but then people will see this general ID when I call internal
extentions as well. This way the receiver cannot see my extention number.

Other solution would be to specify my DID in the dailplan. I tried this
solution, which works:

exten => _00Z.,1,NoOp(Call Received from ${CALLERID(num)} to ${EXTEN:1})
exten => _00Z./Jeroen_S,2,Set(CALLERID(num)=31229700210)
exten => _00Z./Roland_odA,2,Set(CALLERID(num)=31852013900)
exten => _00Z./Schoolshopper,2,Set(CALLERID(num)=31852013900)
exten => _00Z.,2,Set(CALLERID(num)=31229700203)
  same => n,GotoIf($[${CALLERID(num)}=31852013900]?otconnect:voys)
  same => n(otconnect),Set(OUT=999210485)
  same => n,Goto(dodial)
  same => n(voys),Set(OUT=143810001)
  same => n(dodial),Dial(SIP/${EXTEN:1}@${OUT})

Upside is that I can be more specific in routing. The same handset could
have different DID's, but I think usually the DID is bound to a SIP
account. So I would probably create a second SIP account if a user needs an
extra DID anyways.

The downside in my opinion is that my Dialplan will be filled with around
30 extra lines with account specific stuff. I would rather keep my dialplan
code clean. Also when I would have more patterns that can be matched, I
have to specify them for this pattern as well. That would already take
around 60 lines of extra code.

I have considered an AGI call to fetch the data from a database. But
wouldn't this be a higher risk? When the database fails or is too slow, it
will not work? I would rather use mysql than the asterisk db, because i can
manage mysql easy with phpmyadmin.

Any suggestions would  be appreciated! Am I missing any options here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120327/47f82412/attachment.htm>


More information about the asterisk-users mailing list