OpenSIPS Provisioning for a simple SIP Call

It is very easy to configure and manage OpenSIPS through OpenSIPS-CP.

Add the domains that OpenSIPS is responsible for

Lets add any domain (like 10.0.0.4 just for test). click on System menu –> Domains

snapshot8

Add the users

Now we can add users to that domain. click on “Users” –> “User Management” snapshot9

User1: (username:test1, password:1234, domain:10.0.0.4), User2: (username: test2, password:1234, domain:10.0.0.4).

Jitsi2

Register the users and make the call (user2 –> user1)

Now we have two users: user1 and user2 and we want test2 to call test1.  Users must be registered first from SIP clients installed by the users.  Here you can find a list of open source and free SIP clients: List of Free and Open-Source SIP Software.  I recommend Jitsi,  Linphone, and CSipSimple.

Now i am using Jitsi for test1 on my laptop and i have entered the following account information in Jitsi interface:

( SIP id: test1@10.0.0.4, password: 1234, Proxy: 10.0.0.4, Proxy Port: 5060)

And now Click på “Sign in” and the user test1 is now “online”.

Jitsi

I will make test2 register itself from my mobile where i have downloaded CSipSimple SIP client on it. My mobile phone and my laptop are in the same LAN. The laptop has the OpenSIPS and local SIP client (Jitsi). The laptop is protected by firewall.

Firewall rules

Everything is OK but test2 (on mobile phone) can not register itself. WHY because the firewall prevents this access. So i have to let the firewall allows SIP traffic to come to the OpenSIPS. We need to open the ports that the OpenSIPS is listening on. In my case the UDP ports 5060-5061.  To do this use dynamic firewall with Firewalld  or static firewall (system-config-firewall) with iptables.  Using static firewall means disabling and stopping of dynamic firewall.

For Firewalld you can either use the graphical configuration tool firewall-config or the command line client firewall-cmd. More information is here Firewalld

More information about editing iptables rules is here: Iptables

Note: Be aware of these “enable”, “disable”, “start”,  “stop” when using “systemctl” command.

“opensipsctl” Tool to see the Registered Users

To take information about the regitered users.

# cd /usr/local/opensips_1_11/sbin/

# ./opensipsctl fifo ul_dump
And this is the output:

AOR:: test2
Contact:: sip:test2@10.0.0.3:56347;ob Q=
Expires:: 894
Callid:: Vd8CYS9wJO7ffGoNAembj-bnC5Rte-k3
Cseq:: 55430
User-agent:: CSipSimple_MT15i-10/r2330
State:: CS_SYNC
Flags:: 0
Cflags::
Socket:: udp:10.0.0.4:5060
Methods:: 8063
AOR:: test1
Contact:: sip:test1@10.0.0.4:53577;transport=udp;registering_acc=10_0_0_4 Q=
Expires:: 521
Callid:: 3586ed724fb54b2e7505f24627e93ff6@0:0:0:0:0:0:0:0
Cseq:: 36
User-agent:: Jitsi2.2.4603.9615Linux
State:: CS_SYNC
Flags:: 0
Cflags::
Socket:: udp:10.0.0.4:5060
Methods:: 4294967295

You can also do this (# ./opensipsctl ul show). Now test1 is calling test2 :

Jitsi36- Get the Dialog Information from the OpenSIPS-CP Web Interface

During the call establishment, click on “System” menu –> “Dialog”. See the figures below of dialog early state and confirmed state.

dialog1

dialog2

What will be different if we want to deploy such a system ?

The answer is the existence of NAT.  I will explain this problem and how to solve it later.


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s