Ozeki VoIP SIP SDK provides revolutionary technology for creating your own SIP PBX.
To make your work easier it offers you default VoIP PBX behavior. This page
explains the essential terms concerning simple VoIP PBX functionalities and how you
can start to develop your own PBX with Ozeki SIP SDK.
Please be informed that PBX development support is available in Ozeki VoIP SIP SDK from version 10.0.
If you use an older version, please update your Ozeki SIP SDK. You can download the latest
version from the download page.
A Private Branch Exchange (PBX) is a hardware or software solution for establishing
communication lines between different types of communication end-points, regardless of using
wired, mobile or VoIP technology (Figure 1). The PBX establishes the communication line
between the end points through SIP accounts and SIP
The core PBX functionalities are provided by Ozeki VoIP SIP SDK. This article introduces how you can
implement a PBX software with default behavior. This simple PBX will be capable for
handling registration requests from any extensions with any SIP accounts, and the calling
process will be done in between two end points in the simplest way. It means that one
party calls a number and the end point with that number will ring. When the callee
answers the call, the phone line establishes and the communication can be done.
The following program code uses the background support of Ozeki VoIP SIP SDK,
therefore you will need to download and install Ozeki SIP 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.
When you want to write your own PBX software you will need to create a C# console application
as a PBX does not necessarily need a graphical user interface. You will need to set the Ozeki VoIP SIP SDK
as a reference for your project.
If you want to use the Ozeki provided tools without labeling, you will need some using
lines in the code (Code 1). These two directives are enough for the basic PBX functionality implementation.
Code 1 - Using the Ozeki VoIP SDK packages
As for using the inbuilt PBX functionality of Ozeki VoIP SIP SDK, your PBX class
needs to be derived from the PBXBase class provided by the SDK. This class implements a standard PBX
behavior that can be redefined if you wish. In this example, the PBX will use the
default behavior provided by Ozeki SIP SDK (Code 2).
class MyPBX : PBXBase
Code 2 - The PBX class needs to be derived from the PBXBase class
The constructor of the PBX class does not need to be rewritten, you can use the
one of the base class. In this example, the constructor is extended with some logging
information (Code 3) that is printed on the console. The main behavior of the constructor, however,
is not overridden.
public MyPBX(string localAddress, int minPortRange, int maxPortRange) : base(localAddress, minPortRange, maxPortRange)
Console.WriteLine("Local address: " + localAddress);
Code 3 - PBX constructor
The only method that you need to redefine in your PBX class is the one shown in Code 4.
You need to set the listening port for the PBX system in order to reach it
from the communication end points. The other code lines are printing log information
on the console.
The PBXBase class provides methods for extension registration and unregistration handling.
In this example these methods are extended with log printing instructions but above
that they use the provided implementation. Code 5 shows the registration method.
In Code 6 you can see the extension unregistration handling method. In this case the method is
just as simple as the registration one. It uses the Ozeki provided implementation extended with a
log printing instruction.
The PBX also needs to handle the call requests. The PBXBase class provides a standard
implementation for this purpose too, you only need to call it, or, as in this example, you can
extend it with some log printing (Code 7);
As you could see, implementing a basic PBX system is a piece of cake with Ozeki VoIP SIP SDK. In fact
you only needed to override the OnStart method for the proper running. All the other codes are
only for log extensions.