gnaudio / jabra-browser-integration

JavaScript library to control a Jabra headset from a browser
https://www.npmjs.com/package/@gnaudio/jabra-browser-integration
MIT License
3 stars 1 forks source link

Reject event not being trapped #44

Closed cdiscla closed 4 years ago

cdiscla commented 4 years ago

Hello, i'm developing a webapp using Jabra Browser Integration, it works fine; i can do all the actions but one: if i call from a softphone to my app, i get the new call incoming and fire jabra.ring(), so that Jabra headset starts to blink but if i try to simulate rejection by hanging down the phone before answering, the reject event is not invoked. I use

jabra.addEventListener("reject", (event) => {
         console.log("jabra reject call");
         jabra.onHook();
 });

but it is never called. I've seen in the source code that the event should be "reject" even if in the docs i've seen rejectCall (that, anyway, does not work) Can you help me, please? Thanks in advance and greetings

cdiscla commented 4 years ago

My mistake, sorry ... i didn't handle the "failed" WebRTC state. If i handle the failed event i force jabra.onHook() and it works. Thanks