Summary of experience in solving the problem of sip phone registration failure

This is the longest persistent problem since I learned to build the opensips server. Specifically, the terminal phone software has been unable to register the created sip session account. The terminal phone software I used at the beginning was Zoiper, which was either being registered all the time, or failed to register directly. Later, I searched online and downloaded Microsip again. It can display the reason for the registration failure, such as the request timed out, which is more convenient.

According to the online query, you can use the sngrep tool to capture and analyze packets. You need to download this tool for the first time:

#sudo apt-get install sngrep

Then directly sngrep

#sngrep

1e1f4d3fec1a4a1a8173518083995765.jpg

It felt like the sip server didn't receive any messages sent by the terminal at all. At first I thought it was a problem with the configuration file, such as the IP address or port number was not written correctly.

#cd /usr/local/etc/opensips

#vim opensips.cfg

#vim opensipsctlrc

#vim /etc/default/opensips

#vim /etc/init.d/opensips

There is no problem with the configuration. For the content of the specific configuration file, see http://t.csdn.cn/7NezY

I checked a lot of solutions on the Internet, such as modifying the /usr/local/etc/opensips/opensips.cfg configuration file:

b3cd65eb2b52423bac18570fc21fb7fc.jpg

 Adding your own sip server IP address still doesn't work. Modify the configuration of the control panel:

1af45db5c735420eb9d598fdb58476e3.jpg

03f6988d3ed841b684f2b1ffb7fd7090.jpg

0c35d751cfd34cd5a8c43e780f120a16.jpg 12b6ce8d2b76467087b44e4fbdc48a29.jpg

 No way.

Later, I saw on the Internet that it was because the firewall restricted port 5060, that is, port 5060 was still open.

#netstat -anp

#netstat -ulpn | Grip 5060

Display the occupancy of all ports/protocols, and there is no occupancy of 5060 as expected.

First of all, I think it may be the 5060 port restricted by the host firewall, and the information sent through the 5060 port cannot be received, so the following settings are made:

Control Panel—>Windows Firewall—>Advanced Settings—>Inbound Rules—>New Rules—>Port—>Protocol (udp)—>Specific Local Port (5060)—>Allow Connection—— > Tick "Domain, Private, Company" --> Name --> Done

Still didn't solve the problem.

Then the firewall of the sip server, open port 5060 with the command

#iptables -I INPUT -p tcp --dport 5060 -j ACCEPT

#iptables -I INPUT -p udp --dport 5060 -j ACCEPT

#iptables-save

Then executed #dmesg according to the instructions, and other problems occurred, such as:

16f67c2e3e454245a69878356727d9e0.jpg

 The online query said that the virtual disk capacity of the sip server is not enough, and the capacity needs to be increased:

#df -h

Query the space usage of each device:

283d81e2775644f1b328f005cf0410f8.png

 After changing the disk capacity allocated when the Ubuntu was built (the virtual machine needs to be shut down before changing), re-allocate (the specific method can be found online). Anyway, this wave of operation is still useless.

**************************************************

It should be that the command to open the port on the firewall is incorrect. The firewall used by Ubuntu 18.04 is found to be ufw:

① Check the status of the firewall

#sudo ufw status

a3a471d5e9004410aa47196fe0b4f7a7.png

 The firewall is enabled. If it is disabled, it can be enabled by #sudo ufw enable.

② Install firewalld and open port 5060.

#sudo apt-get install firewalld

#sudo firewall-cmd --permanent --add-port=560/udp

#sudo firewall-cmd --list-all

396cd9b2e81843d5a39aca6888025549.png

 ③Restart the firewall (emphasis)

#sudo systemctl reload firewalld

or

#firewall-cmd --reload

The sip account is still not registered successfully. After thinking hard, I found that the firewall may also restrict the udp protocol and not open the protocol. As shown in the figure above, the protocols item has no content.

#sudo firewall-cmd --permanent --add-protocol=udp

5e742c2e61234494a1333d661ef88219.png

Restart the firewall again #firewall-cmd --reload .

The Microsip phone is displayed online, and the problem has finally been solved:

83e9bf48fa0b4d34967d1ca77b76ca10.png

#netstat -ulpn | Grip 5060

There is also a 5060 port occupancy:

3ed68777832f425bb7206fdf60201371.png

 

 

 

Note: It is a personal study summary, please correct me if there is any mistake.

 

 

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/m0_51292856/article/details/129884963