-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headset button support please #32
Comments
Depending on headset type try either hotkeys (media keys) or HidControl plugin (might require manual configuration). |
Thanks I will try hotkeys, I tried HidControl without any success. Only reason I mentioned microsip works is because you only have to tick a box "headset support" and it works right out of the box. I will let you know if I find a solution with hotkeys. The headset is the Jabra Evolve 65 wireless |
HidControl.dll should generate some logs and should also be pretty easy to compile and debug. First step should be probably determining whether headset works as HID Telephony or media keys. One I've described, M890DBT uses actually both modes (one at the time) depending on whether microphone is in use or not. |
I kept getting this in the log I tried to find the PID and VID but the only thing I could find was this: Parent Device: USB\VID_0B0E&PID_245E&MI_00\6&3390c61d&1&0000 I did find this though on their website, but whatever I try it just says "Error opening USB device" [HidControl.dll] Error opening USB device (USB VID 0x1395, PID 0x0026, usage page 0xB): Device not found Doesn't seem to matter what I put into the cfg file it always says that same message. |
Try putting into HidControl.cfg: usbPid = 9310, usbVid = 2830 (these are 0x245E and 0x0B0E converted to decimal). Note: file should be edited when plugin/application is not running, otherwise user changes might disappear. If you want to make sure if headset is using or not using media keys you might try https://w3c.github.io/uievents/tools/key-event-viewer.html. |
That seemed to pick up the device, when it rings it now shows: Skipping playing - 2 seconds not passed But the button still does nothing. I set a hotkey too to media play/pause = anser/hangup but the button still does nothing, just tells you the battery status. Nothing comes up on the webpage at all when you press the button, so I assume it isn't using media keys? |
If I run MicroSIP at the same time and answer with that one I get this in the logs delta = 7 |
Let's assume media keys would not be in use (if you have configured hotkeys for them you might delete or disable them temporarily).
Let's look for these events. In HidControl.cfg they can be matched byte-by-byte and then associated script is started (different scripts for different reports). |
If MicroSIP is not running I only get the one starting 0x04, and thats before I press anything, then when I press something nothing happens. If I open Microsip and press the button it answers the call and i get the 0x07, etc in the logs on tsip, I think 7 is the button press and 4 might be the hangup or 0 not sure. I did follow that page on that headset and ticked that box just in case it made a difference, but it hasn't |
From jabra documentation it looks like this headset might work in a stateful way, so it might not send any event until it receives "ring" or "off hook" event. This might be hard for me to debug remotely and I don't have much experience with USB headsets. Maybe I'll get my hands on similar headset later. |
Well thanks very much for your time looking at this, shame it wasn't an easy fix! |
Do you know which headsets do work with the buttons to answer/hang up? Thanks |
I can't tell much as I've tested only a few devices: EX-03 USB phone, some keyboard with integrated headset, Mairdi M890 (and this one looks dead at the moment, maybe it self-discharged below critical point, so I would be cautious about it). Philips VoIP 151 is waiting, but that's corded again, AIKELA M100C - also untested yet. Regarding jabra: could you tell me if https://github.com/nondebug/jabra-webhid-demo works with your model and what would be correct event sequence to get answer/hangup events? |
No, you can see it in the list when you click connect: The 370 is the usb dongle it uses to connect, and the headset is evolve 35,. https://github.com/lalmeras/jabra_link_370 and this one which is c# https://github.com/edgarleonz/jabra-end-interaction-extension-for-genesys-workspace-desktop-edition but I haven't worked out how to test them yet. |
I've got now Jabra Evolve 65 "old model" (as there are two models apparently - old model has silver ring and new one is all black I think). Unfortunately I don't have Jabra Link 370, but I'm hoping that direct USB connection to the headset that I'm testing would work the same way as connection through Jabra Link 370. Please see how this would work for you: |
Initial test works fine on Wireless button press, Jabra 65 also via the Link 370, mine has the silver ring, but we have others I will check them. I will do sme more testing today. |
Been testing this, it works fine on the headset with the silver ring on the edge, but not at all on the black egde headset, just as you thought it would. On the black one the button just doesn't do anything, and yes it works via the 370, but again not with the black edge headset. |
Hi. Maybe someone already tried it and might confirm if it will work out of the box or tsip should be configured somehow? |
Not sure i did something right.
Right after new tsip run it's log shows: [HidControl.dll] Error opening USB device (USB VID 0x1395, PID 0x0026, usage page 0xB): Device not found When i stop it it just goes back to old settings inside of cfg file :( |
You have to convert these numbers from hex to decimal (4381 and 7813 respectively, similar to 11 being used as 0xB HID usage page) as hex numbers are not valid in plain JSON and default values were used instead (VID 0x1395, PID 0x0026). I think I would recommend trying HidPhone.dll first if you haven't - it is supposed to at least recognize OFFHOOK action without any additional configuration and it would enumerate USB devices looking for 0xB page, not requiring entering VID/PID if there is only one device. |
Looks like i got some updates, i assume those pids is in hex, so i need to convert it for tsip:
Errors was stopped, but behaviour has changed to smoething weird, initiated call from tsip to my mobile, and speakerphone started with disabled microphone. [HidControl.dll] HID REPORT_IN received 65 B: 0x09 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0x00 0x00 0x00 0x08 0x00 0x30 0x78 0x37 0x37 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x08 0x05 0x00 0x00 0x0C 0x05 0x00 0x00 0xF4 0x04 0x00 0x00 |
Oh, you already found my errors. |
Not really sure what is giong on, but tsip frequently quits with HidPhone plugin enabled. But nothing shows on the log windows of tsip when i pressed mute button, just ends the call :( |
HidControl.dll default configuration is for Mairdi M890BTD and this is a headset with basically single button, recognized by single 0x01 byte with Answer/Hangup action assigned (in HidControl.cfg JSON file there is a single entry in the reportActions array). It looks like accidentally ION is sending report starting with 0x01 for Mute button. If you would see some reports in log when Answer and Hangup buttons are pressed (maybe one of them is the one starting with 0x09 above), you could use them to create actions. Each action consists of bytes array to check against (just 0x01 in default configuration) for match and script to be executed. Regarding quitting when using with HidPhone.dll - it could be dll crashing. Are you interested in installing Code::Blocks 16.01/MinGW and trying to debug it by any chance? |
Only on the weekend i can try to search what does code::blocks mean as iam not really used mingw in my life, only some apps build with it. |
Can't get anything for offhook, as tsip just quits right after press now. Also i have tried microsip also with ticked headset support. |
I would assume that you don't have prior experience with C/C++/MinG, adding new IDE and initial setup to that - it might be too much for a weekend. In the past I've done some debugging remotely over TeamViewer, but the guy that gave me the access had a fresh, separate PC so there were no privacy concerns. I could also try to add more logs to dll, but this could be painful, iterative and slow comparing to catching it with debugger. It might be worth trying again HidControl.dll (both plugins can be "installed" same time, just activate/deactivate them one at the time) and checking if it logs any reports for Answer/Hangup handset buttons. |
You are right, i am not a programmer so it might take more time. Right now activated HidControl, opens log window and pressed answer button i got this after some time: [HidControl.dll] HID REPORT_IN received 64 B: 0x00 0x00 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0x00 0x00 0x00 0x08 0x00 0x30 0x78 0x37 0x37 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x05 0x00 0x00 0x80 0x04 0x00 0x00 0x68 0x04 0x00 Nothing happens for end call and mute buttons. When i initiated a call, nothing happens for end call button. But this happens for answer button and tsip ends the call: [HidControl.dll] HID REPORT_IN received 65 B: 0x00 0x00 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0x00 0x00 0x00 0x08 0x00 0x30 0x78 0x37 0x37 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x05 0x00 0x00 0x80 0x04 0x00 0x00 0x68 0x04 0x00 0x00 And this one happens for mute button and tsip ends the call: [HidControl.dll] HID REPORT_IN received 65 B: 0x09 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0x00 0x00 0x00 0x08 0x00 0x30 0x78 0x37 0x37 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x14 0x05 0x00 0x00 0x80 0x04 0x00 0x00 0x68 0x04 0x00 0x00 Btw, unlike with HidPhone, no light blue light on the speaker phone, it looks like HidControl doesn't provide some data to the speaker. |
Your observation seems correct, Gigaset is probably stateful like Jabra and basic report matching from HidControl.dll is not enough (at least hangup button would not work). Another idea: I've attached debug build of HidPhone.dll and https://github.com/jrfonseca/drmingw (I've installed 64-bit version locally by running "drmingw -i" from command line in administrator mode) seems to be catching my test crash with useful trace. |
Sure. tSIP_nocalls_answerbutton.log All this time light blue ring led also works correctly from my side. For now i haven't tried incoming calls, as i don't understand how to call to the tsip directly from my ipphone and it cannot dial something like 3001@192.168.1.80:5060, only 192.168.1.80:5060. |
Nasty. If debug build works, it might be something like uninitiated variable. I would recommend using debug build for now then.
Calling "192.168.1.80:5060" should also work, assuming that in tSIP Account settings "Answer any call" is checked and tSIP is bound to port 5060 (Network: Local IP address = 0.0.0.0:5060 plus optionally selected network adapter below if needed). If there are multiple softphones and/or other clients then each one should have unique bind port. If binding address is empty then semi-random port assigned by OS is used that need to be checked in log. |
Now i got incall (in theory buttons should allow accept call or reject). tSIP_incall_answerbutton_endbyotherside.log |
In some of these logs I'm seeing few "Device connected" with capabilities enumeration logs but nothing in between, also not a lot of log lines related to actual calls - I feel like something important might be cut out. Is handset connected continuously? |
Yes, it is connected continuously. About logs, if there is a way to produce more logs just share it with me, as of now it was logs window opened via view - logs and ticked save to file option. With last incall logs I haven't touched interface buttons of the app, so it was ringing some time, I was touched ION answer or reject and then I have cancelled call on my ipphone. |
I'll be back with update in ~10 hours. Right now I'm thinking that this might be some device opening error that I'm not logging. |
Got it. |
In the last logs there was no hook reports but mostly strange reconnections. Now I think that this could be caused by buffer overflow I've found few minutes ago. It probably won't fix all functionality (if any), but this was very likely the reason for the crash (depending on USB device) in the release build and it could also cause some erratic behavior in debug build. |
Well, first of all - tsip doesn't crash\quits\etc. Now it was able to answer for incoming call with answer button. Mute button during incoming or outgoing call also leads tsip to ends call. During incoming rings press for end call button doesn't leads to reject - nothing happens. tSIP_incall_answer_end-worksfine.log |
Hm, it looks like inside of the HidPhone.cfg there is some script also, and if i replace it with:
Answer/end doesn't work, but atleast mute is working during call, but i thing locally, as mute button on the tsip doen't moves. |
I've updated https://tomeko.net/tmp/HidPhone.dll. Mute would not work out of the box yet. I'm using scripting for passing commands and while it can be very flexible I surprisingly don't have "Mute" Lua function - probably because I'm not using it myself. The workaround would be defining "Mute" programmable button and then using ProgrammableButtonClick(BUTTON_ID) in HidPhone.cfg as "scriptMuteToggle" value. BUTTON_ID = id of defined Mute button. |
Something goes wrong and now answer button works as reject while incoming ring. tSIP_incomingring_answer-rejected.log |
Looks like i am not clearly understand monents of different hooks running. Which of them runs for which moments? At this screen there is a moment of incoming ring and my press of answer button, but log shows run hook0 and hook1 also. |
"scriptOffHookToggle" is running if device is sending OffHook usage and its OffHook is not absolute - I suppose these would be devices without internal state, maybe without call state LEDs. For devices with absolute OffHook (these seem to be my Jabra and your Gigaset), either "scriptOffHook0" or "scriptOffHook1" depending on if report contains OffHook usage or not. I've updated https://tomeko.net/tmp/HidPhone.dll once again. Looking into MicroSIP source code I see some tricky looking (at least it looks to me like a trick) code with call rejecting requiring two events in a row. This isn't breaking interoperability with my Jabra, but it should help with your Gigaset that when answering first is sending OffHook = 0 and then OffHook = 1. |
It looks like now it works in a proper way. Thank you for spending your time on me. |
I'm not checking for offHook state changes, but offHook1 script checks if there is an incoming call on itself, so calling it multiple times would be harmless and I think it would be not possible to use "Answer" button on stateful/"absolute" phone for multiple purposes (contrary to stateless phone where each report would be equal to single press). I'll bump dll version number / create release probably tomorrow. I would hope that non-debug build would not crash anymore (all the temporary compilation were debug builds), though I'll upload both just in case. |
Ok, i will check released version also. |
It looks like page: Was updated with this archive: I have got Release version, added it to the tsip with removing cfg file before tsip starts. Did a few calls from\to ipphone so far so good. |
Thanks. I'm closing this issue as I believe it is fulfilled now by HidPhone.dll and any further problems should probably be assigned directly to either HidPhone.dll or HidControl.dll plugin projects. |
So headset buttons can be used to answer/hangup calls, it works in microsip but not in tsip, would be really nice to have it working in tsip
The text was updated successfully, but these errors were encountered: