Misc. Commands
# Get a list of active contacts and registration info including transport in Asterisk
asterisk -x "pjsip list contacts" > userList.txt
Check SIP SSL
Run the following command to check that the TLS cert and connection is valid (not expired) when using TCP TLS encryption with SIP.
openssl s_client -connect IP_ADDRESS:5061
The following can be used to refresh the certificate in Asterisk
asterisk -x "core reload"
Working with queues
# View active queue members
asterisk -rx "queue show"
# View active members of a particular queue
asterisk -rx "queue show QUEUENAME"
# Log a user out of a queue where SIP/133 is the member output from above and QUEUE is the queue
asterisk -rx "queue remove member SIP/133 from QUEUE"
# Log out all queue members
asterisk -rx "queue remove member SIP/* from QUEUE"
Debugging DTMF
# Edit the logger.conf file and add dtmf to the log
vim /etc/asterisk/logger.conf
console => notice,warning,error,dtmf
messages => notice,warning,error,dtmf
# In CLI
asterisk -rvvvvvvvvvvv
logger reload
logger set level dtmf on
core set debug 2
# You can now grep for a particular extension for DTMF where 133 is the extension
asterisk -rvvvvvvvvvvv | grep 133
# If you wish to pipe it into a debug, do the following
asterisk -rvvvvvvvvvvv | grep 133 >> 133.log
Extending Transfer No Answer Timeout - Supervised ring time
When a supervised call transfer is transferred to another user, the call may timeout after 15 seconds and the call returned back to the caller. To resolve this, a feature needs to be modified inside Asterisk
Example: When you do a supervised transfer (A calls B, B to transfer to C), it rings C party for a maximum of 15 seconds, and then returns the caller (A) back to the operator (B).
# Loging to the system
# Open asterisk
cd /opt/pbxware/pw/etc/asterisk/ or cd /etc/asterisk/
# Edit the file
nano features-custom-general.conf
# Add or modify the following line and save
atxfernoanswertimeout=25
# Reload the features
asterisk -rx "reload features"
Test URIs
To test VOIP SIP you can use a URI to of external servers to test an external connection works.
This test advises the codec type and then allows you to record a message that is replayed
sip:[email protected]