15 posts / 0 new
Last post
suryateja
plantronics sdk for python
I have a requirement to use plantronics sdk in python code project, but sdk and api is not available for python. Is there a workaround for this?

lcollins
Hi, There is a sample code called ResilientPLTDemo. Here is the code for it: https://developer.plantronics.com/system/files/ResilientPLTDemo.zip (You need to be logged into this web site to download this file). This sample code has a python script to access the Plantronics Hub SDK via .NET, that uses Python for .NET Let us know if it works for you. Lewis

lcollins
Just a follow up, here's how to install pythonnet these days (on Windows): py -m pip install pythonnet When you build the ResilientPLTDemo.exe, go to the bin/Debug folder, where a copy of pythondemo.py will be. Then run it with py pythondemo.py

suryateja
thankyou, will try.

lcollins
The pythondemo.py needs to reside in the output folder of the C# project. which builds ResilientPLTDemo.exe. The python script then imports that in the same folder, using hubsdkconnector = clr.AddReference("ResilientPLTDemo")

suryateja
I am using Poly Blackwire 3325 series and latest plantronics Hub software and after starting the resilentdemo in visualstudio a resilentdemo.exe is opened in terminal which has options but it is not able to connect to sdk, i'm getting following error plt sample menu -- 1 - ring/incoming call 2 - outgoing call 3 - answer call 4 - hold call 5 - resume call 6 - mute call 7 - unmute call 8 - end call 0 - quit -- ADVANCED -- 9 - dial outbound 10 - insert call > 6 Setting headset mute = true SDK ERROR: sdk_not_connected: Cannot perform SDK action: SetMute, SDK is not connected (is Plantronics Hub running?) plt sample menu -- 1 - ring/incoming call 2 - outgoing call 3 - answer call 4 - hold call 5 - resume call 6 - mute call 7 - unmute call 8 - end call 0 - quit -- ADVANCED -- 9 - dial outbound 10 - insert call > SDK ERROR: sdk_connection_failed: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {750B4A16-1338-4DB0-85BB-C6C89E4CB9AC} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at ResilientPLTDemo.HubSDKConnector.DoConnectCOMAPI() in C:\Users\v-vkambagoun\Desktop\ResilientPLTDemo\ResilientPLTDemo\ResilientPLTDemo\HubSDKConnector.cs:line 249 SDK INFO: sdk_notification: SDK re-connect attempt will occur in: 5 seconds. SDK ERROR: sdk_connection_failed: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {750B4A16-1338-4DB0-85BB-C6C89E4CB9AC} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at ResilientPLTDemo.HubSDKConnector.DoConnectCOMAPI() in C:\Users\v-vkambagoun\Desktop\ResilientPLTDemo\ResilientPLTDemo\ResilientPLTDemo\HubSDKConnector.cs:line 249 SDK INFO: sdk_notification: SDK re-connect attempt will occur in: 5 seconds. SDK ERROR: sdk_connection_failed: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {750B4A16-1338-4DB0-85BB-C6C89E4CB9AC} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at ResilientPLTDemo.HubSDKConnector.DoConnectCOMAPI() in C:\Users\v-vkambagoun\Desktop\ResilientPLTDemo\ResilientPLTDemo\ResilientPLTDemo\HubSDKConnector.cs:line 249 SDK INFO: sdk_notification: SDK re-connect attempt will occur in: 5 seconds. SDK ERROR: sdk_connection_failed: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {750B4A16-1338-4DB0-85BB-C6C89E4CB9AC} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at ResilientPLTDemo.HubSDKConnector.DoConnectCOMAPI() in C:\Users\v-vkambagoun\Desktop\ResilientPLTDemo\ResilientPLTDemo\ResilientPLTDemo\HubSDKConnector.cs:line 249 SDK INFO: sdk_notification: SDK re-connect attempt will occur in: 5 seconds. SDK ERROR: sdk_connection_failed: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {750B4A16-1338-4DB0-85BB-C6C89E4CB9AC} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at ResilientPLTDemo.HubSDKConnector.DoConnectCOMAPI() in C:\Users\v-vkambagoun\Desktop\ResilientPLTDemo\ResilientPLTDemo\ResilientPLTDemo\HubSDKConnector.cs:line 249 SDK INFO: sdk_notification: SDK re-connect attempt will occur in: 5 seconds.

suryateja
*Not facing this above issue anymore, * "What I want to acheive is to Mute/Unmute Teams app call using headset sdk in Python , poly blackwire 3325 series connectedbut sdk is not available in python" * Resilentdemo.exe is connected to sdk, but it is not able to perform actions on headset like I am on Teams call and triggered resilentdemo.exe using visual studio and gave option 6(mute) but mute action is not performed. plt sample menu -- 1 - ring/incoming call 2 - outgoing call 3 - answer call 4 - hold call 5 - resume call 6 - mute call 7 - unmute call 8 - end call 0 - quit -- ADVANCED -- 9 - dial outbound 10 - insert call > SDK INFO: sdk_device_attached: Device attached: , Product ID = 430C, Serial Number = SDK INFO: sdk_notification: Successfully hooked to device listener events SDK INFO: sdk_notification: AttachedEventHandler to device events SDK INFO: sdk_notification: Unable to retrieve/hook to active device SDK INFO: sdk_connected: SDK now connected 6 Setting headset mute = true plt sample menu -- 1 - ring/incoming call 2 - outgoing call 3 - answer call 4 - hold call 5 - resume call 6 - mute call 7 - unmute call 8 - end call 0 - quit -- ADVANCED -- 9 - dial outbound 10 - insert call > DeviceEventType_HeadsetStateChanged - HeadsetStateChange_MuteOFF DEVICE EVENT: btn: HeadsetButton_Mute, aud:AudioState_Unknown, mute: False

lcollins
Hi, The reason this scenario is not working for you is the line from your console output that reads: SDK INFO: sdk_notification: Unable to retrieve/hook to active device I am not getting this, but it indicates your host lost connection with your device. Another odd thing is I am getting > SDK INFO: sdk_device_attached: Device attached: Poly Blackwire 3315 Series, Product ID = 430D, Serial Number = 5CBB0CE18D9547BF877955037362069E, whereas you are getting only: > SDK INFO: sdk_device_attached: Device attached: , Product ID = 430C, Serial Number = . You have no product name or serial number. Are you running only Plantronics Hub and no other Poly software? Have you updated the firmware of the Blackwire 3325? (Mine updated using Hub to: SetId: v.1.1166.72.2047 USB: v.2047). I was able to start a Teams conference call, then use ReslientPLTDemo option 6 and 7 to mute/unmute the call, as this uses the Hub SDK COMDeviceListener.mute = true/false, which effectively mutes the Blackwire 3325 at device level. I was also able to add mute/unmute to the included pythondemo.py that at build is copied to bin\Debug alongside ResilientPLTDemo.exe. I modified line 68 to read: from ResilientPLTDemo import HubSDKConnector,HubSDKAction,HubSDKActionType. Then I inserted these lines at line 101: # Demo of mute/unmute input("Press Enter to mute...\r\n\r\n") hubsdk.DoHubSDKAction(HubSDKAction(HubSDKActionType.SetMute, True)); input("Press Enter to unmute...\r\n\r\n") hubsdk.DoHubSDKAction(HubSDKAction(HubSDKActionType.SetMute, False)); Now when on a Teams conference call, I can start a command prompt at the bin\Debug folder, and run the updated pythondemo.py with the command py pythondemo.py. Pressing enter twice more will mute and unmute the Blackwire 3325 headset. Let us know if this gets you any further. Thanks

lcollins
The Hub SDK mute function employed by ResilientPLTDemo.exe, (and the suggested edit to the py pythondemo.py), is reference to https://developer.plantronics.com/system/files/Spokes%203G%20API%20Specification_V3_8.pdf section 3.1 IDEVICELISTENER, getMute, setMute

suryateja
Thanks for getting back to me , Will try this tomorrow . I have another requirement also similar to this I need to use plantronics sdk for Node js also is it possible ? and should I raise another forum for this requirement?

lcollins
For node.js you could integrate Hub SDK using the JavaScript API or REST API. Examples for JavaScript and Java here: https://developer.plantronics.com/article/softphone-integration-code-samples However, if you are trying to mute the headset, the REST API only exposes ICallCommand muteCall, rather than the DeviceListener mute (device level mute). Which would mean this API is only suitable for a softphone integration where you have notified the API of a call in progress, etc, before calling muteCall. https://developer.plantronics.com/system/files/Spokes%203G%20API%20Specification_V3_8.pdf section 2.2.

suryateja
Thanka a ton, I am able to mute and unmute device in teams successfully after editing pythondemo.py like you suggested. I would like to know if we can answer call, hold call, Resume call and leave call in Teams using this

lcollins
This Hub API is intended to synchronise the call state between your softphone and the Poly headset. You can use the Hub API call command interface and headset button controls to control calls in your own soft phone, and you can also mute/unmute the Blackwire device directly as discussed above. You can also be aware of the state of other softphone calls like Teams through API events you get from the Hub SDK COM API, but you cannot control those calls in other soft phones like Teams. To do so you would need to explore API options for Teams.

suryateja
I have microsoft python project with Teams-api where i have used this resilentplt demo and mute/unmute is working fine, but not able to hold/resume, answer/decline calls. Can you Please explain if there is any way to do that, If so, what would I need like callid or anything to perform any of the actions

lcollins
Can I refer you to the answer #13 above. As Teams is not your soft phone you cannot control its calls with the Plantronics Hub SDK, while you can mute/unmute the device at device level with Plantronics Hub SDK. For call control of Teams, you can either use Teams own GUI, a Teams API if available, or the headset buttons themselves as Teams is already integrated to the Poly headset. If you want a callid to manipulate calls with the Hub SDK, this would only apply to calls within your own softphone product you had notified to Hub SDK, not to Teams calls. You cannot manipulate Teams calls via the Hub SDK.

Add new comment