Tips：In a VoIP system, all communication is based on the IP network, most of the problems because of the network, this article describes the common errors and how to use ngrep this tool to find the problem.
Ngrep is the online version of the grep command, for more grep features to search for network packets. Because of the ngrep need to install libpcap library, it supports a large number of operating systems and network protocols. It can view TCP, UDP and ICMP packets, understand the filtering mechanism bpf.
In the process of debugging VOIP, the most commonly used commands are:
ngrep -deth0 -qWbyline "" port 5060
Where eth0 is the network card to be monitored, and 5060 is the port to be monitored. This command will list all packets that reach eth0 through port 5060.
ngrep -deth0 -qWbyline "INFO" port 5060 and host 192.168.1.123
This command will list all packets arriving from the IP address 192.168.1.123 to the NIC eth0 through port 5060.
ngrep -deth0 -qWbyline "^REGISTER" port 5060
This command will list all packets arriving at NIC eth0 through port 5060 containing REGISTER content. (For registration or cancellation)
ngrep -deth0 -qWbyline "astercc-5001@" port 5060
This command will list all packets arriving at NIC eth0 via port 5060, which contains the astercc-5001 information packets.
2、System devices Registration FAQs
1）Q: 408 request timeout：
A: When the extension can not be registered, can not see any other packets sent by ngrep, check the local firewall, execute command /etc/init.d/iptables stop to confirm that the firewall is not enabled, in the case of NAT (means the server after the router), make sure that port 5060 of udp protocol is correctly forwarded.
2）Q: 403 forbidden：
A: Please check register username and password.
3）Q: 484 Address Incomplete：
A: Try turning off the “video support” in the sip settings
4）Q: 488 Not Acceptable Here：
A: Make sure that the voice encoding settings are correct, including the central office and client.
3、Devices when the call, silent, single-pass and other issues
Call problems generally occur in the case of NAT, that is, the server is behind a router or firewall, the extension through the external network call will appear, silent, single-pass and so on. The system needs to set the public network IP address and internal network IP segment, which exterip fill the corresponding public network server address, localnet fill in the server’s internal network segment (through the ifconfig command to display the server where the network segment) Comma separated, as shown below: