import requests
auth = requests.auth.HTTPDigestAuth('username','password')
response = requests.put('http://server_ip_address/sipxconfig/api/phones/phone_mac_address/sendProfiles/restart', auth=auth, verify=False')
print('%s - %s' % (response.status_code, response.reason))
print(response.text)
'500 - Server Error'
'javax.ws.rs.ClientErrorException: HTTP 405 Method Not Allowed'
--
You received this message because you are subscribed to the Google Groups "sipxcom-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sipxcom-user...@googlegroups.com.
To post to this group, send email to sipxco...@googlegroups.com.
Visit this group at https://groups.google.com/group/sipxcom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/sipxcom-users/7e408f01-5141-4357-ba5a-d495fbdeab0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/sipxcom-users/30eab9bb-951f-4e28-9c53-598fd1b6b9b8%40googlegroups.com.
"2018-09-14T19:07:16.585000Z":2971:JAVA:WARNING:server_fqdn:qtp1030903484-20:00000000:LoggerListener:"Authentication event AuthenticationSuccessEvent: username; details: org.sipfoundry.sipxconfig.security.SipxAuthenticationDetails@166c8: RemoteIpAddress: ip_of_client_sending_request; SessionId: 1ackxo4zhtnz5fj0yl6exthb4"
"2018-09-14T19:07:16.587000Z":2972:JAVA:INFO:server_fqdn:qtp1030903484-20:00000000:LoggingInInterceptor:"Inbound Message\n----------------------------\nID: 87\nAddress: http://sipx_server_ip/sipxconfig/api/phones/0004f248a519/sendProfile/restart\nHttp-Method: GET\nContent-Type: \nHeaders: {Accept=[*/*], accept-encoding=[gzip, deflate], Authorization=[Digest username=\"username\", realm=\"sip_fqdn\", nonce=\"MTUzNjk1MjA0NjUwNzo0ZjRiNTY5NmM5YWIyYzdjNTQwNTViZmFkZGQzNjI2Nw==\", uri=\"/sipxconfig/api/phones/0004f248a519/sendProfile/restart\", response=\"cb1c69723f031c131ca62b6f9f8a2d3b\", qop=\"auth\", nc=00000001, cnonce=\"e992c904797b78c8\"], connection=[keep-alive], Content-Type=[null], Cookie=[JSESSIONID=1ackxo4zhtnz5fj0yl6exthb4], Host=[sipx_server_ip], User-Agent=[python-requests/2.18.4], X-Forwarded-For=[ip_of_client_sending_request], X-Forwarded-Host=[sipx_server_ip], X-Forwarded-Server=[server_fqdn]}\n--------------------------------------"
"2018-09-14T19:07:16.588000Z":2973:JAVA:WARNING:server_fqdn:qtp1030903484-20:00000000:JAXRSUtils:"No operation matching request path \"/sipxconfig/api/phones/0004f248a519/sendProfile/restart\" is found, Relative Path: /0004f248a519/sendProfile/restart, HTTP Method: GET, ContentType: */*, Accept: */*,. Please enable FINE/TRACE log level for more details."
"2018-09-14T19:07:16.592000Z":2974:JAVA:INFO:server_fqdn:qtp1030903484-20:00000000:LoggingOutInterceptor:"Outbound Message\n---------------------------\nID: 87\nResponse-Code: 500\nContent-Type: text/xml\nHeaders: {Content-Type=[text/xml], Date=[Fri, 14 Sep 2018 19:07:16 GMT]}\nPayload: javax.ws.rs.ClientErrorException: HTTP 405 Method Not Allowed\n--------------------------------------"
To view this discussion on the web visit https://groups.google.com/d/msgid/sipxcom-users/3248149f-0bfb-4dde-8fbf-6fc8b7812fb3%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sipxcom-users/f32eaf0a-e10b-418e-9f59-26e763590788%40googlegroups.com.
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): sipx_server_fqdnsend: b'PUT /sipxconfig/api/phones/0004f248a519/sendProfile/restart HTTP/1.1\r\nHost: sipx_server_fqdn\r\nUser-Agent: python-requests/2.18.4\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n'reply: 'HTTP/1.1 302 Found\r\n'
DEBUG:urllib3.connectionpool:http://sipx_server_fqdn:80 "PUT /sipxconfig/api/phones/phonemac/sendProfile/restart HTTP/1.1" 302 335
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): sipx_server_fqdn/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)header: Date header: Server header: Location header: Content-Length header: Connection header: Content-Type send: b'GET /sipxconfig/api/phones/phonemac/sendProfile/restart HTTP/1.1\r\nHost: sipx_server_fqdn\r\nUser-Agent: python-requests/2.18.4\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n'reply: 'HTTP/1.1 401 An Authentication object was not found in the SecurityContext\r\n'
DEBUG:urllib3.connectionpool:https://sipx_server_fqdn:443 "GET /sipxconfig/api/phones/phonemac/sendProfile/restart HTTP/1.1" 401 442
DEBUG:urllib3.connectionpool:Resetting dropped connection: sipx_server_fqdn/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)header: Date header: Server header: Access-Control-Allow-Credentials header: Access-Control-Allow-Methods header: Access-Control-Max-Age header: Access-Control-Allow-Headers header: WWW-Authenticate header: Content-Type header: Cache-Control header: Content-Length header: Set-Cookie header: Connection send: b'GET /sipxconfig/api/phones/phonemac/sendProfile/restart HTTP/1.1\r\nHost: sipx_server_fqdn\r\nUser-Agent: python-requests/2.18.4\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nCookie: JSESSIONID=iv8ovrwvt1zfda9alm39kufc\r\nAuthorization: Digest username="username", realm="sip_fqdn", nonce="MTUzNjk1NDEwMDY5NzoyYzc1YjYxMDc3NDIwOTk0NDk1Yjg5ZWMwZWE5OGI3MA==", uri="/sipxconfig/api/phones/phonemac/sendProfile/restart", response="0a02e42187c4bb33d57be4838635027f", qop="auth", nc=00000001, cnonce="1ccc29d2e521b727"\r\n\r\n'reply: 'HTTP/1.1 500 Server Error\r\n'
To view this discussion on the web visit https://groups.google.com/d/msgid/sipxcom-users/7fe2d53c-0a8a-4f61-a817-0e99902fa1dd%40googlegroups.com.