General5 views

PJSIP Static Trunk IP-to-IP without Registration

Example of configuring a static SIP trunk with the sip.skytel24.com server

PJSIP (PJSUA-API) is a powerful library for setting up VoIP, SIP, and multimedia applications. In this example, we will look at how to configure a static SIP trunk to connect to the sip.skytel24.com server without the need for registration.

What is a SIP Trunk?

A SIP trunk is a method for transmitting voice traffic over the Internet or private IP networks using the SIP (Session Initiation Protocol). This helps reduce costs and simplifies system scalability.

Static SIP Trunk: Key Benefits

  1. No need for registration: Devices or nodes connect directly via IP addresses, eliminating the need for regular registration on a SIP server.
  2. Low latency: Direct connection between nodes minimizes latency, which is especially important for real-time applications.
  3. Increased reliability: Eliminating the SIP server as a single point of failure improves connection reliability.
  4. Simplified setup: The absence of complex authentication and registration mechanisms simplifies system setup and maintenance.

Configuring a Static SIP Trunk with PJSIP for the sip.skytel24.com Server

1. Installing PJSIP

Before configuration, you need to install PJSIP. Download the library's source code from the official website and build it:

git clone https://github.com/pjsip/pjproject.git
cd pjproject
./configure
make
sudo make install

2. Configuring PJSIP

After installing PJSIP, configure the configuration files for the static SIP trunk. The example configuration for PJSIP with the sip.skytel24.com server is as follows:

[skytel_sip_trunk]
type=endpoint
context=skytel-trunk
disallow=all
allow=ulaw
transport=udp
aors=skytel_sip_trunk_aor

[skytel_sip_trunk_aor]
type=aor
contact=sip:sip.skytel24.com:5060

[sip_trunk_auth]
type=auth
auth_type=userpass
username=your_username
password=your_password

[sip_trunk_identify]
type=identify
endpoint=skytel_sip_trunk
match=sip.skytel24.com

3. Configuring Call Routing

For the SIP trunk to work correctly, configure call routing. This is done in the context specified in the configuration:

[skytel-trunk]
exten => _X.,1,NoOp(Incoming call via SIP trunk)
exten => _X.,2,Set(CALLERID(num)=372XXXXXXX)
same => n,Dial(SIP/${EXTEN}@skytel_sip_trunk)
same => n,Hangup()

4. Starting and Testing

After configuring the configuration files, restart the SIP service and test the connection:

sudo systemctl restart asterisk

To test, you can use a SIP client such as Linphone or Zoiper and make a call to the configured static SIP trunk.

Connect now: SIP-trunk for Business Communication from SkyTel OU

SIP-trunk is a telephone line using the SIP protocol.
Thus, a VoIP service provider such as SkyTel can connect one or more channels to a PBX.

We offer only the highest quality CallerID-enabled communications with savings of up to 70%.

 

Was this article helpful?