Archive for April, 2008

Automatically configuring Snom VoIP Telephones for Asterisk

Sunday, April 27th, 2008

If you configure VoIP Telephones for use with the Asterisk PBX you usually have to edit at least three places: sim.conf, extensions.conf ant the phone itself. I wanted a way to have configuration at a single place like this:

# MAC       TelNr SIP-Username   Monitor Caller-IDs       Realname
0004132620A2 4130 pudel          4623,4629,4677,4630      Carsten Pudel
000413262E20 4110 bibo           4132,4116,4124,4131,4138 Birgit Bonrath
0004132620a7 4111 edornseif      4122,4137,4901,4611,4133 Evelyn Dornseif
00041323B063 4112 mdornseif      4110,4132,4116,4124      Dr. Dornseif

MAC is the MAC-Address (can be found under the phone below a barcode), TelNr is the desired extension where this phone should be reachable, SIP-Username is the sip user name you wish to use for this phone. Monitor Caller-IDs is the list of other phone numbers (up to 8) which should be monitored via the special buttons on the right of a Snom telephone.

The Python script snom.py reads the configuration shown above from a file called snom.txt. It then generates a lot of new configuration files:

sip-snom.conf SIP Account information, usually put into sip.conf by typing #include sip-snom.conf
extensions-snom.conf Dialplan information, usually put into your extensions.conf by typing #include extensions-snom.conf in your [default] context.
extensions-intercom-snom.conf Generates a context [intercom-allsnoms] which allows you to speak a messge through the loudspeakers of all your snome phones. Include it in your extensions.conf with something like exten => 1234,1,Goto(intercom-allsnoms,s,1)
dhcpd-snom.conf can be used by your dhcp-Server to give out reasonable adresses to your snom phones
phonebook-snom.txt A phone book in Trac Wiki Syntax.
snom/phonebook.xml Phonebook in XML Format used by Snom Phones
snom/snom3×0-000413XXXXXX.htm Configuration for phone with the MAC-Address 000413XXXXXX
snom/snom3×0-keys-ZZZZ.pdf Keyboard Layout for Phone with Extension ZZZZ. Needs ps2pdf from the Ghostscript package

To make Snom Auto configuration (”Mass Deployment“) work you need to update your Phones to Firmeware V7. You also need a webserver beeing able to deliver the directory ./snom/. I assume the Webserver is available at the IP-Address 172.28.1.2.

Finally you need some additional files:

snom/snom3x0.htm – master configuration file

<?xml version="1.0" encoding="utf-8" ?>
<setting-files>
  <file url="http://172.28.1.2/snom/general.xml" />
  <file url="http://172.28.1.2/snom/phonebook.xml" />
  <file url="http://provisioning.snom.com/config/web_lang.xml" />
  <file url="http://provisioning.snom.com/config/gui_lang.xml" />
</setting-files>

snom/general.xml – configuration for all you phones

<?xml version="1.0" encoding="utf-8" ?>
<settings>
 <phone-settings>
  <challenge_response perm="&">off</challenge_response>
  <filter_registrar perm="&">off</filter_registrar>
  <guess_number perm="&">off</guess_number>
  <user_phone perm="&">off</user_phone>
  <silence_compression perm="&">off</silence_compression>
  <date_us_format perm="&">off</date_us_format>
  <time_24_format perm="&">on</time_24_format>
  <user_outbound idx="1" perm="$">172.28.1.2</user_outbound>
  <user_host idx="1" perm="$">172.28.1.2</user_host>
  <user_pname idx="1" perm="$"></user_pname>
  <user_active idx="1" perm="$">on</user_active>
  <user_sipusername_as_line idx="1" perm="$">on</user_sipusername_as_line>
  <ntp_server perm="$">172.28.1.2</ntp_server>
  <timezone perm="$">GER+1</timezone>
  <web_language perm="$">Deutsch</web_language>
  <language perm="$">Deutsch</language>
  <tone_scheme perm="$">GER</tone_scheme>
 </phone-settings>
</settings>

Nov configure your Phones to get the Configuration from your Webserver and you are done. Ether use DHCP or edit the phones configuration at Advanced -> Update -> Setting URL:

Save, reboot and you should be done.

Now all Phones

* Are configured automatically
* get nice printed labels
* get a up-to date phonebook

while you yourself have only to edit a single file – snom.txt. This was tested with “Asterisk 1.2.24-BRIstuffed-0.3.0-PRE-1y-k”.