Ozeki VoIP SIP SDK offers reliable background and functionalities for developing a decent softphone.
Such a noted function is the ability to reject an incoming call. Please find below
the source codes that help you achieve call rejection with Ozeki SIP SDK.
In any kind of communication there is a need for the ability of choosing between
accepting or rejecting a call. The VoIP communication programs also need to support
call rejection as an elementary function (Figure 1).
Call rejection basically means that you do not want to communicate with the caller
either because of the person or because you have other duties to fulfill. In this case you can reject the call by
sending a message to the caller about the rejection. This is usually implemented
in a method and the operation itself is as simple as pressing the right button on the
graphical user interface (GUI).
Figure 1 - Rejecting an incoming call
The following program code uses the background support of Ozeki VoIP SIP SDK, therefore you will need
to download and install the SDK on your computer before starting to use the program code.
You will also need to have Visual Studio 2010 or compatible IDE and .NET Framework
installed on your system, as the program code below is written in C# language.
Implementing Call Rejection with Ozeki VoIP SIP SDK
As Ozeki VoIP SIP SDK provides all the background support for VoIP calls, you only need to
implement some basic functionality for your softphone application.
If you want to reject an incoming call, first you need to realize that there is an incoming
call in progress. For this purpose you can use the following code snippet shown in Code 1.
Code 1 - This code runs in case of an incoming call
When you realize that there is an incoming call, you can decide to accept or reject it.
These actions can be made by pressing a button on the softphone GUI. If you want to reject the call
you will need to press the Hang Up button.
Code 2 shows the event handler method for the Hang Up button's Click event that will
run when you press the button. As it is seen the method is really simple. As the
button has double functionality, the whole method needs a check for an existing call.
If there is an established call, pressing the Hang Up button will end it.
The call rejection itself is only a method call as the actual functionality is implemented in
Ozeki VoIP SIP SDK. The only thing that matters here that you set the right
logical expression for the check. You need to reject a call when there is an incoming call
and that call is in ringing status that means it was not accepted yet.
As you can see, VoIP solutions get an extraordinary background support from Ozeki VoIP SIP SDK.
Call rejection is only one of the functionalities that can be performed easily
with Ozeki VoIP SIP SDK. If you want your softphone work properly with the less
code writing, you need to use Ozeki VoIP SIP SDK.
This article explores all the knowledge about rejecting an incoming call
with Ozeki VoIP SIP SDK that can help you fulfill your goals. If you have read
through this page carefully, you already have all the knowledge you need to
start your own solution.