[Astlinux-users] mod_rewrite for lighttpd
Hi everbody I need a rewrite rule for one of my php applications. mod_rewrite is included in astlinux, but it says (mod_rewrite.c.206) pcre support is missing, please install libpcre and the headers I tried copying libpcre and libpcreposix from a debian i386 package, but that does not make a difference. /oldroot/mnt/asturw/usr/lib/libpcreposix.so.3.12.1 /oldroot/mnt/asturw/usr/lib/libpcreposix.so.3 /oldroot/mnt/asturw/usr/lib/libpcreposix.so /oldroot/mnt/asturw/lib /oldroot/mnt/asturw/lib/libpcre.so.3.12.1 /oldroot/mnt/asturw/lib/libpcre.so.3 /oldroot/mnt/asturw/lib/libpcre.so Anybody knows what I need to do to get mod_rewrite working? Thanks in advance Michael -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
Am 24.02.2012 um 13:16 schrieb Neuer User: Hi everbody I need a rewrite rule for one of my php applications. mod_rewrite is included in astlinux, but it says (mod_rewrite.c.206) pcre support is missing, please install libpcre and the headers I tried copying libpcre and libpcreposix from a debian i386 package, but that does not make a difference. /oldroot/mnt/asturw/usr/lib/libpcreposix.so.3.12.1 /oldroot/mnt/asturw/usr/lib/libpcreposix.so.3 /oldroot/mnt/asturw/usr/lib/libpcreposix.so /oldroot/mnt/asturw/lib /oldroot/mnt/asturw/lib/libpcre.so.3.12.1 /oldroot/mnt/asturw/lib/libpcre.so.3 /oldroot/mnt/asturw/lib/libpcre.so Anybody knows what I need to do to get mod_rewrite working? Thanks in advance Michael It's not enabled by default (size?) But you could build your own AstLinux version and then just enable lighttpd pcre support in menuconfig. If you already have a running Debian, it should be easy for you: http://doc.astlinux.org/devdoc:documentation Michael http://www.mksolutions.info smime.p7s Description: S/MIME cryptographic signature -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
I gave it a try, and both pcre and lighttpd w/pcre builds properly. I did not test mod_rewrite functionality though. May I ask what you need mod_rewrite for ? Would it be of general interest ? I want to provision some aastra phones. The asterisk provisioning system is not very well documented, but from what I understand it does not allow for more diverse configuration files, e.g. different softkeys per phone. So, I would like to use some simple php scripts to generate the configuration files. But for this I need a rewrite rule, because the aastra phones (like all others that I know) use static URLs like http://192.168.0.1/phoneprov/0011223344.cfg I would rewrite this to something like this http://192.168.0.1/phoneprov.php?mac=0011223344 Which a php script can use to generate the configuration file. Whether this is of general interest, I don't know? If you are developing custom PHP stuff, you may as well be building your own custom images. Well yes, that could be an alternative. I would need to setuop the build system and understand how it works. But actually, the mod_rewrite is the only thing I need to change so far. Would it be possible for you to send me the necessary files, if you have already built them? Thanks a lot! Michael Am 24.02.2012 15:02, schrieb Lonnie Abelbeck: It's not enabled by default (size?) But you could build your own AstLinux version and then just enable lighttpd pcre support in menuconfig. If you already have a running Debian, it should be easy for you: http://doc.astlinux.org/devdoc:documentation Michael +1 for what Micheael Keuter stated... It appears BR2_PACKAGE_LIGHTTPD_PCRE automatically selects BR2_PACKAGE_PCRE. == BR2_PACKAGE_LIGHTTPD_PCRE Enable PCRE support. Needed to support mod_rewrite Symbol: BR2_PACKAGE_LIGHTTPD_PCRE [=n] Depends on: BR2_PACKAGE_LIGHTTPD [=y] Location: - Package Selection for the target - Networking applications - lighttpd (BR2_PACKAGE_LIGHTTPD [=y]) Selects: BR2_PACKAGE_PCRE [=n] == Lonnie -- 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/ -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
This would be of great interest to me, since provisioning is something I have not yet tackled. I, too, have been wondering about writing a simple PHP script and Astlinux GUI tab interface. By the way, Snoms can use GET variables for provisioning (use them by default, in fact), so it's not an issue for us. I just haven't found the time, and am not sure I shall. Tom -Original Message- From: Neuer User [mailto:auslands...@gmx.de] Sent: 24 February 2012 14:18 To: astlinux-users@lists.sourceforge.net Subject: Re: [Astlinux-users] mod_rewrite for lighttpd I gave it a try, and both pcre and lighttpd w/pcre builds properly. I did not test mod_rewrite functionality though. May I ask what you need mod_rewrite for ? Would it be of general interest ? I want to provision some aastra phones. The asterisk provisioning system is not very well documented, but from what I understand it does not allow for more diverse configuration files, e.g. different softkeys per phone. So, I would like to use some simple php scripts to generate the configuration files. But for this I need a rewrite rule, because the aastra phones (like all others that I know) use static URLs like http://192.168.0.1/phoneprov/0011223344.cfg I would rewrite this to something like this http://192.168.0.1/phoneprov.php?mac=0011223344 Which a php script can use to generate the configuration file. Whether this is of general interest, I don't know? If you are developing custom PHP stuff, you may as well be building your own custom images. Well yes, that could be an alternative. I would need to setuop the build system and understand how it works. But actually, the mod_rewrite is the only thing I need to change so far. Would it be possible for you to send me the necessary files, if you have already built them? Thanks a lot! Michael Am 24.02.2012 15:02, schrieb Lonnie Abelbeck: It's not enabled by default (size?) But you could build your own AstLinux version and then just enable lighttpd pcre support in menuconfig. If you already have a running Debian, it should be easy for you: http://doc.astlinux.org/devdoc:documentation Michael +1 for what Micheael Keuter stated... It appears BR2_PACKAGE_LIGHTTPD_PCRE automatically selects BR2_PACKAGE_PCRE. == BR2_PACKAGE_LIGHTTPD_PCRE Enable PCRE support. Needed to support mod_rewrite Symbol: BR2_PACKAGE_LIGHTTPD_PCRE [=n] Depends on: BR2_PACKAGE_LIGHTTPD [=y] Location: - Package Selection for the target - Networking applications - lighttpd (BR2_PACKAGE_LIGHTTPD [=y]) Selects: BR2_PACKAGE_PCRE [=n] == Lonnie -- 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/ -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
Am 24.02.2012 um 15:18 schrieb Neuer User: I gave it a try, and both pcre and lighttpd w/pcre builds properly. I did not test mod_rewrite functionality though. May I ask what you need mod_rewrite for ? Would it be of general interest ? I want to provision some aastra phones. The asterisk provisioning system is not very well documented, but from what I understand it does not allow for more diverse configuration files, e.g. different softkeys per phone. So, I would like to use some simple php scripts to generate the configuration files. But for this I need a rewrite rule, because the aastra phones (like all others that I know) use static URLs like http://192.168.0.1/phoneprov/0011223344.cfg I would rewrite this to something like this http://192.168.0.1/phoneprov.php?mac=0011223344 Which a php script can use to generate the configuration file. Whether this is of general interest, I don't know? If you are developing custom PHP stuff, you may as well be building your own custom images. Well yes, that could be an alternative. I would need to setuop the build system and understand how it works. But actually, the mod_rewrite is the only thing I need to change so far. Would it be possible for you to send me the necessary files, if you have already built them? Thanks a lot! Michael You can do the same rewrite in Asterisk phoneprov.conf. I did that already for Yealink phones: [yealink2x] ${MAC}.cfg = yealink/yealink_t2x-mac.cfg staticdir = yealink/ static_file = y.cfg You need to change the dnsmasq config to redirect the TFTP server to the Asterisk directory. In this example the Yealink T28P uses a general y000…cfg and a MAC-specific MAC.cfg The standard settings for the phone are taken from users.conf. But no softkeys etc. But you can at least do the file redirection. Michael http://www.mksolutions.info smime.p7s Description: S/MIME cryptographic signature -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
Am 24.02.2012 15:41, schrieb Michael Keuter: You can do the same rewrite in Asterisk phoneprov.conf. I did that already for Yealink phones: [yealink2x] ${MAC}.cfg = yealink/yealink_t2x-mac.cfg staticdir = yealink/ static_file = y.cfg You need to change the dnsmasq config to redirect the TFTP server to the Asterisk directory. In this example the Yealink T28P uses a general y000…cfg and a MAC-specific MAC.cfg The standard settings for the phone are taken from users.conf. But no softkeys etc. But you can at least do the file redirection. Yes, I have that working at the moment. But it is much too basic, as there is no phone specific softkey configuration or other useful options except the very basic username, password etc. settings. That's why I would like to use php instead. Michael 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/ -- 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.
[Astlinux-users] AstLinux 1.0.2 coming soon
I'm uploading images for the 1.0.2 release. The official release announcement and web page will be published later today. Just wanted to give our users the early notification since this version will be immediately available from the upgrade utility (web or cli) after the upload finishes. Darrick -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
On Feb 24, 2012, at 8:18 AM, Neuer User wrote: I want to provision some aastra phones. The asterisk provisioning system is not very well documented, but from what I understand it does not allow for more diverse configuration files, e.g. different softkeys per phone. So, I would like to use some simple php scripts to generate the configuration files. But for this I need a rewrite rule, because the aastra phones (like all others that I know) use static URLs like http://192.168.0.1/phoneprov/0011223344.cfg I would rewrite this to something like this http://192.168.0.1/phoneprov.php?mac=0011223344 Which a php script can use to generate the configuration file. Question, why not run your PHP script that would generate .cfg files for *all* phones in static files where the phones expect ? Lonnie -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
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-nametftp://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 On 2/24/12 11:49 AM, Lonnie Abelbeck li...@lonnie.abelbeck.com wrote: On Feb 24, 2012, at 8:18 AM, Neuer User wrote: I want to provision some aastra phones. The asterisk provisioning system is not very well documented, but from what I understand it does not allow for more diverse configuration files, e.g. different softkeys per phone. So, I would like to use some simple php scripts to generate the configuration files. But for this I need a rewrite rule, because the aastra phones (like all others that I know) use static URLs like http://192.168.0.1/phoneprov/0011223344.cfg I would rewrite this to something like this http://192.168.0.1/phoneprov.php?mac=0011223344 Which a php script can use to generate the configuration file. Question, why not run your PHP script that would generate .cfg files for *all* phones in static files where the phones expect ? Lonnie -- 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/
Re: [Astlinux-users] mod_rewrite for lighttpd
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-nametftp://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.
Re: [Astlinux-users] mod_rewrite for lighttpd
Am 24.02.2012 17:49, schrieb Lonnie Abelbeck: Question, why not run your PHP script that would generate .cfg files for *all* phones in static files where the phones expect ? Lonnie Nice idea. The only issue I might have with this is that as soon as you want to change something you would always need to rewrite all config files. Still, it is doable. Might be a way to do it. Michael -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
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-nametftp://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
Re: [Astlinux-users] mod_rewrite for lighttpd
Am 24.02.2012 18:20, schrieb Chris Abnett: Here is an example[...] Thanks for sharing. I was planning to do more or less exactly the same. Maybe, except that I wouldn't ask for the extension number on the phone, but require that the extensions are pre-setup on asterisk with the special addition of the phone type being set in the MAC field. When the phone registers via the action URI I would compare the phone type and take the next predefined extension with the same phone type. What do you do if you want to change e.g. a softkey for all phones in a call group? Do you loop through all registered phones and re-generate all config files? Michael -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
Am 24.02.2012 22:03, schrieb Michael Keuter: Just for curiosity: how many phones do you use with your Astlinux box? Michael I am preparing this for a client who has some 10-20 phones in use. So, still pretty doable. Don't know, if an installation with 400 phones (and thus 400 configuration files) would still be feasible, though... -- 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.
Re: [Astlinux-users] mod_rewrite for lighttpd
If I change buttons on phones I run a generation script that creates new configs for phones and then also sends the changes on-the-fly to the phones via the configuration change XML object.. This works great for buttons, or other preference settings that arent part of the network or SIP stack... The way it works.. When a phone registers as an extension I update the asterisk database with its type, MAC, and IP.. So when it comes time to regenerate config files I have a reference for all of the above and can send updates on the fly to the sets.. This makes it as close to a legacy PBX as possible for the users who don¹t like rebooting phones just because a speed dial was added or deleted.. The users have acloud based GUI to add / delete / change buttons on their sets.. Which then triggers some scripts on the site asterisk system/ Other settings such as the SIP settings, phone dialplan, etc are set in the config file and not editable by the user... Granted we are going beyond astlinux here but ,any of the concepts apply... -Christopher On 2/24/12 3:53 PM, Neuer User auslands...@gmx.de wrote: Am 24.02.2012 18:20, schrieb Chris Abnett: Here is an example[...] Thanks for sharing. I was planning to do more or less exactly the same. Maybe, except that I wouldn't ask for the extension number on the phone, but require that the extensions are pre-setup on asterisk with the special addition of the phone type being set in the MAC field. When the phone registers via the action URI I would compare the phone type and take the next predefined extension with the same phone type. What do you do if you want to change e.g. a softkey for all phones in a call group? Do you loop through all registered phones and re-generate all config files? Michael -- 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.