[asterisk-users] sip.conf best practices?

Drew Gibson drew at oanda.com
Wed Sep 19 10:37:10 CDT 2007


Erik Anderson wrote:
> All - I've been wrestling with how to best structure the sip device
> accounts on a new asterisk server I'm deploying.  All of the sip
> devices (currently only Linksys SPA941s) will reside on the same
> subnet as the server, and I have already set up a decent automatic
> provisioning system for the phones.  When the rollout is complete,
> there will be about 100 SIP devices authenticating and routing calls
> through this server.  The question is what to use for the username
> portion of the SIP account.
>
> Part of me says that I should standardize on using each phone's MAC
> address as the sip account UID, like so:
>
> ; Joe Smith, x123
> [000E08DA0409]
> secret = blahblah
> ... and so on and so forth
>
> Doing it that way is nice for standardization's sake, but it makes the
> dialplan quite a bit more complex.
>
> The obvious alternative is to use the extension as the sip UID:
>
> ; Joe Smith, x123
> [123]
> secret = blahblah
> ...
>
> This makes the dialplan *much* more simple, but when looking through
> sip.conf, it's not as immediately obvious what device should be
> authenticating with that account.
>
> Since this is my first large-ish asterisk deployment, I'm seeking the
> advice of those who have gone before me.  What tactic (one of the
> above options or otherwise) is best to keep your sip.conf sane?
>
> Thanks!
> -Erik
>
>   
Hi Erik,

We have around 100 devices and most of our changes are adds for new 
users/devices with occasional re-assignment of devices. We manage our  
users and devices with some simple scripts and good old vi for exceptions.

Our extensions.conf has a list of global vars that tie an extension to a 
sip (or iax, or whatever) device. (I think this is straight from TFOT v1)

eg EXT_100=SIP/100

This allows us to redirect extensions to different devices or make 
extensions ring on multiple devices by changing that var alone (no need 
to alter macros or other dialplan elements)

eg EXT_100=SIP/101&SIP/102

The device-specific hardware and the SIP configurations are generated 
from a master "map" that contains a line per device including technology 
and extension, MAC, user display name and email address.

Scripts create the phone hardware configs with device type determined by 
MAC address (eg. Aastra, Grandstream or Cisco) from the "map" file and 
add the user to sip.conf and voicemail.conf.

sip.conf ...

[grandstream]
; Aastra 480i phones for general office
... (general SIP settings)
context=office-dial

[aastra-cc]
; Aastra 480i phones for Call Centre only
... (general SIP settings)
context=cc-dial

[100](grandstream)
username=100
secret=*******
mailbox=100
callerid="Joe Bloggs" <100>

[101](aastra-cc)
username=101
secret=*******
mailbox=101
callerid="Agent 99" <101>


Initially we only had one "class" of user, general office types using 
Grandstreams. When we migrated the Call Centre to Asterisk, they were 
the only users with Aastra phones, apart from one or two in the general 
office. So each "class" of user had a different hardware type and was 
easy to automate, the exceptions are currently handled with manual edits.

This system is working well and is stable but not sufficiently flexible 
for the future. Our company is growing rapidly and since we will no 
longer be buying Grandstream devices, more Aastras are appearing in the 
general office environment. This means we now have two "classes" of 
users that require different configs for the same device type, general 
office users and Call Centre agents.  This means a choice will have to 
be made between updating the scripts to cope with the two user classes 
or moving to realtime. Where's my Magic 8-ball... :-)

regards,

Drew

-- 
Drew Gibson

Systems Administrator
OANDA Corporation
www.oanda.com




More information about the asterisk-users mailing list