jabra-devdeprecated

NodeJS SDK for Jabra Devices

Usage no npm install needed!

<script type="module">
  import jabraDev from 'https://cdn.skypack.dev/jabra-dev';
</script>

README

Jabra Node.js SDK

Table of Contents

Pre-requisite

  1. Node.js version v8.x or earlier

  2. On MacOS: xcode & python 2.7. By default, Python is installed on macOS but make sure correct version(2.7.x) is installed. Install Xcode from App store or download it from here.

  3. On Windows: Visual C++ Build Tools & Python 2.7. You can install all of these using command npm install --global --production --add-python-to-path windows-build-tools. To know more about this tool, see this link.

  4. For Electron.JS: If you are using asar packaging then you need to unpack some of the resources used in this module. These resources are native library files i.e libjabra.dll, libjabra.dylib & libjabra.so, which is stored in a shared-lib folder. By default latest electron builder will automatically unpack, but if it does not work then you can provide below option to your build process. To know more, see this link

    "build": {
        "asarUnpack": ["node_modules/jabra"]
    }
    

Installation

This release can be installed via below command.

npm install --save jabra@latest

Debugging and Logging

Below environment variables are defined for logging and debugging purpose. User can change the values as per preference.

Environment Variable Value Description
DEBUG jabra Debug this nodejs module, debug message will be printed on console
LIBJABRA_TRACE_LEVEL fatal, error, warning(default), info, debug Log levels
LIBJABRA_RESOURCE_PATH On Mac: ~/Library/Application Support/JabraSDK/ On Windows: %appdata%/JabraSDK This determine the system path where logs and device related files are written.

API Reference

API doc is in html format. See doc folder inside installed module node_module/jabra/doc and open index.html.

Examples

Simple Example

This example shows how to ring a Jabra device. User should first register the app on Jabra developer site to get appID. User should pass this appID to initialize jabra module.

const createJabraApp = require('jabra');
const jabra = createJabraApp('123'); // 123 is appID here

jabra.on('attach', (device) => {
    device.on('btnPress', (BTN_TYPE, btnValue) => {
        console.log('New input from device is received: ', jabra.enums.enumDeviceBtnType[BTN_TYPE], btnValue);
    })

    device.isRingerSupportedAsync() // returns promise
        .then((isSupported) => {
            if (isSupported) {
                device.ringAsync() // returns promise
                    .then(() => {
                        console.log('Device starts ringing');
                        setTimeout(() => {
                            device.unringAsync() // returns promise
                                .then(() => {
                                    console.log('Device stops ringing');
                                })
                                .catch((error) => {
                                    console.log('Device did not stop ringing due to ', error);
                                })
                        }, 5000); // stop ringing the device after 5 second
                    })
                    .catch((error) => {
                        console.log('Device did not start ringing due to ', error);
                    })
            }
        })
        .catch((error) => {
            console.log(error);
        })
});

jabra.on('detach', (deviceID, deviceName, productID, vendorID, ESN, isDongleDevice, isInFirmwareUpdateMode, variant, errorStatus) => {
    console.log('Device detached with deviceID:', deviceID);
});

Multiple device management

const jabra = require('jabra')('123'); // 123 is appID here
let deviceIDList = []; // store the list of attached deviceID

jabra.on('attach', (device) => {
    deviceIDList.push(device.deviceID);
});

jabra.on('detach', (deviceID) => {
    // logic to remove this deviceID from deviceIDList array
})

// suppose at some time, deviceIDList = [1, 3, 5]

const deviceInstanceList = jabra.getAttachedDevices(); // returns the list(Map data structure) of devices

const device3 = deviceInstanceList.get(deviceIDList[1]); // get device instance whose deviceID=3
device3.ringAsync() // ring device3 returns promise
    .then(() => {
        console.log('Device 3 starts ringing');
    })
    .catch((error) => {
        console.log('Device 3 did not start ringing due to ', error);
    })

const device1 = deviceInstanceList.get(deviceIDList[0]); // get device instance whose deviceID=1
device1.ringAsync() // ring device3 returns promise
    .then(() => {
        console.log('Device 1 starts ringing');
    })
    .catch((error) => {
        console.log('Device 1 did not start ringing due to ', error);
    })

Example:

const jabra = require('jabra')('123'); // 123 is appID here
import { jabraEnums } from 'jabra';
jabra.on('attach', (device) => {
    if(device.connectionType !== jabraEnums.enumDeviceConnectionType.BT){
        device.ringAsync() // ring device3 returns promise
        .then(() => {
            console.log('Device starts ringing');
        })
        .catch((error) => {
            console.log('Device did not start ringing due to ', error);
        })
    }
})

Features supported

  • Device Information (device name, serial number, battery status)
  • Remote Call Control(RCC) functionality support for below commands:
    • Answer and End Call
    • Mute and Unmute Call
    • Hold and Resume Call
    • Ring indication
  • Dongle support (Link360 and Link370)

Supported devices

  • Pro 9470
  • Pro 9465
  • Pro 9460
  • Pro 9450
  • Biz 2300
  • Motion Office
  • Evolve 65 USB
  • Biz 2400 II CC
  • Pro 930
  • Pro 935 (single and dual)
  • Pro 925 (single and dual)
  • Evolve 40
  • Evolve 80
  • Link 265
  • Evolve 30 II
  • Evolve 20
  • Evolve 30
  • Biz 1500
  • Biz 2400 II
  • Link 260
  • Evolve 65t
  • Evolve 75
  • Evolve 75e
  • Engage 50
  • Engage 65
  • Engage 75
  • Motion UC (over Bluetooth)
  • Link 360
  • Link 370
  • Speak 410
  • Speak 510
  • Speak 710
  • Speak 810
  • Link 230
  • Link 850
  • Link 860 (only settings applicable)

Bug Report

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 Debugging and Logging section for more.
  3. File logs, see Debugging and Logging section for more.

License

Refer LICENSE.md under installed package directory