You are correct I hadnt done this on any of my astlinux boxes..  But I was
thinking you had dhcpd in the build stream..  Although I havent looked at
build options in a while... Buildroot broke for me a bit back when I
upgraded the fedora on my dev server.. Not sure why I thought it was
there(dhcpd)... I work on so many different things I think my mind is a
DHCP server sometimes just handing out addresses lol...

The one thing to remember about my setup is that in your MAC.cfg files you
explicitly blank out or specify a new action uri startup:  in my case I
have all phones run a script on startup "getlights" that makes sure any
activated feature buttons..  (cover / forward) etc that have LED commands
will restore to their previous values.. Another thought to note is have
the DHCP server be the LAST process to start up after a failure, thus
making sure the phones don’t appear to be working or cant DL their data as
they almost always boot first after a power failure... I want the PBX up
before the phones can come online.. The easiest way is preventing DHCP
till you are ready for them...  Helps to avoid support calls after a
system failure.. An orderly reboot sends sip notifies to them all just
after stopping the DHCP server... So a PBX reboot includes endpoint
reboots... Perhaps overkill but seems to help
-Christopher

On 2/24/12 2:10 PM, "Michael Keuter" <li...@mksolutions.info> wrote:

>
>Am 24.02.2012 um 19:52 schrieb Lonnie Abelbeck:
>
>> 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
>
>Yes, it can, example:
>
>dhcp-mac=snom,00:04:13:*:*:*
>dhcp-option=snom,option:tftp-server,"http://192.168.1.2:8088/phoneprov/sno
>m-{mac}.xml"
>dhcp-mac=yealink,00:15:65:*:*:*
>dhcp-option=yealink,option:tftp-server,"http://192.168.1.2:8088/phoneprov/
>"
>
>> 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
>> Astlinux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/astlinux-users
>> 
>> Donations to support AstLinux are graciously accepted via PayPal to
>>pay...@krisk.org.
>
>
>Michael
>
>http://www.mksolutions.info
>
>
>
>
>--------------------------------------------------------------------------
>----
>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
>Astlinux-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/astlinux-users
>
>Donations to support AstLinux are graciously accepted via PayPal to
>pay...@krisk.org.



------------------------------------------------------------------------------
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
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to