Hi Chris,

Thanks for sharing!

But to be clear, you are not doing this on AstLinux, correct?

While almost everything in your system would work in AstLinux, the missing 
piece is setting "option tftp-server-name" special for Aastra MAC addresses.  
We use dnsmasq and I'm not sure if our "/mnt/kd/dnsmasq.static" could be edited 
in such a way to support the same kind of MAC conditional logic.

Or, maybe I'm missing something.

Thanks again...

Lonnie


On Feb 24, 2012, at 11:20 AM, Chris Abnett wrote:

> I do exactly this..  I wrote a script that when a new phone enters the
> system..  The static aastra.cfg file tells the phone to go grab a default
> PHP script that basically makes the phone say "enter you extension"... You
> type the extension and hit OK..  This calls my phone register script
> sending the extension number as an argument..  By using the HTTP headers I
> grab the phone type and the MAC address of the phone..  Generate a config
> file and push back a reboot request to the phone...
> The phone then reboots and grabs the config from the server..  The server
> parameters are given to the phone by DHCP..  In my dhcpd.conf I have set
> up where I send different options to different types of devices based on
> their macs...
> 
> The trick is you place an aastra.cfg file on the server and make DHCP give
> out the server location for the phone to go.. This way it is zero-config
> out of the box for a new phone...
> 
> I wrote my own set of auto-config scripts mainly because I found the
> provided ones to be convoluted and didn¹t work in the way I wanted...
> 
> 
> 
> I use lighttpd for the web server and all works great.
> 
> Here is an example of how I grab the phone's type and MAC address...  By
> grabbing the type I can generate the correct type of key buttons
> dependant on the type of set they have.. Ie softkey vs prgkey
> 
> 
> 
> # get extension from URL if sent
> if (array_key_exists('user',$_GET)) {
>   $extension =$_GET['user'];
> } else {
>   $extension = NULL;
> }
> 
> 
> ## get user agent info from web server
> $user_agent_raw = $_SERVER["HTTP_USER_AGENT"];
> #decode our HTTP header
> $ffr = decode_header($user_agent_raw);
> 
> 
> 
> 
> #####################################################################
> # decode_header() 
> # 
> # Returns an array
> #       0 Phone Type
> #       1 Phone MAC Address
> #       2 Phone firmware version
> #####################################################################
> function decode_header($user_agent)
> { 
> testlog($user_agent);
> # $user_agent="Aastra6731i MAC:00-08-5D-26-17-78 V:2.6.0.66-SIP";
> if(stristr($user_agent,"Aastra")) {
>  $value=preg_split("/ MAC:/",$user_agent);
>  $fin=preg_split("/ /",$value[1]);
>  $value[1]=preg_replace("/\-/","",$fin[0]);
>  $value[2]=preg_replace("/V:/","",$fin[1]);
> } else { 
>  $value[0]="MSIE";
>  $value[1]="NA"; 
>  $value[2]="NA"; 
> }
> $value[3]=$_SERVER["REMOTE_ADDR"];
> return $value; 
> }
> 
> 
> ******
> Here is a snippet from my dhcpd.conf on how I tell DHCP to send options
> based on MAC
> 
> # tftp for Aastra sets is special, otherwise use GUI value
> if substring(hardware,1,3) = 00:08:5D {
> option tftp-server-name        "tftp://192.168.10.5/aastra/";;
> 
> }
> 
> ******
> 
> And finally my aastra.cfg file..  This file is checked by every phone on
> bootup, however data in a MAC.cfg takes precedence over data in this
> file..  So you can leave it on the server all the time and put a different
> action uri startup in your MAC.cfg or blank it out..  So then the phones
> will only go to your newphone script once when they are default or are
> missing a config on the server
> 
> # Setup DHCP mode
> dhcp: 1
> lldp: 0
> download protocol: TFTP
> time server disabled: 1
> time server1:
> time server2:
> time server3:
> contact rcs: 0
> action uri startup: http://10.11.12.13/aastra/newphone.php?user=none
> 
> 
> 
> 
> -Christopher

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Astlinux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
[email protected].

Reply via email to