Sipek Softphone

Written by

in

Building an open-source VoIP client using the Sipek Softphone SDK allows you to create a lightweight, SIP-compliant Windows application using C# and .NET. Sipek abstracts complex SIP signaling by embedding the robust open-source PJSIP stack underneath. Prerequisites & Requirements

To build and compile the application, ensure you have the following elements:

IDE: Visual Studio (Community Edition or newer) with .NET desktop development workloads.

SDK Components: The compiled SipekSdk.dll along with the underlying wrapper binaries (pjsipDll.dll).

SIP Credentials: An active extension from a Private Branch Exchange like an Asterisk Server or a third-party VoIP provider. 1. Architectural Structure A Sipek-based application relies on three core blocks:

The Media/SIP Engine (PJSIP): Handles audio processing, codecs, and raw network signaling.

Sipek SDK Layer: Exposes object-oriented C# wrappers like CCallManager and IAccount to manage application state.

The GUI Client: A WPF or Windows Forms project acting as the dialer interface. 2. Building the Client Application

Follow these steps to instantiate the VoIP core inside your Visual Studio solution:

Reference the Library: Add SipekSdk.dll to your project references. Ensure the native pjsipDll.dll binary is copied directly to your build output directory (/bin/Debug or /bin/Release).

Initialize the Factory: Initialize the VoIP factories upon application startup to bind your audio endpoints.

Configure Codecs: Activate baseline audio compression standards like PCMA or PCMU.

// Example instantiation inside your main form/window using Sipek.Common; using Sipek.Sip; public void InitializeVoIPEngine() { // Initialize the underlying PJSIP abstraction layer pjsipRegistrar.Instance.Initialize(); // Bind call manager events to update GUI elements CCallManager.Instance.CallStateChanged += OnCallStateChanged; CCallManager.Instance.IncomingCall += OnIncomingCall; } Use code with caution. 3. Configuring Account Settings & SIP Blocks

For the softphone to authenticate with your PBX, you must supply explicit user configuration files or settings blocks. Sipek processes connections utilizing standard ⁠SIP configurations:

Host/Domain: The destination IP address or domain name of your PBX. Username / SIP ID: The target extension or user identifier. Password: The unique security key mapping to the extension. Port: Default transmission port, typically 5060 for UDP.

To apply these parameters programmatically using Sipek’s interfaces:

public void RegisterAccount() { IAccountConfig config = new AccountConfig(); config.AccountName = “Office Extension”; config.HostName = “192.168.1.100”; // Your PBX IP config.Username = “401”; config.Password = “SecurePass123”; config.RegRequired = true; // Apply configuration and register with the server CCallManager.Instance.AccountManager.AddAccount(config); CCallManager.Instance.AccountManager.RegisterAll(); } Use code with caution. 4. Basic Call Handling Functionality