How to read Bluetooth Headset buttons
with Ozeki VoIP SIP SDK using C#?

This example demonstrates how to fetch events generated by pressing bluetooth buttons. You can connect these events to your C# application and catch them by an active window. If a window pops up it becomes active. It is a great way to accept or reject incoming calls.

Do not forget that your bluetooth headsets must be paired with the machine that runs Ozeki VoIP SIP SDK. You will know that it is paired from the constantly glowing blue LED. If the LED is flashing your device is turned on, although it is not paired. Use a bluetooth adapter to pair it.

Remember that you need to INVITE SIP requests to answer the call, which you can fully understand if you study How to register to a SIP PBX chapter and the How to accept incoming call chapter first. Keep in mind that you need to have Ozeki VoIP SIP SDK installed, and a reference to ozeki.dll should be added to your C# project. Try out this example with Visual Studio.

how to accept a call with a bluetooth headset
Figure 1 - How to accept a call with a Bluetooth Headset


A short reminder how to accept calls
Softphones created by the Ozeki VoIP SIP SDK can get notifications of incoming calls by subscribing to the Incmoning Call event of the softphone's object. You can accept the call if the event occurs with the Answer() method which you can find in the call object. Answer() changes the call's state to 'InCall'.

Connect your Bluetooth Headset to Windows

Our example works on Microsoft Windows, but keep in mind to plug in an USB Bluetooth adapter before connecting your Bluetooth Headset. Turn on your headset and connect it to the operating system (Figure 2).

connect your bluetooth headset
Figure 2 - Connect your Bluetooth Headset

Logging bluetooth buttons

Find a great example in Ozeki VoIP SIP SDK that logs any bluetooth keypress (Figure 3).

button events detected
Figure 3 - Button events detected (example in VoIP SIP SDK)

Basicly there are two example projects for the same solution:

You can find them in the following directory:

C:\Users\user\Documents\Ozeki\Ozeki SDK\Examples\VoIP\06_DevelopersGuide\01_SoftphoneBasic