Plantronics + Polycom. Now together as Poly Logo

Api to get the logs from the phone

SOLVED
nitin_k29
Occasional Contributor

Api to get the logs from the phone

Hi,

I am trying to automate the polycom phone to make calls, accept calls and chnage settings. The phone info is given below

hone Model SoundStation IP 6000
Part Number 3111-15600-001 Rev:U
MAC Address 00:04:F2:F6:F6:7B
IP Address 10.198.32.96
UC Software Version 4.0.11.0583
BootROM Software Version 5.0.1.10553

 

I am able to do all that but I also want to read the logs using a curl command or a python script. I am unable to get the logs from the phone. Below is what i have already tried

1. Using curl command

curl "http://10.198.32.96/Diagnostics/log" --digest -u Admin:456 -H "Authorization: Basic UG9seWNvbTo0NTY=" -d "value=app&dummyParam=1524656164154"

 

I am getting below result

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head><title>405 Method Not Allowed</title></head><body>
</body></html>

 

2. I also tried using Postman tool and tried writing a python script for the same but everytime I am getting a 401 unauthorized error. Below is the snippet

urls = {"login": "http://10.198.32.96/auth.htm?t=Thu,%2026%20Apr%202018%2007:35:57%20GMT",
"logs": "http://10.198.32.96/Diagnostics/log"}
data = {"logs": {"value": "app","dummyParam": "1524728332337"}}
header = {"Authorization": "Basic UG9seWNvbTo0NTY="}
r_login = requests.get(urls['login'], headers=header)
print r_login     #### 200 OK
print r_login.headers
r_log = requests.get(urls['logs'], headers=header.update(r_login.headers), data = data["logs"])
print r_log        ##### 401 unauthorized
print r_log.headers

 

Please, help me in reading the log file.

Message 1 of 3
1 ACCEPTED SOLUTION

Accepted Solutions
nitin_k29
Occasional Contributor

Re: Api to get the logs from the phone

Hello Steffen,

Thanks for your reply.

There was a typo in my attempts thats why it was not working. I fixed that and both the mentioned methods started working.

I am sharing the complete curl command for other community users to use

curl "http://10.198.32.96/Diagnostics/log?value=app&dummyParam=1524829265456" -H "Cookie: Authorization=Basic UG9seWNvbTo0NTY="

--Nitin

View solution in original post

Message 3 of 3
2 REPLIES 2
SteffenBaierUK
Polycom Employee & Community Manager

Re: Api to get the logs from the phone

Hello @nitin_k29,

welcome to the Polycom Community.

The actual file buffer for the log is very small especially on a SSIP.

 

Why not simply log to an FTP server and allow to append the file and always have access to the latest logs once uploaded ?

 

You can amend the Upload Period to make this happen more frequent.


Please ensure to provide some feedback if this reply has helped you so other users can profit from your experience.

Best Regards

Steffen Baier

Polycom Global Services

----------------
The title Polycom Employee & Community Manager is a community setting and does not reflect my role. I am just a simple volunteer in the community like everybody else. My official "day" Job is 3rd Level support at Poly but I am unable to provide official support via the community.

----------------

Notice: This community forum is not an official Poly support resource, thus responses from Poly employees, partners, and customers alike are best-effort in attempts to share learned knowledge. If you need immediate and/or official assistance please open a service ticket through your proper support channels.
Please also ensure you always check the VoIP , Video Endpoint , Skype for Business , PSTN or RPM FAQ's
Message 2 of 3
nitin_k29
Occasional Contributor

Re: Api to get the logs from the phone

Hello Steffen,

Thanks for your reply.

There was a typo in my attempts thats why it was not working. I fixed that and both the mentioned methods started working.

I am sharing the complete curl command for other community users to use

curl "http://10.198.32.96/Diagnostics/log?value=app&dummyParam=1524829265456" -H "Cookie: Authorization=Basic UG9seWNvbTo0NTY="

--Nitin

View solution in original post

Message 3 of 3