Before you can see any of the messages in Asterisk CLI, you need to ssh to the system by using ssh command (if using Linux on your computer) or using putty or similar software if on PC/MAC. After that you can enter the Asterisk CLI via following command:
where number of Vs define the verbosity level of the CLI.
Once inside you will see a lot of useful info print out for all actions on the system, Asterisk related though. You will see:
- Phone calls
- Peer registrations
- Subscribe notification
- Reload of system components (Extensions, Trunks, IVRs, etc.)
Entering CLI with additional debugging
If for some reason you have some inexplicable issues, like Asterisk not being able to start, you can try to run the CLI with different set of switches which should give some application specific debug info which includes start up sequence, database connection, registration retries, etc.
where number of Ds define the verbosity of these debug messages.
To turn off the debug messages run this command:
Running commands outside of CLI
If you don't need to be inside CLI, or you need just to execute some command without concern of output from CLI, you can do so by running Asterisk command with following switches being used:
Above will reload Asterisk configuration without going into CLI.
First important command(s) to know is the SIP debug set of commands which are useful when you need to see the SIP data stream going through Asterisk. Simple command is to enable SIP debugging for one phone with:
SIP SET DEBUG PEER PEERNAME
If for some reason thepeer is not registered and the IP of the peer is not known to the asterisk, above command will not work and CLI will not show any SIP messages.
In such case, if you know the IP from which traffic should come, it is better to turn on debugging for that specific IP like this:
SIP SET DEBUG IP PEER_IP
where PEER_IP is the IP address of the peer which should send traffic to said extension/trunk.
When you finish debugging the SIP stream, you need to turn off SIP debugging since leaving that running clutters the CLI output and you might miss other important information on the system.
To turn off SIP debug run this command:
One of the primary techniques is to view what is actually getting sent and received by VOIP devices.
If you have issues with audio problems, enable the RTP debug
Example of proper bidirectional RTP traffic
To turn off RTP debug run this command:
CODEC transcoding list
If for some reason you have issues with audio problems, some of the messages might indicate codec incompatibilities on the system. In such cases you can see the possible translation paths in Asterisk with following command:
This command will show a table of possible codec transcoding/translation paths that can be followed on the system.
When you see a - sign, it means that transcoding between said codecs is not possible. In most cases, the reason for such issue is missing codec.
Reloading the complete Asterisk configuration
In cases, and not limited to, where you did manual modifications to Asterisk dialplan, you need to reload the complete configuration of the Asterisk subsystem which can be done by a simple command:
Or, out of the Asterisk CLI
This will reload all the configuration related to Asterisk telephony engine.
Restarting the Asterisk
If reloading of Asterisk is not enough for the changes made, or there is other reason to do so, you can restart complete Asterisk with:
When checking the availability of phones/trunks, you can print out a list of the peers on the system:
The command will print out a list of SIP peers on the system with additional info like online status and IP address from which they connect.
Watch the complete list of the active channels and active calls
SIP channels list
Watch the complete list of the SIP channels
Check the registration status of the SIP trunks
The trunk registration string must be previously configured in the trunk section of the XCALLY Web GUI
Checking the ODBC connection pool
asterisk - r
odbc show asterisk
If you need more connections, please increase them inside this file:
Example of res_odbc.conf setup to support up to 50 connections that can be open at a given time:
max_connections => 50
Don't forget to reload asterisk in case you change the max_connections:
By increasing the maximum number of connections the pool can maintain you should find Asterisk realtime to be both more stable and fast!