Giter Club home page Giter Club logo

jabra-node-sdk's Introduction

Jabra Node.js SDK

This is the monorepo for the new Jabra Node.js SDK (a Windows/Linux/macOS native jabra SDK wrapper) and related helpers, demos and tests.

This new Jabra Node.js SDK is based on N-API and is thus Application Binary Interface (ABI) stable across versions of Node.js. It is also maintained as a core part of Node.js and known to work more easily with Electron (https://electronjs.org/) across versions.

For more information, refer to the individual README files in each project folder linked below or the common references at the bottom of this page.

Project contents

Common references

Versioning schme

This project 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.

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

Credits

See github site for current contributors.

Original GN authors (from before source was released on github):

  • Morten Frederiksen
  • Steffen Klausen
  • Sudeep Kumar
  • Morten M. Christensen

jabra-node-sdk's People

Contributors

dependabot[bot] avatar dlaezza-jabra avatar extvpadmanabhan avatar frederiksen avatar martin-jabra avatar mmc41 avatar mnoerlev avatar pehandersen-jabra avatar tfroehlich-jabra avatar

jabra-node-sdk's Issues

SDK not working with Electron's context isolation

I've tried to run the SDK with contextIsolation set to true. And thus doing the renderer calls from the demo project in preload.js. But I'm getting:

TypeError: Cannot read properties of undefined (reading 'sendToFrame')

Is there a way (example) how to run the SDK in context isolation mode?

Undocking emits btnPress twice

NodeJs v8.16.1
Electron 2.0.18
jabra-node-sdk 2.0.0-beta.2
Device Jabra Pro 9470

When I undock headphones
Expect btnPress is emitted with btn type 1 and value true

Current behaviour:
btnPress is emitted with btn type 1 and value true
after few seconds btnPress is emitted again with btn type 1 and value false

Same issue happens when I use multifunctional button
I click on button
btnPress is emitted with btn type 1 and value true
after few seconds btnPress is emitted again with btn type 1 and value false

Apple M1 mac support planned?

On an electron app built with electron-builder --mac --arm64 M1 mac I get an error on startup:

dyld: Symbol not found: _Jabra_SetAppID

I presume it is just missing a dyld that is compiled for M1, is this dyld already available from Jabra and just missing in this project or do we have to wait for Jabra to support M1 macs?

`btnPress` not registered for device when ringing

Testing the SDK with a Jabra Engage 75 it does not register the btnPress when trying to answer a call via the headset or base stattion. Rejecting the call works fine.

btnPress sends a line busy if the device is not ringing.

Undocking doesn't emit btnPress event

NodeJs v8.16.1
Electron 2.0.18
jabra-node-sdk 2.0.0-beta.2
Device Jabra Engage 75

Undock headphones
btnPress is not emitted
Press multifunctional button
btnPress is triggered 3 times
24 true
21 true
18 true
Press multifunctional button
btnPress is triggered 3 times
24 false
21 false
18 false
Press multifunctional button
btnPress is triggered 3 times
24 true
21 true
18 true
Dock headphones
btnPress is triggered 3 times
24 false
21 false
18 false
Undock headphones
btnPress is not emitted

I think btnPress should be emitted when I undock headphones

setHidWorkingStateAsync returns error code 3

Version: jabra-node-sdk 3.0.0-beta.1
Modal: Jabra Evolve 75 & Jabra Link 370
NodeJS: 10.13
Electron: 4.1.0

When connecting a device (Jabra Evolve 75) with Bluetooth (Jabra Link 370) device we get the following error after calling setHidWorkingStateAsync(enumHidState.GN_HID) on the Jabra Evolve 75 device.

   // after device attached.
 device.setHidWorkingStateAsync(enumHidState.GN_HID) // Enable GN hid. 
  .then( () => {
    // btn listeners
    device.on('btnPress', (btnType, btnValue) => {
      logger.log(`New input from device ${device.deviceName} is received: type ${btnType} ${enumDeviceBtnType[btnType]} value: ${btnValue}`);
    });
  })
  .catch((e) => {
    logger.log(`setHidWorkingStateAsync: ${e}`); // Exception (Error: JAsyncWorker execute failure: napi_SetHidWorkingState got Jabra_SDK error 3) when bluetooth device is attached. 
  });

Error: JAsyncWorker execute failure: napi_SetHidWorkingState got Jabra_SDK error 3

It works great when connected to the headset with a wire, but throws the exceptions when connected with Bluetooth.

Are we doing something wrong? πŸ€”

Headset audio gets interrupted when base is ringing

I am using Jabra PRO 930 when the base is ringing our headset stop to playing sounds. I would like to keep the base ringing without stop an audio on headset.

Example: I am listening music on browser, then ringAsync() method is called on another installed application on windows, the music gonna be interrupted to play the ringtore, it seems Jabra SDK takes priority over audio from PC audio. How can I keep both??

I am using the example below but is not working. Does anyone knows how that functionality can be implemented, I checked the documentation but can’t find a way to do it so far.

  device &&
    device.deviceName === 'Jabra PRO 930' &&
    device
      .isRingerSupportedAsync()
      .then(supported => {
        if (supported) {
          device
            .ringAsync()
            .then(() => {
               console.log('ringing');
            }).catch(err => {
               console.log('ring failed with error ' + err);
            });
        }
      }).catch(err => {
         console.error('Jabra call failed with error ' + err);
      });

What devices are supported with the new nodeJS v2. SDK ?

I can't find a list of supported devices on this new SDK.

The supported device on the old SDK was.:

PRO 9470, 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 /80, Link 265, Evolve 30 ||, Evolve 20, Biz 1500, Biz 2400 II, Evolve 30, Link 260, Evolve 75
Motion UC (Over BT)
Link 360, Link 370
Speak 410, Speak 510, Speak 710, Speak 810

Thanks in advance

Some crashes on Windows Electron app caused by "libjabra" dll

Looking at our crash data, I noticed some crashes related to jabra

I'm using jabra-node-sdk v2.0.0 in a 32-bit Windows application

Can you please supply the symbols (.pdb files) for your binaries included in the npm package so we can get a good stack trace to help you resolve these issues?

image

Crash dump data

DBGHELP: libjabra - no symbols loaded
ExceptionAddress: 0bdeb891 (libjabra+0x000bb891)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 00000a08
Attempt to read from address 00000a08
eax=00000000 ebx=00000002 ecx=00000000 edx=0068d898 esi=00000000 edi=0e277ae0
eip=0bdeb891 esp=0f5af388 ebp=0f5af398 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
libjabra+0xbb891:
0bdeb891 8bbe080a0000    mov     edi,dword ptr [esi+0A08h] ds:002b:00000a08=????????
  *** Stack trace for last set context - .thread/.cxr resets it
ChildEBP RetAddr  
WARNING: Stack unwind information not available. Following frames may be wrong.
0f5af398 0bdde0e1 libjabra+0xbb891
0f5af3b4 0bde18f4 libjabra+0xae0e1
0f5af408 0bde2093 libjabra+0xb18f4
0f5af420 0bdb3e80 libjabra+0xb2093
0f5af454 0bd59ff8 libjabra+0x83e80
SYMSRV:  BYINDEX: 0x16
         z:\ossymbols*http://symproxyelb-371495734.us-east-1.elb.amazonaws.com/symbols
         sdkintegration.node
         5E30444Bd7000
SYMSRV:  UNC: z:\ossymbols\sdkintegration.node\5E30444Bd7000\sdkintegration.node - path not found
SYMSRV:  UNC: z:\ossymbols\sdkintegration.node\5E30444Bd7000\sdkintegration.nod_ - path not found
SYMSRV:  UNC: z:\ossymbols\sdkintegration.node\5E30444Bd7000\file.ptr - path not found
SYMSRV:  HTTPGET: /symbols/sd/sdkintegration.node/5E30444Bd7000/sdkintegration.node
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/sd/sdkintegration.node/5E30444Bd7000/sdkintegration.nod_
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/sd/sdkintegration.node/5E30444Bd7000/file.ptr
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  RESULT: 0x80190194
SYMSRV:  BYINDEX: 0x17
         z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7
         sdkintegration.node
         5E30444Bd7000
SYMSRV:  PATH: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\sdkintegration.node\5E30444Bd7000\sdkintegration.node
SYMSRV:  RESULT: 0x00000000
DBGHELP: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\sdkintegration.node\5E30444Bd7000\sdkintegration.node - OK
DBGENG:  z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\sdkintegration.node\5E30444Bd7000\sdkintegration.node - Mapped image memory
0f5af540 0bd59e8f libjabra+0x29ff8
SYMSRV:  BYINDEX: 0x18
         z:\ossymbols*http://symproxyelb-371495734.us-east-1.elb.amazonaws.com/symbols
         node_sqlite3.node
         5E30447710d000
SYMSRV:  UNC: z:\ossymbols\node_sqlite3.node\5E30447710d000\node_sqlite3.node - path not found
SYMSRV:  UNC: z:\ossymbols\node_sqlite3.node\5E30447710d000\node_sqlite3.nod_ - path not found
SYMSRV:  UNC: z:\ossymbols\node_sqlite3.node\5E30447710d000\file.ptr - path not found
SYMSRV:  HTTPGET: /symbols/no/node_sqlite3.node/5E30447710d000/node_sqlite3.node
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/no/node_sqlite3.node/5E30447710d000/node_sqlite3.nod_
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/no/node_sqlite3.node/5E30447710d000/file.ptr
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  RESULT: 0x80190194
SYMSRV:  BYINDEX: 0x19
         z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7
         node_sqlite3.node
         5E30447710d000
SYMSRV:  PATH: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\node_sqlite3.node\5E30447710d000\node_sqlite3.node
SYMSRV:  RESULT: 0x00000000
DBGHELP: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\node_sqlite3.node\5E30447710d000\node_sqlite3.node - OK
DBGENG:  z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\node_sqlite3.node\5E30447710d000\node_sqlite3.node - Mapped image memory
SYMSRV:  BYINDEX: 0x1A
         z:\ossymbols*http://symproxyelb-371495734.us-east-1.elb.amazonaws.com/symbols
         sdkintegration.pdb
         A73A832FCE6C45649A6FCE1189A7E24F1
SYMSRV:  UNC: z:\ossymbols\sdkintegration.pdb\A73A832FCE6C45649A6FCE1189A7E24F1\sdkintegration.pdb - path not found
SYMSRV:  UNC: z:\ossymbols\sdkintegration.pdb\A73A832FCE6C45649A6FCE1189A7E24F1\sdkintegration.pd_ - path not found
SYMSRV:  UNC: z:\ossymbols\sdkintegration.pdb\A73A832FCE6C45649A6FCE1189A7E24F1\file.ptr - path not found
SYMSRV:  HTTPGET: /symbols/sd/sdkintegration.pdb/A73A832FCE6C45649A6FCE1189A7E24F1/sdkintegration.pdb
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/sd/sdkintegration.pdb/A73A832FCE6C45649A6FCE1189A7E24F1/sdkintegration.pd_
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/sd/sdkintegration.pdb/A73A832FCE6C45649A6FCE1189A7E24F1/file.ptr
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  RESULT: 0x80190194
SYMSRV:  BYINDEX: 0x1B
         z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7
         sdkintegration.pdb
         A73A832FCE6C45649A6FCE1189A7E24F1
SYMSRV:  PATH: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\sdkintegration.pdb\A73A832FCE6C45649A6FCE1189A7E24F1\sdkintegration.pdb
SYMSRV:  RESULT: 0x00000000
*** WARNING: Unable to verify checksum for sdkintegration.node
DBGHELP: sdkintegration - private symbols & lines 
        z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\sdkintegration.pdb\A73A832FCE6C45649A6FCE1189A7E24F1\sdkintegration.pdb
0f5af5e0 0badcb31 libjabra+0x29e8f
(Inline) -------- sdkintegration!napi_SetRinger::__l2::<lambda_5375ed3bd864232e3eec75bf195d3f2f>::operator()+0xb [c:\jenkins-slave\workspace\desktop-v2\rb-services\node_modules\@gnaudio\jabra-node-sdk\src\main\device.cc @ 94]
(Inline) -------- sdkintegration!std::_Invoker_functor::_Call+0x14 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1375]
(Inline) -------- sdkintegration!std::invoke+0x14 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1443]
(Inline) -------- sdkintegration!std::_Invoke_ret+0x14 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1461]
0f5af628 0bac94e6 sdkintegration!std::_Func_impl<<lambda_5375ed3bd864232e3eec75bf195d3f2f>,std::allocator<int>,void,unsigned short,bool>::_Do_call(unsigned short * <_Args_0> = 0x0f5af63c, bool * <_Args_1> = 0x0f5af638)+0x31 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional @ 212]
(Inline) -------- sdkintegration!std::_Func_class<void,unsigned short,bool>::operator()+0x19 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional @ 279]
(Inline) -------- sdkintegration!std::_Invoker_functor::_Call+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1375]
(Inline) -------- sdkintegration!std::invoke+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1443]
(Inline) -------- sdkintegration!std::_Invoke_ret+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1475]
(Inline) -------- sdkintegration!std::_Call_binder+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional @ 825]
(Inline) -------- sdkintegration!std::_Binder<std::_Unforced,std::function<void __cdecl+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional @ 881]
(Inline) -------- sdkintegration!std::_Invoker_functor::_Call+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1375]
(Inline) -------- sdkintegration!std::invoke+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1443]
(Inline) -------- sdkintegration!std::_Invoke_ret+0x23 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits @ 1461]
0f5af63c 0baa59f7 sdkintegration!std::_Func_impl<std::_Binder<std::_Unforced,std::function<void __cdecl(void)+0x26 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional @ 214]
(Inline) -------- sdkintegration!std::_Func_class<void>::operator()+0x11 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional @ 279]
0f5af81c 0baa4290 sdkintegration!util::JAsyncWorker<void,void>::Execute(void)+0x117 [c:\jenkins-slave\workspace\desktop-v2\rb-services\node_modules\@gnaudio\jabra-node-sdk\src\main\napiutil.h @ 404]
DBGENG:  Rainbow.exe - Partial symbol image load missing image info
DBGHELP: Module is not fully loaded into memory.
DBGHELP: Searching for symbols using debugger-provided data.
SYMSRV:  BYINDEX: 0x1C
         z:\ossymbols*http://symproxyelb-371495734.us-east-1.elb.amazonaws.com/symbols
         electron.exe.pdb
         28BD83B40697ABF54C4C44205044422E1
SYMSRV:  UNC: z:\ossymbols\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\electron.exe.pdb - path not found
SYMSRV:  UNC: z:\ossymbols\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\electron.exe.pd_ - path not found
SYMSRV:  UNC: z:\ossymbols\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\file.ptr - path not found
SYMSRV:  HTTPGET: /symbols/el/electron.exe.pdb/28BD83B40697ABF54C4C44205044422E1/electron.exe.pdb
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/el/electron.exe.pdb/28BD83B40697ABF54C4C44205044422E1/electron.exe.pd_
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /symbols/el/electron.exe.pdb/28BD83B40697ABF54C4C44205044422E1/file.ptr
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  RESULT: 0x80190194
SYMSRV:  BYINDEX: 0x1D
         z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7
         electron.exe.pdb
         28BD83B40697ABF54C4C44205044422E1
SYMSRV:  UNC: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\electron.exe.pdb - path not found
SYMSRV:  UNC: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\electron.exe.pd_ - path not found
SYMSRV:  UNC: z:\symbolservers\rainbow_electron\rainbow_prod-6.1.7\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\file.ptr - path not found
SYMSRV:  RESULT: 0x80070003
SYMSRV:  BYINDEX: 0x1E
         z:\symbolservers\electron*https://electron-symbols.githubapp.com
         electron.exe.pdb
         28BD83B40697ABF54C4C44205044422E1
SYMSRV:  PATH: z:\symbolservers\electron\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\electron.exe.pdb
SYMSRV:  RESULT: 0x00000000
*** WARNING: Unable to verify timestamp for Rainbow.exe
DBGHELP: Rainbow - private symbols & lines 
        z:\symbolservers\electron\electron.exe.pdb\28BD83B40697ABF54C4C44205044422E1\electron.exe.pdb
0f5af86c 04e5414c sdkintegration!Napi::AsyncWorker::OnExecute(struct napi_env__ * __formal = 0x0a8e2f30, void * this_pointer = 0x1355f448)+0x40 [c:\jenkins-slave\workspace\desktop-v2\rb-services\node_modules\node-addon-api\napi-inl.h @ 3723]
0f5af87c 049363fd Rainbow!`anonymous namespace'::uvimpl::Work::DoThreadPoolWork(void)+0xc [C:\projects\src\third_party\electron_node\src\node_api.cc @ 865]
0f5af888 04936608 Rainbow!uv__queue_work(struct uv__work * w = 0x10f1f2a0)+0xd [C:\projects\src\third_party\electron_node\deps\uv\src\threadpool.c @ 321]
0f5af8a4 03eaae60 Rainbow!worker(void * arg = <Value unavailable error>)+0xe8 [C:\projects\src\third_party\electron_node\deps\uv\src\threadpool.c @ 122]
0f5af8bc 05485838 Rainbow!uv__thread_start(void * arg = 0x0aebe298)+0x40 [C:\projects\src\third_party\electron_node\deps\uv\src\win\thread.c @ 108]
SYMSRV:  BYINDEX: 0x1F
         z:\ossymbols*http://symproxyelb-371495734.us-east-1.elb.amazonaws.com/symbols
         wkernel32.pdb
         B91340B043A34C5EAEE3C21EDC192CF62
SYMSRV:  PATH: z:\ossymbols\wkernel32.pdb\B91340B043A34C5EAEE3C21EDC192CF62\wkernel32.pdb
SYMSRV:  RESULT: 0x00000000
*** WARNING: Unable to verify checksum for kernel32.dll
DBGHELP: kernel32 - public symbols  
        z:\ossymbols\wkernel32.pdb\B91340B043A34C5EAEE3C21EDC192CF62\wkernel32.pdb
0f5af8f4 76d7343d Rainbow!thread_start<unsigned int (void * parameter = 0x0ae85348)+0x58 [C:\projects\src\out\Default\minkernel\crts\ucrt\src\appcrt\startup\thread.cpp @ 115]
0f5af900 777a9812 kernel32!BaseThreadInitThunk+0xe
0f5af940 777a97e5 ntdll!__RtlUserThreadStart+0x70
0f5af958 00000000 ntdll!_RtlUserThreadStart+0x1b

If device.ringAsync() is used, a default Jabra ringtone will be played

If we use device.setHidWorkingStateAsync(enumHidState.GN_HID) with Jabra Speak 510

And then we call device.ringAsync()

The device will ring properly and the LEDs will flash as required. However, there's an issue because a default Jabra ringtone will be played.

This behavior is undesired. We want to respect the ringtone the user chose in our application, and not use a random Jabra ringtone.

Is there a way to disable this behavior and not play a ringtone? Just flash the LEDs?

It appears this issue does not exist if we don't call device.setHidWorkingStateAsync(enumHidState.GN_HID). However we have to do that in order to receive offhook events as mentioned in #3.

In the old SDK (v1), the default ringtone will also be played.

Thanks in advance.

Code (How we add a call to the device):

await this.device.onhookAsync();
if (incoming) {
    await this.device.ringAsync();
} else {
    await this.device.unringAsync();
}
await this.device.unmuteAsync();

Calling onhookAsync() also fires button press event?

Using @gnaudio/jabra-node-sdk v3.0.0
Headset: Jabra evolve 75 with Jabra Link 370

When setting the device onHook it fires the button (btn) press event too. Is that a bug?
What I did.:

  • Calling device.onhookAsync();
  • The button event listener is also fired
device.on('btnPress', (btnType, btnValue) => {
  logger.log(`New input from device ${device.deviceName} is received: type ${btnType} ${enumDeviceBtnType[btnType]} value: ${btnValue}`);
}

Outputs:
New input from device Jabra Link 370 is received: type 1 OffHook value: false

I understand that setting the device onHook on the device should fire the button event, but why fire a button event when no button was pressed?

Fails to build on Mac and Windows Machines [electron-builder] [electron]

Context

We are using this library in order to intercept the Jabra physical button clicks. It's used inside of an electron wrapper and locally everything seems to be working as expected.

But, once we try to build the dmg or exe file, the build process fails every single time with this error:

  β€’ electron-builder  version=22.10.4 os=19.4.0
  β€’ rebuilding native dependencies  dependencies=@gnaudio/[email protected] platform=darwin arch=x64
  β€’ rebuilding native dependency  name=@gnaudio/jabra-node-sdk version=3.2.1
  β€’ rebuilding native dependencies  dependencies=@gnaudio/[email protected] platform=darwin arch=x64
  β€’ rebuilding native dependency  name=@gnaudio/jabra-node-sdk version=3.2.1
  β¨― cannot execute  cause=exit status 1
                    out=$ node-gyp rebuild
      COPY Release/libjabra.dylib
      CXX(target) Release/obj.target/sdkintegration/src/main/app.o
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
                    errorOut=warning ../../../package.json: No license field
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | darwin | x64
    gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
    gyp http GET https://electronjs.org/headers/v11.2.3/node-v11.2.3-headers.tar.gz
    gyp http 200 https://electronjs.org/headers/v11.2.3/node-v11.2.3-headers.tar.gz
    gyp http GET https://electronjs.org/headers/v11.2.3/SHASUMS256.txt
    gyp http 200 https://electronjs.org/headers/v11.2.3/SHASUMS256.txt
    gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
    gyp info spawn args [
    gyp info spawn args   '/usr/local/Cellar/node/14.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
    gyp info spawn args   'binding.gyp',
    gyp info spawn args   '-f',
    gyp info spawn args   'make',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/distiller/electron/node_modules/@gnaudio/jabra-node-sdk/build/config.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/usr/local/Cellar/node/14.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/distiller/.electron-gyp/11.2.3/include/node/common.gypi',
    gyp info spawn args   '-Dlibrary=shared_library',
    gyp info spawn args   '-Dvisibility=default',
    gyp info spawn args   '-Dnode_root_dir=/Users/distiller/.electron-gyp/11.2.3',
    gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/14.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
    gyp info spawn args   '-Dnode_lib_file=/Users/distiller/.electron-gyp/11.2.3/<(target_arch)/node.lib',
    gyp info spawn args   '-Dmodule_root_dir=/Users/distiller/electron/node_modules/@gnaudio/jabra-node-sdk',
    gyp info spawn args   '-Dnode_engine=v8',
    gyp info spawn args   '--depth=.',
    gyp info spawn args   '--no-parallel',
    gyp info spawn args   '--generator-output',
    gyp info spawn args   'build',
    gyp info spawn args   '-Goutput_dir=.'
    gyp info spawn args ]
    gyp info spawn make
    gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    rm: ./Release/.deps/Release/obj.target/sdkintegration/src/main/app.o.d.raw: No such file or directory
    make: *** [Release/obj.target/sdkintegration/src/main/app.o] Error 1
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/14.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
    gyp ERR! System Darwin 19.4.0
    gyp ERR! command "/usr/local/Cellar/node/14.2.0/bin/node" "/usr/local/Cellar/node/14.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/distiller/electron/node_modules/@gnaudio/jabra-node-sdk
    gyp ERR! node -v v14.2.0
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok 
    error Command failed with exit code 1.
    
                    command=/usr/local/Cellar/node/14.2.0/bin/node /usr/local/Cellar/yarn/1.22.4/libexec/bin/yarn.js run install
                    workingDir=/Users/distiller/electron/node_modules/@gnaudio/jabra-node-sdk
(node:746) UnhandledPromiseRejectionWarning: Error: /Users/distiller/electron/node_modules/app-builder-bin/mac/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/Users/distiller/electron/node_modules/builder-util/src/util.ts:243:14)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:746) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:746) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Versions:

Electron: 11.2.3
Electron builder: 22.10.4
@gnaudio/jabra-node-sdk: 3.2.1
OS: VM with xcode:11.5.0 image
Node: 14.2.0
Node-gyp: 5.1.0

We tried downgrading the node version and nothing has changed basically :( do you happen to know what's going on here?

Here a link to a reproducible repo: https://github.com/kamalbennani/jabra-sdk-example

You basically just need to run: yarn dist on your local machine and you will see the same error as the one above.

RejectCall action btnValue alternates between true/false

Noticed that the RejectCall btnValue that's triggered from the headset seems to alternate between true/false? Does the device need to be set to a specific state to get it to consistently return RejectCall with btnValue true? Or does the btnValue for this action not matter?

In the flow diagram for rejecting calls, I also noticed that 'RejectCall' enumType isn't being used, so wondering if this is not the recommended way to reject a call?
Screen Shot 2020-03-24 at 9 22 19 PM

Use case/steps to reproduce:
Headset Jabra Engage 50

Incoming call -> set device to ringing -> device rejects call, sends RejectCall with btnValue=True to app -> app ends call -> device stops ringing

Second incoming call -> set device to ringing -> device rejects call, this time sends with RejectCall btnValue = False

Managing multiple calls with Jabra devices

Hello guys,

Here's our use case:

  • User with 2 softphone apps on the desktop
  • Jabra device connected on the computer
  • Jabra device detected by both apps

Is there a way to solve the following issue?

  • Call 1 established on Softphone 1
  • Call 2 is received on Softphone 2 ==> Pressing the Call Answer button on the device disconnects Call 1 ==> Call 1 shall not be disconnected in that context

Thanks in advance!

isBatterySupportedAsync, getBatteryStatusAsync sometimes not responding back

hi i am using electron js

"electron": "^11.4.5",
const j = require("@gnaudio/jabra-node-sdk");

class Jabra {
    constructor() {
        this.jabra              = null;
        this.device             = null;
        this.isBatterySupport   = false;
        this.batteryInfo        = {};
        this.attached           = false;

        this.connectResolve     = function () {};
        this.connectReject      = function () {};
    }

    async connect(){
        let that = this;
        return new Promise(function (resolve, reject) {

            that.connectResolve = resolve;
            that.connectReject  = reject;

            if(that.jabra !== null){
               that.connectResolve(that.device);
            }
            else {
                that._connect();
            }
        });
    }

    _connect(){
        let that = this;
        j.createJabraApplication('123').then((jabra) => {
            that.jabra = jabra;

            this.jabra.on('attach', this.attachDevice.bind(that));
            this.jabra.on('detach', this.detachDevice.bind(that));

            setTimeout(() => {
                if (that.attached !== true) {
                    that.connectReject("jabra sdk time out");
                    that.close();
                }
            }, 10000);

        }).catch(function (e) {
            that.connectReject("jabra sdk connection error");
            console.log(e);
        });
    }

    attachDevice(device){
        this.attached = true;
        this.device = device;
        this.connectResolve(this.device);
    }

    async detachDevice(device){
        if (this.jabra.getAttachedDevices().length < 1) {
            await this.close();
        }
    }

    async requestBatteryInfo(){
        let that = this;
        console.log("being pronounced battery ...");
        return new Promise(function (resolve, reject) {
            let getInfo = false;
            that.device.isBatterySupportedAsync().then(async (supported)=>{
                that.isBatterySupport = supported;
                if(that.isBatterySupport) {
                    that.device.getBatteryStatusAsync().then(function (b1) {
                        that.batteryInfo = b1;
                        console.log("BATTERY", that.batteryInfo);
                        resolve(that);
                        getInfo = true;
                    }).catch(function (e) {
                        getInfo = true;
                        reject(e);
                    });
                }else{
                    getInfo = true;
                    reject("device not supported battery info");
                }
            }).catch(function (e) {
                console.log(e);
                reject(e);
                getInfo = true;
            });

            setTimeout(() => {
                if (getInfo !== true) {
                    reject("jabra device time out");
                }
            }, 25000);
        });
    }

    async close(){
        let that = this;
        try {
            await that.jabra.disposeAsync();
            that.clear();
        }catch (e) {
            //console.log(e);
            that.clear();
        }
    }

    clear(){
        this.attached           = false;
        this.device             = null;
        this.jabra              = null;
    }
}
export default Jabra;

while using

app.on('ready', async () => {
       let that = this;
       let sendData = {battery: null};

       if (that.jabraSdk === null) {
            that.jabraSdk = new Jabra();
        }

        that.jabraSdk.connect().then(async (device) => {
            console.log("jabra device connected");

            that.jabraSdk.requestBatteryInfo().then(function (jabra) {
                if (jabra.isBatterySupport) {
                    sendData = {battery: jabra.batteryInfo};
                    app.events.emit("headset_battery_info", sendData);
                } else {
                    app.events.emit("headset_battery_info", sendData);
                }
            }).catch(function (e) {
                console.log(e);
                app.events.emit("headset_battery_info", sendData);
            });
        }).catch((e) => {
            console.log(e);
            app.events.emit("headset_battery_info", sendData);
        });
});

When the application first starts, there is no problem, I get the battery information, but if I refresh a few times, I start to get time out after a while.

requestBatteryInfo method waits for 25 seconds and gives time error, when I exit the application, zombie processes remain in the task manager and the application does not kill properly.

TypeError: Cannot read property 'getBatteryStatusAsync' of null
    at eval (webpack:///./src/background/headset/Jabra.js?:158:33)
TypeError: Cannot read property 'getBatteryStatusAsync' of null
    at eval (webpack:///./src/background/headset/Jabra.js?:158:33)
TypeError: Cannot read property 'getBatteryStatusAsync' of null
    at eval (webpack:///./src/background/headset/Jabra.js?:158:33)

sometimes it can also point to the isBatterySupportedAsync method

Can't seem to turn off busylight after enabling it

First off it is a pleasure to work with this SDK πŸ‘But we have one issue we can't get to work.:

When on call we enable the busylight and disable it again after the call has ended, but it seems we can't turn it off after enabling it on the device.

Version: jabra-node-sdk 2.0.0-beta.3
Modal: Jabra Evolve 75
NodeJS: 10.13
Electron: 4.1.0

await device.setBusyLightStatusAsync(true); // <-- Turn on the busylight on the device - Works πŸŽ‰ 
await device.setBusyLightStatusAsync(false); // <-- Does not seem to work πŸ€” 

await device.getBusyLightStatusAsync(); // <-- returns true 

device.ringAsync() rings in silence and leaves the headphone in a ringing state

Problem:
I've been debugging the missing sound on Jabra evolve 75 when calling ringAsync(), the busylight blinks as excpected.

If I turn off the headphones without calling unringAsync() beforehand, the headphones turn on and starts playing a ringtone that can only be stopped by connecting to the computer and call unringAsync().

Expected behaviour:
Calling ringAsync() would start the busylight on the side, and the ringtone would start playing in the headphones.
Turning the headphones off would reset the state of the headphones.

Ive testet with the demoapp in this repository and it produces the same behavior

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.