This nocom script allows quick viewing of Asterisk config files without having to sift through the abundance of lines containing only comments generally found in Asterisk’s .conf files. By default, the results are printed to the terminal, but the output can be piped to less to make larger .conf files even easier to read.
On your Linux Asterisk machine, create the file /usr/local/bin/nocom and put the following lines in it.
cat $1 | sed -e ‘/^\s*;/d’ | sed -e ‘/^\s*$/d’
To execute this, you’ll need to run this command:
Now, simply run nocom with the target file as an argument to have the file printed without comments.
Example:
produces
root@xenu/etc/asterisk# nocom sip.conf
[general]
context=default ; Default context for incoming calls
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
[authentication]
[100]
type=friend
secret=supersecret
host=dynamic
context=internal