FreePBX Provision

Update – 9/13/2011 – All links and files have been removed as this project is becoming commercial.

Please contact sales@multitelusa.com for details.


How does it work?

In the previous versions (not available online), there were separate tables with mac addresses, sip accounts, sip servers, etc. That was kind of a slow painfully process. I found myself updating the password in FreePBX/Extensions and then having to write it in the provision system one more time.

Enters the new system: all information is taken from the sip/users/etc tables.

So all you need to do is to add your mac address on the corresponding extension, as pictured below:

You would need to define it in this format:

0004f201c8d3:1 where “:1″ means the line number.

You can define as many extensions (for 10 extensions you would have this format :     mac-address:10) you want.

Devices tested and found to be working:

Sipura/Linksys :

- PAP2
- PAP2T
- SPA-2002
- SPA-2100
- SPA-2102
- SPA-901
- SPA-941
- SPA-942
- SPA-962
- SPA-3000
- WRP400

Polycom: *

- SoundPoint IP500
- SoundPoint IP350
- SoundPoint IP4000

(*) – I could not yet make the messages button work. You can select the line but it will not dial *97.

Cisco:

- work in progress for 7940/7960

Grandstream:

- work in progress

Installation instructions:

Latest version: (post updated may 14, 2010)

<link removed>

Short instructions:

mkdir /work
cd /work
wget <link removed>

tar xvfz wedovoice-freepbx-provision-04-27-10.tgz
cd wedovoice-freepbx-provision
sh install.sh

This will install everything for you.

Older version:


Download this patched tftp-hpa server:

wget <link removed>

Or locally:

wget <link removed>

Next, extract it:

bzip2 -d tftp-hpa-0.48-executerule.tar.bz2
tar xvf tftp-hpa-0.48-executerule.tar
cd tftp-hpa-0.48-executerule/

Configure it:

./configure ; make ; make install

Download a init.d style startup script:
wget <link removed>

Copy it to /etc/init.d

# chmod +x /etc/init.d/rc.tftpd

Add user and group for tftpd daemon:

# useradd -d /tftpboot/ -s /sbin/nologin -u 500 -g 500 tftpd
# groupadd  -g 500 tftpd

Get the tftp remap rules file

wget <link removed>

Copy it to /etc/tftpd.remap

Now start your tftpd daemon :
# /etc/init.d/rc.tftpd start

To make it start every time you reboot:

[root@freepbx scripts]# chkconfig –level 345 tftpd on
service tftpd does not support chkconfig
[root@freepbx scripts]#

Since its not working with chkconfig (nor I will invest time in making it work with chkconfig) , you will just have to edit /etc/rc.local and add this line:

# /etc/init.d/rc.tftpd start

Next, download this :

wget <link removed>

Unarchive it in your / folder:

# tar xvfz tftp.tgz -C /

Grant +x permission for all needed files:

# cd /scripts/ ; chmod +x directory.php mk* bin/*

Next, get the required sql tables:

# wget <link removed>

Import it into your asterisk database:

# mysql asterisk < provision.sql

This will create these tables (comments below):

mysql> show tables like ‘provision%’;
+——————————————-+
| Tables_in_asterisk (provision%)      |
+——————————————-+
| provision_config                 # should be used in next version
| provision_log                       # logs when last provision was made
| provision_regex                  # not in use yet
| provision_registrars          # not in use yet
| provision_servers               # used for provision details -dns/ip/protocol/rule
+——————————————-+
5 rows in set (0.00 sec)

mysql>

How to use it:

Sipura/Linksys:
On your Sipura/Linksys ATA , dial * * * * 1 1 0 #
The prompt will tell you the device’s IP address. Let’s assume its 192.168.4.2

Point your brower to:

http://192.168.4.2/admin/resync?tftp://your-server-ip/init.cfg

If its a SPA94X or SPA96X , you will just press the ‘Menu’ button and choose ‘9 – Network’  and find out the ip address. Then use the same url i gave you above:

http://192.168.4.2/admin/resync?tftp://your-server-ip/init.cfg
If its polycom, go to Menu, Settings, Advanced, (put your password), Admin settins, Network Configuration , Server Menu and do the following changes:

- Server Type: TrivialFTP
- Server Address : your-servers-ip-address

Attention:

If your phone is a polycom, your firmware will be changed to:

# cat tftpboot/polycom/common/sip.ver
1.6.7.0094 for 11402_001
1.6.7.0098 for all other platforms

I make no warranties as of what the effect will be on your Polycom phone.

Also, by following the instructions on this page and downloading this software you agree that everything you’re doing is at your own risk and you will not hold us liable for any looses (of any kind) that could occur because of the use of this software. This software is listed on this web-page ‘as-is’.  We hold the copyright for it. You are free to use it for any non-commercial purpose. If you choose to modify it, you agree to send us back whatever changes you’ve made so we can distribute it to whoever is interested in it.

I think this is / should be licensed as GNU or BSD Licence.

Next version will be posted whenever I finish it (check back next week).
I will add Cisco and Grandstream support.

Grandstream support added (March 15/2010) . Cisco support still remains to be written.

You will need to create a new folder:

mkdir -p /tmp/bulk-configs/grandstream

chmod -R goa+rwx /tmp/bulk-configs/grandstream

All other files are already added to the same tftp.tgz archive. Included: the Grandstream file encoder (taken from their website). (after you unpack the archive it will be in /scripts/bin/grandstream

Please add your comments/ideas/improvements below. Thank you!

PS: you should also be running your own NTP server (devices are setup to use your IP address as SNTP serve)

4 Comments »

 
  • Thanks for this post, answers a bunch of questions I was having.

  • Does my mac adresse change if I upgrade my computer with some other hardware? For example change the graphic card?

  • Dan says:

    I don’t think so. Maybe if you change your network card or your motherboard (if your nic is embedded). Anyway, what does this have to do with this provisioning system? :)

  • anna laser tandblekninng says:

    anna laser tandblekninng…

    [...]l Some great info from you here. I’ll be adding this to twitter. Have a nice l0[...]…

 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>