USB HID telefony plugin for tSIP
This plugin is very similar to HidControl.dll, but it is dedicated to handling USB devices supporting HID Telephony profile (0xB) - this would be mainly USB headsets. It also tries to control ring and call state LEDs of the device. With HID usages mechanism it should also theoretically work with different devices without the need for any configuration.
Installation
- copy HidPhone.dll from Release directory of archive to tSIP /phone subdirectory
- start tSIP, go to Settings/Phones (plugins) and double click HidPhone.dll on the list
- close tSIP - HidPhone.cfg would be created in /phone subdirectory next to HidPhone.dll
- edit HidPhone.cfg if needed with text editor or JSON editor (as this is short file any text editor would be sufficient, I still might recommend JSONedit)
- start tSIP and check log if plugin has connection with device
Customization
When handling HID report reception this DLL first tries to match it against report list defined in its configuration, reportActions array. If no match is found, DLL is looking through device usages for matches.
Plugin settings are contained in HidPhone.cfg file that is created first time after HidPhone.dll was enabled in tSIP and then tSIP was closed. It can be then edited with any text editor or JSON editor.
Issue with Jabra Link
There is some issue with Jabra headsets when using Jabra Link (wireless adapter). It was not observed when headset is connected directly using USB. On outgoing call plugin is receiving off-hook=0 for few hundred milliseconds after call is confirmed (and off-hook=1 was sent to headset). This is normally interpred as immediate hangup from the user side. As a workaround, following script (ignoring off-hook=0 up to 1000 ms after outgoing call is confirmed) was used in plugin configuration as scriptOffHook0:
if IsCallIncoming() == 0 then local val = GetCallDurationFromConfirmed() if val ~= nil and val < 1000 then print("Ignoring hangup from headset for recently confirmed outgoing call\n") return end end print("Hangup from headset\n") Hangup()
This script requires tSIP version 0.3.06.1+ (GetCallDurationFromConfirmed() function was added in this version).
Source and binary
This DLL was built with Code::Blocks 16.01/MinGW. Using newer version of Code::Blocks might be more difficult as it looks like 32-bit libraries (hid.a, setupapi.a) are no longer distributed with Code::Blocks 20.
- 2023.03.30. Initial release: tSIP-plugin-HidPhone-0.1.zip.
Tested with Jabra Evolve 65 connected directly using USB cable.
Issues: hanging up confirmed call with single tap takes about 3 seconds, I'm not sure why.
Should work with other headsets, but contains some Jabra specific code - ignoring offhook event for a 1 second after offhook is sent to headset and hardcoded reject report handling (0x02 0x10 0x00 when double-tapping button in incoming call state).
In default configuration plugin opens first found USB device with telephony profile, but VID/PID can be forced manually through configuration file. - 2023.09.23. Version 0.2: tSIP-plugin-HidPhone-0.2.zip.
- fixed interoperability with Gigaset ION DECT handset and possibly other HID devices
- script actions in configuration are now split into actions for devices with non-absolute HID USAGEs ("scriptOffHookToggle") and those with absolute HID USAGEs (stateful, "scriptOffHook0"/"scriptOffHook1"); default settings would not typically require any modifications
- improved interoperability with Jabra Evolve 65
- default reportActions array entry is no longer needed for rejecting incoming call
- there is no longer 2-second delay when rejecting incoming call
- tested also with Mairdi M890DBT - seems to work but requires checking "Audio I/O"/"Start audio input before call is confirmed" option
- fixed possible (depending on USB HID device model) crash / stack buffer overflow
- log (but without the action at the moment) Line Busy Tone report and Flash report
If upgrading from version 0.1 you might need to delete from HidPhone.cfg JSON "reportActions" - this entry is no longer needed for Jabra Evolve 65 and may break interoperability with other handsets/headsets. If you haven't customized this file previously, you may just delete whole file, it would be recreated with new default settings. While debugging this version, I've found that drmingw might be useful and easy to use. To get usable stack trace it should be used with debug version of the dll binary. - fixed interoperability with Gigaset ION DECT handset and possibly other HID devices
- 2023.09.23. Version 0.3: tSIP-plugin-HidPhone-0.3.zip. Various fixes for headsets, mostly Jabra Evolve 65 with Jabra Link, recommended to be used with tSIP 0.3.7.
Github: https://github.com/tomek-o/tSIP-plugin-HidPhone.
Back to tSIP softphone