Nocom

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.

#!/bin/sh
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.

Example:

nocom sip.conf


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
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.

#!/bin/sh
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.

Example:

nocom sip.conf


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
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+