Here is some code/mini apps I though I might share with the community, my aim is to make several such guides/lessons on interesting subjects pertaining to asterisk/voip that will help the community grow and make others have less grief rolling out future voip installs. (There is nothing like ripping out a Nortel/Meridian and replacing it with * and know it will work (well at least until someone else fiddles with it) )
Advanced provisioning techniques and steps toward more autonomous installations: part 1 ---------------------------------------- The purpose of this lesson is to show/provide help for provisioning larger asterisk sites with large amounts of network configurable phones. (if anyone wants to add comment, critique , please let me know :-) it helps me write better documents, don't bash to hard it's a first revision) This is in by no means a beginners guide, and assumes you have a basic understanding of asterisk, mysql and can move your way around a linux command line interface Step 1 Create a database table to hold the mac addresses and device identifier (cut and paste this on for ease) my preference is to use mysql but any sql flavour should do ---- snip this--- CREATE TABLE localdevices ( mac varchar(12) NOT NULL default '', devid varchar(20) NOT NULL default '', UNIQUE KEY mac (mac) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='table to hold local mad ids/devices'; -----end snip--- *Note we make mac a unique key so that if we want to run it several times or stick it on a cronjob (as to keep an up to date list of macs), it will simple not insert mac addresses that are already in the table. Step 2 Copy the attached script to a directory of your choice. Step 3 Edit the file and change the appropriate variables (I've commented them as clear as I can :-) ) Step 4 (Assuming before running this that all your phones are plugged into the LAN) chmod +x the script and run it. * note this may take several minutes based on your network range you have chosen (if you want to run the script and not have it insert into a database , remove the "| $dbstring" from the command in the script) Step 5 Check your database table and you'll notice it will have quite a nice selection of entries. Devid is derived from the nmap mac database of know manufacturers (the first 3 groups of numbers on a mac identify the manufacturer) an example of why this is great (scenario, single network segment with mixed devices that you just installed 24 Polycom phones and 50 Aastra phones on) we can simply use the script to see all the macs that belong to Polycom and Aastra phones by the devid field and run an app that creates xml configs for all the Aastra phones and all the Polycom phones. Step 6 Create a mass provisioning script or individual php extensions admin page for provisioning the individual phones now. How to create Mass Provisioning tools and individual provision php pages will be in my next lesson email > advanced provisioning techniques and steps toward more autonomous installations: part 2 :-) Regards, Philip Mullis
<<attachment: macsnoop.zip>>
