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
<span style="font-family:courier new,courier,monospace;">Hi,<br /> <br /> Controlling Hub using curl - interesting idea!<br /> 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!<br /> Thanks,<br /> Lewis.<br /> <br /> ----<br /> <br /> Integrate Plantronics Hub using curl (https://curl.haxx.se/):<br /> ---<br /> Show Device Info:<br /> curl http://127.0.0.1:32017/Spokes/DeviceServices/Info<br /> <br /> Attach Device Session (only works if a Plantronics device is attached to PC):<br /> curl http://127.0.0.1:32017/Spokes/DeviceServices/Attach?uid=0123456789<br /> (note: returns a Session ID in Result, for example: 7475678a3e94b060fde90040f8754de8)<br /> <br /> Register Plugin (to be done after successful register of Device Session):<br /> curl http://127.0.0.1:32017/Spokes/SessionManager/Register?name=My%20Funky%20Curl%20Demo<br /> (note: returns Result of true for success)<br /> <br /> 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:<br /> (note: must put quotes &quot; around the url, because of funny characters)<br /> (note: spaces and other funny characters are url encoded, e.g. space becomes %20, etc)<br /> curl &quot;http://127.0.0.1:32017/Spokes/CallServices/IncomingCall?name=My%20Funky%20Curl%20Demo&amp;callID=%7B%22Id%22%3A%221%22%7D&amp;contact=%7B%22Name%22%3A%22Bob%20Smith%22%7D&amp;tones=Unknown&amp;route=ToHeadset&quot;<br /> (note, the call id of 1 comes after %7B%22Id%22%3A%22 and before %22%7D)<br /> <br /> Terminate the call, here using call id of 1:<br /> curl &quot;http://127.0.0.1:32017/Spokes/CallServices/TerminateCall?name=My%20Funky%20Curl%20Demo&amp;callID=%7B%22Id%22%3A%221%22%7D&quot;<br /> (note, the call id of 1 comes after %7B%22Id%22%3A%22 and before %22%7D)<br /> <br /> Unregister the Plugin<br /> curl http://127.0.0.1:32017/Spokes/SessionManager/UnRegister?name=My%20Funky%20Curl%20Demo<br /> <br /> Release the Device Session<br /> curl http://127.0.0.1:32017/Spokes/DeviceServices/Release?sess=7475678a3e94b060fde90040f8754de8<br /> (note: that was the session from earlier Attach Device Session)<br /> <br /> <em><strong>For more URLs to control Hub, refer to the Java sample code (see Java Tab) here:</strong></em> <a href="/article/get-started-code-samples">http://developer.plantronics.com/article/get-started-code-samples</a><br /> ---</span><br /> &nbsp;

lcollins
In general I don&#39;t think you would need the &amp;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