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
Add the users
User1: (username:test1, password:1234, domain:10.0.0.4), User2: (username: test2, password:1234, domain:10.0.0.4).
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: email@example.com, password: 1234, Proxy: 10.0.0.4, Proxy Port: 5060)
And now Click på “Sign in” and the user test1 is now “online”.
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.
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:
Contact:: sip:firstname.lastname@example.org:56347;ob Q=
Contact:: sip:email@example.com:53577;transport=udp;registering_acc=10_0_0_4 Q=
You can also do this (# ./opensipsctl ul show). Now test1 is calling test2 :
6- 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.
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.