Git Product home page Git Product logo

gnaudio / jabra-browser-integration Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 65.4 MB

JavaScript library to control a Jabra headset from a browser

Home Page: https://www.npmjs.com/package/@gnaudio/jabra-browser-integration

License: MIT License

JavaScript 88.22% C++ 7.51% CMake 0.01% C 1.11% Shell 0.05% HTML 0.88% CSS 0.25% TypeScript 1.95% Batchfile 0.01%
jabra headset browser integration chrome-browser webextension usb-hid native-messaging

jabra-browser-integration's Introduction

DEPRECATION WARNING: A new JavaScript library - jabra-js - has been released to replace jabra-browser-integration. We recommend using the new library unless you depend on the following features: RemoteMMI, Busy Light or Analytics. Find jabra-js here. We will continue to support jabra-browser-integration until we reach feature parity on jabra-js.

Overview

This software project from Jabra helps developers to make solutions, where basic headset call control can be used from within a browser app using JavaScript. Since it is not possible to access USB devices directly from JavaScript, this library provides a solution of getting a route from the JavaScript to the Jabra USB device. The API is a JavaScript library with a facade that hides implementation details. Basic call control is defined by off-hook/on-hook, ringer, mute/unmute and hold/resume. With these features, it is possible to implement a browser based softphone app. Combined with the WebRTC technology it is possible to create a softphone that only requires small software components installed locally on the computer, while the business logic is implemented in JavaScript.

Project goals

  • be able to control a headset from JS
  • be a lightweight solution
  • support the platforms: Windows and macOS

Bug reports

If you find any bug or have any suggestion then fill in the form at Jabra developer support site with below details:

  1. Bug description with steps to reproduce the issue.
  2. Console log after enabling debug mode for this module, see Logging section for more.
  3. File logs, see Logging section for more.

System requirements

With current internal implementation of this software package, the following is supported:

Jabra devices

All professional Jabra headsets and Jabra speakerphones are supported. I.e. the Jabra Evolve series, the Jabra Pro series, the Jabra Biz series, the Jabra Speak series, and the Jabra Engage series.

Operating system support

The following desktop operating systems are supported:

Operating system Version
Windows 64 bit Windows 7 or newer
Windows 32 bit Windows 7 or newer
macOS El Capitan or newer

Browser support

Google Chrome web browser - stable channel - 32 bit and 64 bit.

Using the library

The solution consists of a Javascript API that webpages can consume, a chrome web extension and a native chromehost that must be installed separately.

Javascript/typescript API

Developers must use the versioned JavaScript library file with the format jabra.browser.integration.<majorVersion>.<minorVersion>.js and the associated typescript *.d.ts definition file which documents the API in detail, including exactly what each API method expect for parameters and what each method returns. Alternatively, the @gnaudio/jabra-browser-integration npm package can be used together with a browser bundler.

These files adhere to semantic versioning so increases in majorVersion between releases indicate breaking changes so developers using the software may need to change their code when updating. Increases in minorVersion indicates that all changes are backwards compatible.

Tip: Javascript developers can use the supplied typescript file with a reference path comment on top of your javascript files to get code completion for the Jabra API in many development tools.

Latest API versions are:

API packages/downloads Description
@gnaudio/jabra-browser-integration Npm package
jabra.browser.integration-3.0.js Javascript API client file
jabra.browser.integration-3.0.d.ts Typescript definition file

The API v3.0 is fully backward compatible with v2.0, and works with the current 2.x version of the Chrome Host and Chrome Extension.

The library internally checks for dependencies – and will report this to the app using the library. An example: When trying to initialize Jabra library the promise might fail with an error “You need to use this Extension and then reload this page” if the browser extension is missing.

WebExtension

Banner

Native Chromehost downloads

Operating systems Chrome host native download Description
Windows (Windows 7 or newer) JabraChromeHost2.1.0.msi Chromehost 2.1.0
macOS (El Capitan or newer) JabraChromeHost2.1.1.dmg Chromehost 2.1.1

The Chromehost can also be downloaded from Jabra developer zone

Getting started with using the API in your web applications

First, make sure the jabra library javascript file is included in your HTML page (use a local copy - don't link directly).

Secondly, the library must be initialized using javascript like this:

jabra
  .init()
  .then(() => {
    // Handle success
  })
  .catch(err => {
    // Handle error
  });

Generally, you will also need to setup various event handlers, like for example for when a new Jabra device has been attached to the computer or when the device has requested to be muted (just be aware that some events are only send if the device is in a specific state. For example, mute is only send when the device is off hook):

jabra.addEventListener("device attached", event => {
  // Handle new device
});

jabra.addEventListener("mute", event => {
  // Handle mute event.
});

When issuing commands, this API only works with one (active/selected) jabra device at the time (only an issue if you have multiple Jabra devices connected at the same time). You can easily issue specific commands to the active device like this example:

jabra.offHook();

Importantly, please do consult the typescript definition file for a full description of how to use the API. See also the source code for the examples listed below for usage details.

For many editors and IDE's, the above typescript definition file can be used to provide code completion and context sensitive help. For example for Visual Code, this requires top-level comment like this to your javascript source file:

/// <reference path="<your-path-to-a-local-copy-here>/jabra.browser.integration-3.0.d.ts" />

Dongle devices

Some Jabra headsets connect via Bluetooth to a USB-connected dongle. In the getDevices list, dongle and headset will appear separately, and the SDK will automatically sort out sending commands to the headset if called on the connected dongle and vice versa. However, the devlog event needs to be subscribed to the headset only.

Development tools/demos

Sequence diagrams

These sequence diagrams shows typical use of the browser sdk:

Sequence diagram

Sequence diagram

Sequence diagram

Sequence diagram

Sequence diagram

Deployment

Documentation about mass deployment

Upgrading API from 2.0 to 3.0

The API v3.0 is backward compatible with v2.0, and works with the current version of the Chrome Host and Chrome Extension. The new version can be consumed directly as previous versions by including the jabra library javascript file or by using the new npm package @gnaudio/jabra-browser-integration in combination with a browser bundler.

Analytics API (Preview)

This new version also includes a preview of the upcoming Analytics module (for supported headsets). It will analyze DevLog events and turn them into human readable statistics. The API is a pre-release and is subject to change without warning, so only use for evaluation purposes.

The following is a simple use example:

// Start by importing the module if using our npm module.
// If using direct includes (UMD), it will be available globally under jabra.Analytics
import { Analytics } from "jabra-browser-integration";

// Create an instance of the Analytics class, if you only want analytics
// for a specific device, supply a deviceID in the constructor.
const analytics = new Analytics();

// The analytics instance exposes a bunch of methods allowing you to pull data
// as speech status, speech time, muted status, boom arm position and much more
const speechStatus = analytics.getSpeechStatus();
const speechTime = analytics.getSpeechTime();
const mutedStatus = analytics.getMutedStatus();
const boomArmStatus = analytics.getBoomArmStatus();

// You can also listen to specific events, and only fetch analytics data, when
// you believe you want

// We start by defining an event handler that reports the current speech status
const handleSpeechEvent = event => {
  console.log(analytics.getSpeechStatus());
};

// We will then add the listener transmitter speech event, and the reciever
// speech event
analytics.addEventListener("txspeech", handleSpeechEvent);
analytics.addEventListener("rxspeech", handleSpeechEvent);

// At last we will tell the analytics module to start collection analytics data
analytics.start();

For more information see the TypeScript declaration, where every method is documented.

Upgrading API from 1.2 to 2.0

As noted in the changelog all methods now return values using Javascript promises rather than callbacks. Also, events are now subscribed to using a addEventListener(nameSpec, callback) and removeEventListener(nameSpec, callback) similar to standard libraries. With this new way of subscribing to events, the old requestEnum is removed as it is no longer necessary to switch on events.

The above changes were made to better handle a future expansion of events efficiently and to streamline testing and API usage in a modern way. For example, the changes made it easy to create our new API test tool. With the addition of typescript, the new API is also much easier to use ... and type safe.

The example below shows how to convert old 1.2 code like this:

jabra.init(
  function () {
    // Handle success
  },
  function(msg) {
   // Handle error
  },
  function (req) {
    if (req == jabra.requestEnum.mute) {
      // Handle mute event
    } else if (req == jabra.requestEnum.unmute) {
      // Handle unmute event.
    }
  }
);

to new 2.0 compliant code:

jabra.init().then(() => {
 // Handle success
}).catch((err) => {
 // Handle error
});

jabra.addEventListener("mute", (event) => {
 // Handle mute event.
});

jabra.addEventListener("unmute", (event) => {
 // Handle unmute event.
});

Version information.

For information about individual releases see changelog.

jabra-browser-integration's People

Contributors

extbmathapati avatar extrvyshnavi avatar extvpadmanabhan avatar frederiksen avatar jkrag avatar mmc41 avatar mortflem avatar pehandersen-jabra avatar rhnorskov avatar tfroehlich-jabra avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

eqramul01

jabra-browser-integration's Issues

Jabra Motion Office MS ENG Pack

Hello, i'm trying to implement integration with Jabra Motion Office MS ENG Pack. The problem is that the headset model works on Windows 8.1, but doesn't work on Windows 10 both in combination with 'Jabra Browser Integration' - Google Chrome Extention.
The error is:
VM129:2831 Error: You need to install the <a href='https://github.com/gnaudio/jabra-browser-integration#native-chromehost-downloads'>Jabra Browser Integration Host </a> and reload this page at initState.eventCallback (jabra.js?ba80bd7d667…2e406094ad89134:420)
It is confusing, because the extention is added. Please help! :)

Jabra SPEAK 510 USB: unexpected endcall event with fast resume/hold sequence

A fast sequence of hold/resume/hold/resume/... causes the device to report an unexpected endcall event.

I've implemented resume/hold as described in:
https://github.com/gnaudio/jabra-browser-integration/blob/master/docs/hold-resume-from-device.png

This log file contains the problem - this event is unexpected:
2019-11-28 14:27:21.895 INFO [39220] [HeadsetIntegrationService::Event@750] Event: endcall

JabraChromehost.log

The log file contains hold/resume operations initiated from our application, so there are no flash events. But the problem can be reproduced by responding to the flash events too.

(Jabra SPEAK 410 USB does not have this problem)

Jabra Unexpected endcall

Hello,

We're receiving unexpected endcall events from what seems to be the Chromehost

chrome_chromehost.txt
chrome_console.txt

I attached files from the Chrome extension background script and the chromehost logs.

Remarks:

  1. In the chrome_chromehost.txt the issue occurs at 2020-03-11 12:09:57.088
  2. This is not an isolated incident it happens widespread across all agents and multiple times in an hour.
  3. Modell: Jabra BIZ 2400 II
  4. Windows 10
  5. The agent is nowhere near to touch the headset controller.

We're running Chromehost 2.0.1-2 and api version 2.0

Firefox support

Hey, at the end it shouldn’t be very hard to port it to Firefox right?

Pass Caller ID to the device

Hi, I was unable to find anything in the docs about this. We are using the Jabra Stealth headsets and everything is working well. We were hoping we can pass the caller id to the device (when it rings right now it says "Call from PC").

If this is possible, can you point me to the documentation?

Thank you!

Chrome OS Support?

So could be merged in with the question for #37 but any chance of Chrome OS support down the road?

Jabra integration

Hi there! Im using jabra-browser-integration in my web application and all works fine for me.

For electron application, Im using your node module https://www.npmjs.com/package/jabra.
I'm trying to add code sample into my electron app:

const jabra = require('jabra')('myId');
jabra.on('attach', (device) => {
console.log(device);
const retCode = device.lock();
});

So device:
Device {
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
deviceID: 0,
productID: 769,
vendorID: 2830,
ESN: '00014A627742',
deviceName: 'Jabra EVOLVE 20',
errorStatus: 0,
connectionType: 0,
isDongleDevice: false,
isInFirmwareUpdateMode: false,
usbDevicePath: '/tmp/VID2830_PID769_LOCID342097920',
variant: '01-1D',
dongleName: null,
parentInstanceId: 'NOT SUPPORTED ON MAC',
connectionId: undefined,
parentDeviceId: undefined,
_isMuted: false,
_isOffHooked: false,
_isOnHold: false,
_isRinging: false,
_isTranslatedEvent: false,
getImagePathPromise: null,
getImageThumbnailPathPromise: null,
imagePath: null,
imageThumbnailPath: null,
isBatterySupported: null }

As I see from this object - 'NOT SUPPORTED ON MAC' and also device.lock() is undefined for me. Any idea what I'm doing wrong ? Thanks!

Environment: MacO High Sierra Version, 10.13.6

Cannot End Call with Jabra Evolve2 65

When i want to end a Call via the physical headset button, the 3CX Browser Extension says: "Error: Can't answer when state 9"
With version 2.0.2. of the Jabra Chrome Host it does work as intented. Only while using version 2.1.0 this error occurs.

Jabra Evolve2 65 Deskstand

Unable to call anything.

Always retuns errorcode 3.

error object: { "data": { "activeDevice": true, "deviceID": "0", "returnErrorCode": "3" }, "error": "Unable to set ringer" }

Receiving event from content script: {"apiClientId":"taaq8s6ab","data":{"activeDevice":true,"deviceID":"0","returnErrorCode":"3"},"error":"Error: Unable to set ringer","message":"na","requestId":"5","direction":"jabra-headset-extension-from-content-script"} Got error: Error: Unable to set ringer

WebUSB Support

Hi

Do you have any plans to build/support Jabra device actions by relying on WebUSB?
This would remove the necessity to install any software and would be platform agnostic.

Thx & BR

Updated libjabra.so?

is there a chance to get the Linux-SDK-Binary updated?
The current source can not be compiled against the old library.

Unexpected connection loss mid call

I opened a ticket with Jabra Support and they told me to post in the Github forum. I'm assuming the meant developer forum, but provided a link to github. I have created a ticket in the developer site too, but wanted to post this here as well.

We have about 70 Jabra Evolve 40 Headsets in our call center. They are on the latest firmware from March. We are running the Jabra desktop software and browser extension. We use these in Genesys PureCloud with WebRTC stations.

We have a handful of users losing their audio profiles in PureCloud and for a couple, this is a daily issue and happens mid call. We turned on extension logging, but I'm not really sure what to look for. We are seeing the following, which may come from the extension or PureCloud:
17:21:56.208 stash-logger.js:388 Jabra event unknown or not handled {event: "Event: jackConnection"}
17:21:56.212 stash-logger.js:388 Jabra event unknown or not handled {event: "Event: busylight"}

After further investigation, I enabled the DriverFrameworks-UserMode event log and was able to see the following message and others related to it "Received a Pnp or Power operation".

To me, this looks like the puck is the problem and this is not specific to PureCloud or any software, since we are seeing an OS level USB event. The appears to just randomly and temporarily drop.

Please let me know what you think and where to post this if I'm in the wrong for trying to get help here.

Thanks,
Daniel

unmute with jabra Engage 75 is not working

Hello,

with an Engage 75 I never get the unmute event.

I also try with your test webpage, same issue.
I have only this issue with this event, other event like mute, reject, accept ... are OK

BR

Laurent

Question about (non-beta) release

It's great that you've uploaded the package to npm.

Do you have plans to release a non-beta version soon?

I'm asking because the latest release is a 5 month old beta version

Reject event not being trapped

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

Getting Jabra to work with electron

Hi!
I've been having trouble getting this to work with an electron client.

The main problem seem to be that electron hasn't implemented the chrome.runtime API, creating some conflicts with the chrome web extension when connecting to the native application and sending messages, for example:

// background.js L:61
...
port = window.chrome.runtime.connectNative(hostName);
...
// content-script L:40
...
window.chrome.runtime.onMessage.addListener(...);
...

Is there any solution for gettings this to work with electron, or any thoughts about this?
🙂

Handling multiple calls

Hello
i would like to handle multiple calls; when they arrive i add the JSSIP session id in an array,
when one of them are terminated, i need to switch from that session id to another
to be able to control it with the Jabra buttons, but i do not know how to map
jabra() with a particular session id. How can i do that?

Thanks in advance and greetings

Jabra integration.js version 2.0 - setmmifocus - error

We ae using Jabra Evolve 20.

We integrate successfuly. Thorugh Amzon Jabra Integration also Done.
But we are not getting Chart graph in our site. Also in your demo site
also.
I did Amazon Jabara Integration as per your Documentation. But When I
was try with your demo link. In that Chart Graph of voice background
not display. Some JS error is displyed. SO can you please sort it out
what was the issues and how to resolve this.

setBusylight() with Jabra 9465

Hello! I tried using the jabra JS library to add some functionality to our internal app.

Functions like ring() or onHook/offHook() work fine, however I cannot get setBusyLight() to work on its own.

When calling the function, I get the following error in the console:

Uncaught (in promise) CommandError: Command setbusylight failed with error message setbusylight and details: [["returnErrorCode",3],["errormsg","setbusylight failed"],["command","setbusylight"],{"deviceID":"0"},{"activeDevice":true}]
at initState.eventCallback (http://domain/jabra.browser.integration-2.0.js:405:53

Is is possible to make this work with a Jabra 9485 base station?

Linux support?

Are there any plans for Linux support? I tried the Chrome extension in Ubuntu 19.04, but it just sends me in a loop saying the extension isn't installed (even though it installed correctly).

Question: Version 3 changelog

Hello,

We've been having some issues with unexpected endcalls from the Jabra integration and I stumbled across this #51

In the issue you mention that version 3 was due for early 2020 and contained a lot of bugfixes. Are there any more information on these bug fixes, and when can we expect version 3?

npm package

Hello,

I'm building a browser application with WebRTC softphone and I want to use this library to integrate Jabra headset functionality like answer and hangup.

I'm using npm for managing all my packages for compiling/bundling and other web frameworks and libraries.

It would be great if you could upload this library to npm so I don't have to manually update when you update.

Thank you

muting media

I use BT cloud work (which is basically ring central i think). It asked me to download this msi to link my headset to the call app. It now works, I can attend and disconnect calls etc from my headset.
I cant find anywhere to do settings to mute background media when a call comes in?

Cross-extensions communication

Hi,
I need to use the jabra-browser-integration extension with another chrome extension.

I saw on this chrome doc that the listening extension must use runtime.onMessageExternal but jabra extension doesn't support it.
I would like to know if the cross-extension functionality will be planned or if another way exists (without a personal fork of the jabra extension).

Thanks you.

Google Meet integration?

Hi, are there any plans to integrate with Google Meet? I tried this out with a Jabra Link 260, but doesn't work. But then, is this something the Meet team would have to integrate? My employer is migrating from WebEx to Meet, and the integration is great in WebEx.

Wrong call logic behavior in parallel apps

We are developing 2 apps (web app and desktop electron app). When those 2 apps are open on user pc and user receive a call ---> call acceptance leads to acceptance and rejection of the call (call duration 1-2 seconds). Any idea how it could be solved ?

Headset publishes only Mute or only Unmute events

Issue: My headset is in offHook state. I repeatedly click microphone button and expect to receive mute -> unmute event sequences. Instead I get only mute events and unmutes are ignored (but the device gets correctly unmuted and light indicator on the device is also always in the right state). I also managed to get to a situation where situation was opposite and only unmute events were received.

image

Devices: JABRA Evolve Link, JABRA Handset 450
I can replicate this with both mentioned devices in my app as well as with the hosted version of this repo (https://gnaudio.github.io/jabra-browser-integration/beta/test/)

Possible source of the issue: My Chrome extension says it's incomplete and needs update but updating or removing & adding it again doesn't help either.

image

Mute event not being fired if call is not active

Hello, i'm integrating your lib in my webrtc web app and it works great.
I have only an issue: when the user clicks the mute button, it switches on, but i do not get any event in jabra.addEventListener(), i have tried to handle all events listed in source code.
It works fine with active call, but not if the user wants to mute the microphone even if the call is not active.
Is it the expected behavior or can it be solved?
I am currently using Jabra BIZ-2300
Thanks in advance and greetings

Jabra dongle blinks randomly

With the version "Chromehost 2.0 (3CX only)" we have the problem that some Jabra dongles randomly start blinking when you accept a call or not. To stop the flashing you have to uninstall the device driver in the device manager of the headset completely and let it install again.

Compatibility

Looking at rolling this out at PGG call centre, currently we use Jabra9450. What versions of Chrome does it not play nice with (we are all win10, ver 76 or thereabouts with Chrome). Are there any known issues with integration when Chrome updates itself?

Jabra Pro 9450 Command (Green/White Button)

Sorry - I don't know where else to ask.

Using Jabra Pro 9450. Currently to switch between PC Audio & Phone Audio, I press this button.

image

WHITE = PC AUDIO
GREEN = PHONE AUDIO

Does this library have a command call this function?

jabra.offHook() and jabra.onHook() aren't the same / don't achieve that.

Issue function "hold" call in jabra sdk web browser

I click button on headphone jabra. This button is used to hold call, I successful in holding a call. After, I test function "jabra.hold()" in jabra sdk web browser but instead of hold call, this function made end call . How to me can solved this issue . I use soft-phone avaya ix .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.