4 posts / 0 new
Last post
EdgeSystems
Hub crash
Request: <code> GET /Spokes/SessionManager/Register?name=UnifiedCommunicator HTTP/1.1 Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: en-SE,* User-Agent: Mozilla/5.0 Host: localhost:32017 </code> Response: <code> HTTP/1.1 200 OK Content-Length: 125 Content-Type: application/json; charset=utf-8 Connection: close {"Description":"","Err":{"Description":"Plugin exists","Error_Code":0,"Type":5},"Type":1,"Type_Name":"Error","isError":true} </code> Request: <code> GET /Spokes/DeviceServices/Info HTTP/1.1 Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: en-SE,* User-Agent: Mozilla/5.0 Host: localhost:32017 </code> Response: <code> HTTP/1.1 200 OK Content-Length: 665 Content-Type: application/json; charset=utf-8 Connection: close {"Description":"Active Device Info","Result":{"BaseFirmwareVersion":"28.47","BaseSerialNumber":"366b26a7c63743898bdc46afb65d510e","BluetoothFirmwareVersion":"02.05.0d, 0e","DevicePath":"HID_Device:vid_047f_pid_ac01_lid_14300000_mi_64_mo_64_mf_16_pu_01_pup_12","HeadsetSerialNumber":"d032c602171d4d50a00b9534a2c13b58","InternalName":"Poseidon","IsAttached":true,"ManufacturerName":"Plantronics","ProductId":44033,"ProductName":"Plantronics Savi 7xx","RemoteFirmwareVersion":"28.25","SerialNumber":"366B26A7C63743898BDC46AFB65D510E","USBVersionNumber":"179","Uid":"c386912c7fa4a04d48217ce7a1d77e44","VendorId":1151},"Type":4,"Type_Name":"DeviceInfo","isError":false} </code> Request: <code> GET /Spokes/DeviceServices/Attach?uid=c386912c7fa4a04d48217ce7a1d77e44 HTTP/1.1 Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: en-SE,* User-Agent: Mozilla/5.0 Host: localhost:32017 </code> Response: <code> HTTP/1.1 200 OK Content-Length: 124 Content-Type: application/json; charset=utf-8 Connection: close {"Description":"Session ID","Result":"c2c105b4cd1a540a4c44ec77bb5cccd4","Type":7,"Type_Name":"SessionHash","isError":false} </code> Request: <code> GET /Spokes/DeviceServices/Events?sess=c2c105b4cd1a540a4c44ec77bb5cccd4&queue=0 HTTP/1.1 Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: en-SE,* User-Agent: Mozilla/5.0 Host: localhost:32017 </code> Response: <code> HTTP/1.1 200 OK Content-Length: 100 Content-Type: application/json; charset=utf-8 Connection: close {"Description":"Device Events","Result":"","Type":6,"Type_Name":"DeviceEventArray","isError":false} </code> Then do: <code> curl 'http://127.0.0.1:32017/Spokes/CallServices/IncomingCall?name=UnifiedCommunicator&callID={%22Id%22:%221%22}&contact={%22Name%22:%22Dummy%20Contact%22}&tones=Unknown&route=ToHeadset&callback=jQuery172006449945214587016_1496243560969&_=1496243570741' -H 'Host: 127.0.0.1:32017' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0' -H 'Accept: */*' -H 'Accept-Language: sv-SE,sv;q=0.8,en-US;q=0.5,en;q=0.3' --compressed -H 'Connection: keep-alive' </code> Crash on 3.9.2 build 1341 The formatting sucks but try to editing the post to see the real requests/responses

lcollins
Hi,

Controlling Hub using curl - interesting idea!
I have prepared some notes below that should help. Please take a look and let me know if it helps or if you have more questions!
Thanks,
Lewis.

----

Integrate Plantronics Hub using curl (https://curl.haxx.se/):
---
Show Device Info:
curl http://127.0.0.1:32017/Spokes/DeviceServices/Info

Attach Device Session (only works if a Plantronics device is attached to PC):
curl http://127.0.0.1:32017/Spokes/DeviceServices/Attach?uid=0123456789
(note: returns a Session ID in Result, for example: 7475678a3e94b060fde90040f8754de8)

Register Plugin (to be done after successful register of Device Session):
curl http://127.0.0.1:32017/Spokes/SessionManager/Register?name=My%20Funky%20Curl%20Demo
(note: returns Result of true for success)

Make headset ring! (tell Plantronics I have an incoming call), here using call id of 1 and contact name (for display device) of Bob Smith:
(note: must put quotes " around the url, because of funny characters)
(note: spaces and other funny characters are url encoded, e.g. space becomes %20, etc)
curl "http://127.0.0.1:32017/Spokes/CallServices/IncomingCall?name=My%20Funky%20Curl%20Demo&callID=%7B%22Id%22%3A%221%22%7D&contact=%7B%22Name%22%3A%22Bob%20Smith%22%7D&tones=Unknown&route=ToHeadset"
(note, the call id of 1 comes after %7B%22Id%22%3A%22 and before %22%7D)

Terminate the call, here using call id of 1:
curl "http://127.0.0.1:32017/Spokes/CallServices/TerminateCall?name=My%20Funky%20Curl%20Demo&callID=%7B%22Id%22%3A%221%22%7D"
(note, the call id of 1 comes after %7B%22Id%22%3A%22 and before %22%7D)

Unregister the Plugin
curl http://127.0.0.1:32017/Spokes/SessionManager/UnRegister?name=My%20Funky%20Curl%20Demo

Release the Device Session
curl http://127.0.0.1:32017/Spokes/DeviceServices/Release?sess=7475678a3e94b060fde90040f8754de8
(note: that was the session from earlier Attach Device Session)

For more URLs to control Hub, refer to the Java sample code (see Java Tab) here: http://developer.plantronics.com/article/get-started-code-samples
---

 

lcollins
In general I don't think you would need the &callback=jQuery... part of the URL if you are operating from curl (rather than a JavaScript application with jQuery)

EdgeSystems
Yeah, I know. Copied the curl request from firefox (your example). I moved on to use spokesSDK instead, now having problem on USB related crash on osx 10.13 (known issue). Waiting for the next release. You can close this errand as I wont be digging deeper into why it crashed.

Add new comment