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:

chmod +x `which nocom`

Now, simply run nocom with the target file as an argument to have the file printed without comments.


nocom sip.conf


root@xenu/etc/asterisk# nocom sip.conf
context=default ; Default context for incoming calls
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr= ; IP address to bind to ( binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
Created by: Jicksta, Last modification: Fri 20 of Oct, 2006 (21:33 UTC) by JCabillot
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+