Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] OT - How to configure Apache2 server to receive Polycom log files ?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
oza.4h07 at gmail.com
Guest





PostPosted: Mon Jun 16, 2014 8:52 am    Post subject: [asterisk-users] OT - How to configure Apache2 server to rec Reply with quote

Hello,


To troubleshoot Polycom phone provisionning (with an asterisk 11 box), I'm looking to enable HTTP log file upload ie the capability for Polycom phones to upload some data to a given HTTP server.


At the moment, Polycom phones are downloading config files from an Apache2 HTTP server, thanks to a DHCP  server configuration option bellow.
option tftp-server-name "http://192.168.64.250/polycom";


Looking at Apache2 log files, I can see that Polycom phones are trying to upload log files but every attempt to upload data (fails with 405 error, no matter how I configured target upload directory ownership. See:


192.168.64.215 - - [16/Jun/2014:15:25:03 +0200] "PUT /polycom/log/0004f2394356-boot.log HTTP/1.1" 405 582 "-" "FileTransport PolycomSoundPointIP-SPIP_650-UA/4.3.0.0246"



Has someone successfully received Polycom file uploads with an HTTP server (ie without using FTP) or is it something can't simply be done ?

If positive, can you share key configuration settings ?


Regards
Back to top
stepan.hradsky at ha-v...
Guest





PostPosted: Tue Jun 17, 2014 7:51 am    Post subject: [asterisk-users] OT - How to configure Apache2 server to rec Reply with quote

Hi,

I have this configuration in apache site configuration

<Directory /home/prov/polycom>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} =PUT [OR]
RewriteCond %{REQUEST_METHOD} =HEAD
RewriteRule ^(.*)$ put.php?url=$1
</Directory>

this redirect PUT method to put.php script which read input and write to file in logs directory.

and this is file put.php:
<?php

/* PUT data comes in on the stdin stream */
$putdata = fopen("php://input", "r");

$mode="w";
/* Open a file for writing */
$file=basename($_SERVER['REQUEST_URI']);
if (substr($file,-3)!='cfg' and substr($file,-3)!='xml') {
if (!is_dir("logs")) mkdir("logs");
$file="logs/$file";
$mode="a";
}
$fp = fopen($file, $mode);

/* Read the data 1 KB at a time and write to the file */
while ($data = fread($putdata, 1024)) fwrite($fp, $data);

/* Close the streams */
fclose($fp);
fclose($putdata);
?>

BR
Stepan

Dne 16.6.2014 15:51, Olivier napsal(a):

Quote:
Hello,


To troubleshoot Polycom phone provisionning (with an asterisk 11 box), I'm looking to enable HTTP log file upload ie the capability for Polycom phones to upload some data to a given HTTP server.


At the moment, Polycom phones are downloading config files from an Apache2 HTTP server, thanks to a DHCP server configuration option bellow.
option tftp-server-name "http://192.168.64.250/polycom";


Looking at Apache2 log files, I can see that Polycom phones are trying to upload log files but every attempt to upload data (fails with 405 error, no matter how I configured target upload directory ownership. See:


192.168.64.215 - - [16/Jun/2014:15:25:03 +0200] "PUT /polycom/log/0004f2394356-boot.log HTTP/1.1" 405 582 "-" "FileTransport PolycomSoundPointIP-SPIP_650-UA/4.3.0.0246"



Has someone successfully received Polycom file uploads with an HTTP server (ie without using FTP) or is it something can't simply be done ?

If positive, can you share key configuration settings ?


Regards




--
S pozdravem / with kind regards

Štěpán Hradský

oddělení specialistů hlasových služeb / voice department

ha-vel internet s.r.o.

Olešní 587/11A
712 00 Ostrava Muglinov
Czech Republic

T +420 552 305 370/ F +420 552 305 306
Hotline: +420 552 305 321
http://www.ha-vel.cz
Back to top
oza.4h07 at gmail.com
Guest





PostPosted: Wed Jun 25, 2014 4:44 am    Post subject: [asterisk-users] OT - How to configure Apache2 server to rec Reply with quote

Thanks for sharing this.

I'll give it a try ASAP and post my comments here.


Thanks again.



2014-06-17 14:51 GMT+02:00 Stepan Hradsky <stepan.hradsky@ha-vel.cz (stepan.hradsky@ha-vel.cz)>:
Quote:
Hi,

I have this configuration in apache site configuration

        <Directory /home/prov/polycom>
                RewriteEngine On
                RewriteCond %{REQUEST_METHOD} =PUT [OR]
                RewriteCond %{REQUEST_METHOD} =HEAD
                RewriteRule ^(.*)$ put.php?url=$1
        </Directory>

this redirect PUT method to put.php script which read input and write to file in logs directory.

and this is file put.php:
<?php

/* PUT data comes in on the stdin stream */
$putdata = fopen("php://input", "r");

$mode="w";
/* Open a file for writing */
$file=basename($_SERVER['REQUEST_URI']);
if (substr($file,-3)!='cfg' and substr($file,-3)!='xml') {
        if (!is_dir("logs")) mkdir("logs");
        $file="logs/$file";
        $mode="a";
}
$fp = fopen($file, $mode);

/* Read the data 1 KB at a time  and write to the file */
while ($data = fread($putdata, 1024)) fwrite($fp, $data);

/* Close the streams */
fclose($fp);
fclose($putdata);
?>

BR
Stepan

Dne 16.6.2014 15:51, Olivier napsal(a):

Quote:
Hello,


To troubleshoot Polycom phone provisionning (with an asterisk 11 box), I'm looking to enable HTTP log file upload ie the capability for Polycom phones to upload some data to a given HTTP server.


At the moment, Polycom phones are downloading config files from an Apache2 HTTP server, thanks to a DHCP  server configuration option bellow.
option tftp-server-name "http://192.168.64.250/polycom";


Looking at Apache2 log files, I can see that Polycom phones are trying to upload log files but every attempt to upload data (fails with 405 error, no matter how I configured target upload directory ownership. See:


192.168.64.215 - - [16/Jun/2014:15:25:03 +0200] "PUT /polycom/log/0004f2394356-boot.log HTTP/1.1" 405 582 "-" "FileTransport PolycomSoundPointIP-SPIP_650-UA/4.3.0.0246"



Has someone successfully received Polycom file uploads with an HTTP server (ie without using FTP) or is it something can't simply be done ?

If positive, can you share key configuration settings ?


Regards




--
S pozdravem / with kind regards

Štěpán Hradský

oddělení specialistů hlasových služeb / voice department

ha-vel internet s.r.o.

Olešní 587/11A
712 00 Ostrava Muglinov
Czech Republic

T [url=tel:%2B420%20552%20305%20370]+420 552 305 370[/url]/ F [url=tel:%2B420%20552%20305%20306]+420 552 305 306[/url]
Hotline: [url=tel:%2B420%20552%20305%20321]+420 552 305 321[/url]
http://www.ha-vel.cz


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services