2.5.0 • Published 9 days ago

softphone-vendor-headsets v2.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

Softphone Vendor Headsets

Overview

Library that acts as the proxy between headset vendor SDKs and consuming apps (in our case the Genesys SDK). This library offers solutions for the consuming app to react to headset events such as muting the device, answering a call and others all done from the device itself.

This project has a React test app bootstrapped with create-react-app.

At this moment (12/10/2021) there are three supported vendors already handled with this library:

  • Plantronics/Poly
  • Sennheiser/EPOS
  • Jabra

Installation

# npm
npm install --save softphone-headset-vendors
# yarn
yarn softphone-headset-vendors

Documentation

Structure and flow

  • The consuming app will first above anything else hit the HeadsetService (headsets.ts).
  • From there, the service will determine what vendor is currently selected out of the supported vendors above. This will also be a hub to call the proper functions that correspond with app to headset events (More on that later)
  • Once the above step is verified, an instance of that vendor's required approach will be spun up. This will then be what the vendor's SDK directly hits and where events are either sent first from the headset itself, or where events will be set to the headset
  • If an event is received from the headset itself, the vendor instance will emit an event that headset.ts is listening for. This event will then be passed to the consuming app to properly reflect the state on screen to match that of the headset

Example 1 - User clicks mute on the consuming app:

  • From the consuming app, the user clicks on an on-screen mute button
  • This event is then sent to headsets.ts
  • Which is passed to the corresponding function of the vendor's specific implementation (for example, plantronics.ts -> setMute(true))
  • This function will then send a message to the headset itself
  • The user will then see the light on their device that represents the "muted" state light up.

Example 2 - User presses the mute button from the headset:

  • From the headset, the user presses the button which corresponds to mute
  • This is then received by the vendor instance (for example sennheiser.ts)
  • This event is then sent to headset.ts which in turn lets the consuming app know so that the screen properly reflect the state of the headset

WebHID

One of our supported vendors has began working with a technology known as WebHID. This is a relatively newer technology with a lot of promise but with its own caveats as well - https://wicg.github.io/webhid/

  • At this moment, WebHID only works with Chromium browsers (Google Chrome/Microsoft Edge). Keep this in mind when developing and using the vendors we currently support
  • In order to use WebHID, you must grant permissions for the site you are currently on. There is a function that must be called that causes a popup to show on screen where the user is then required to select their device and approve its use for WebHID purposes. This function MUST be called with user action (i.e. clicking a button). The solution we currently have in place is after the user takes the action of changing and selecting a new microphone, we check if it is the specific vendor that supports WebHID, then we emit an event that a consuming app should listen for and then fire the WebHID consent function

Contributing

This repo uses Jest for tests and code coverage

To get started in development:

npm install
cd react-app
yarn start

Then navigate to https://localhost:8443 to see the test app. This way you can see the effects of the events from the headset on the app and vice versa.

Testing

Run the tests using npm run test:watch or npm run test:coverage. Both commands should be run in the folder.

  • test:watch will rerun the tests after changes to the code or the test itself
  • test:coverage will run the test suites and produce a report on coverage of the code

Important Note: Out of the box, the test scripts will not work on Windows machines. A developer will more than likely need to make modifications to the scripts in the package.json as well as the shell scripts found in the scripts folder. If you do not want to modify the scripts out of the box, using a Linux instance seemed to help. The author of the library used an Ubuntu instance

2.5.0

2 months ago

2.5.0-release.7

2 months ago

2.5.0-release.4

3 months ago

2.4.5-develop.44

3 months ago

2.4.5-PCM-2302.5

3 months ago

2.4.5

3 months ago

2.4.5-develop.43

3 months ago

2.4.5-release.1

3 months ago

2.4.4

4 months ago

2.4.5-develop.42

4 months ago

2.4.3

5 months ago

2.4.3-release.2

5 months ago

2.4.1

6 months ago

2.4.0

6 months ago

2.4.1-develop.32

6 months ago

2.4.1-develop.33

6 months ago

2.4.2-updateUUID.2

6 months ago

2.4.2-updateUUID.1

6 months ago

2.4.2-updateUUID.4

6 months ago

2.4.2-updateUUID.3

6 months ago

2.3.4-PCM-2224.2

7 months ago

2.3.4-PCM-2224.3

7 months ago

2.4.3-PCM-2224.5

6 months ago

2.4.3-PCM-2224.6

6 months ago

2.4.0-release.1

6 months ago

2.4.2-PCM-2224.4

6 months ago

2.4.2-develop.35

6 months ago

2.4.2-develop.36

6 months ago

2.4.2-develop.34

6 months ago

2.3.4-develop.31

7 months ago

2.3.4-PCM-2224.1

7 months ago

2.3.2

11 months ago

2.3.3

10 months ago

2.3.1-develop.28

11 months ago

2.3.1-develop.27

11 months ago

2.3.4-PCM-2227.2

8 months ago

2.3.4-PCM-2227.3

8 months ago

2.3.4-PCM-2227.4

8 months ago

2.3.3-develop.29

11 months ago

2.3.4-develop.30

10 months ago

2.3.1-fix-stuff.2

11 months ago

2.2.0-PCM-2016.1

2 years ago

2.2.1-release.3

2 years ago

2.3.0

1 year ago

2.3.1

1 year ago

2.2.0-develop.22

2 years ago

2.2.0-develop.21

2 years ago

2.2.1

2 years ago

2.2.0-release.2

2 years ago

2.3.0-release.2

2 years ago

2.2.0-PCM-2007.3

2 years ago

2.2.0-develop.20

2 years ago

2.2.0

2 years ago

2.2.0-release.1

2 years ago

2.2.0-PCM-1974.2

2 years ago

2.2.0-PCM-1974.3

2 years ago

2.0.3-PCM-1965.1

2 years ago

2.0.2

2 years ago

2.0.3-develop.18

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.2-develop.17

2 years ago

2.0.3-jquery.6

2 years ago

2.0.3-jquery.4

2 years ago

2.0.1-release.2

2 years ago

2.0.3-jquery.5

2 years ago

2.0.1-release.1

2 years ago

2.0.3-jquery.2

2 years ago

2.0.3-jquery.3

2 years ago

2.0.3-jquery.13

2 years ago

2.0.2-release.1

2 years ago

2.1.0-release.1

2 years ago

2.1.1-develop.19

2 years ago

2.0.0-develop.15

2 years ago

2.0.0-develop.16

2 years ago

2.0.0-develop.13

2 years ago

2.0.0-develop.11

2 years ago

2.1.0

2 years ago

2.2.0-PCM-1974.1

2 years ago

2.0.0-develop.8

2 years ago

2.0.0-develop.9

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.0-build.1

2 years ago

0.1.3-develop.6

2 years ago

0.1.2-fix-snyk.1

2 years ago

0.1.1-release.2

2 years ago

1.0.1-release.1

2 years ago

0.1.3-develop.5

2 years ago

0.1.2-release.1

2 years ago

0.1.2-develop.4

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.3

2 years ago

1.0.1-develop.7

2 years ago

0.1.3-release.1

2 years ago

0.1.1-develop.3

2 years ago

0.1.0-build.2

2 years ago

0.1.0

2 years ago