shell script - call detail records.
January 1st, 2010This simple shell script is useful for checking call detail records from the command line.
cdr.sh
This simple shell script is useful for checking call detail records from the command line.
cdr.sh
This simple shell script is useful for checking active channels from the command line prompt.
channels.sh
The following are small scripts I used to create and manage a mysql data base for CID name lookups in my TrixBox.
| cid.pl | This is a cgi perl script that makes it easy to manage the lookup table, the setup script below will copy this to /var/www/cgi/ |
| setup.sh | This shell script will create the data base and lookup table. It will also create a blank tuple in the table, so that calls with a blank CID will return “unknown” instead of the first entry in the table. |
| backup.sh | Shell script to backup cid lookup table, creates text file cid.sql |
| restore.sh | Shell script to restore cid.sql text file back to the data base. |
My trixbox CE system status version is 2.6.23
Select the CallerID Lookup Sources and Add Lookup Source
Source Description: local mysql
Source Type: MySQL
Host: localhost
database: cidlookup
query: SELECT name FROM callerid WHERE number LIKE ‘%[NUMBER]%’
username: root
password: passw0rd
Set up httpd.conf with a virtual host for each url.
/etc/httpd/conf/httpd.conf
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerSignature off
DirectoryIndex index.php index.html index.htm index.shtml index.pl
LogLevel debug
HostNameLookups off
</VirtualHost>
<VirtualHost *:80>
ServerName www.labellepageantwear.com
ServerAlias *labellepageantwear.com
DocumentRoot /home/labelle/public_html/
DirectoryIndex index.php index.html index.htm index.shtml index.pl
ErrorLog /var/log/httpd/labellepageantwear.com-error_log
CustomLog /var/log/httpd/labellepageantwear.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerName www.missidahofalls.org
ServerAlias *missidahofalls.org
DocumentRoot /home/missif/public_html/
DirectoryIndex index.php index.html index.htm index.shtml index.pl
ErrorLog /var/log/httpd/missidahofalls.org-error_log
CustomLog /var/log/httpd/missidahofalls.org-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerName www.missrexburg.org
ServerAlias *missrexburg.org
DocumentRoot /home/missrex/public_html/
DirectoryIndex index.php index.html index.htm index.shtml index.pl
ErrorLog /var/log/httpd/missrexburg.org-error_log
CustomLog /var/log/httpd/missrexburg.org-access_log common
</VirtualHost>
# allow each user to have a public html folder
<Directory “/home/*/public_html”>
Options Indexes Includes FollowSymLinks
Order Deny,Allow
AllowOverride authConfig
Allow from all
Order allow,deny
</Directory>
# prevent index of labelle catalog
<Directory “/home/labelle/public_html/catalog”>
Options -Indexes
</Directory>
Restart apache for the configuration to take effect.
service httpd restart
edit /etc/webalizer/webalizer.conf
leave LogFile /var/log/httpd/access_log
change OutputDir /var/www/usage/default
I changed the hostname to the static IP on the local LAN HostName 192.168.1.50
Every thing else stayed the same.
Now, update the following items for each virtual host in their conf file
LogFile /var/log/httpd/missrexburg.org-access_log
OutputDir /var/www/usage/missrex
HistoryName /var/lib/webalizer/missrex.webalizer.hist
IncrementalName /var/lib/webalizer/missrex.webalizer.current
HostName www.missrexburg.org
#if [ -s /var/log/httpd/access_log ] ; then
# /usr/bin/webalizer
#fi
for i in /etc/webalizer/*.conf; do /usr/bin/webalizer -c $i; done
exit 0
<Location /usage>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.1. # local subnet
Allow from ::1
Options +Indexes
</Location>
Restart apache for the configuration to take effect.
service httpd restart
9 camera system at Rush’s Kitchen Supply in Idaho Falls, Idaho. I had to use several “lipstick” cameras since only part of the store has a ceiling where any thing could be mounted.
Here are a few pictures of the system at Cedric’s.
There are 9 cameras connected to the Linux Server and a Video Quad Mux.
The Linux box records time-lapse video and streams to the internet. The Mux feeds a T.V. in the office.
“Use gain when recording the voicemail message (optional) : [ ]”
found in; “setup > general settings”, doesn’t work.
I finally found a setting that does work in
/etc/asterisk/voicemail.conf
[general]
;1st listed format gets emailed
; format = wav49|wav
format = wav|wav
volgain=12.0
attach = yes
pbxskip = yes ; Don’t put [PBX]: in the subject line
Add FreePBX module.
goto http://www.freepbx.org/trac/changeset/5065 and get the file wakeup-1.0.tgz
Load your gui up of freepbx
Click on the tools tab
select module admin
Select Upload Module and then browse for the file
Select the file and press upload
After it is uploaded, go to module admin again, under “provides a feature code” the wakeup module should be there.
Click on check for updates online at the top of the page.
Go back under “provides a feature code”, click on wakeup and select install.
Then click process at the bottom of the page.
apply your changes with a reload
in linux
mkdir /tmp/wakeup
chown asterisk /tmp/wakeup
chgrp asterisk /tmp/wakeup
After the initial install of TrixBox 2.6 there is a wake up script wakeup.php already in /var/lib/asterisk/agi-bin
So all I had to do was add the following in /etc/asterisk/extensions_custom.conf
exten => *62,1,Answer
exten => *62,n,AGI(wakeup.php)
exten => *62,n,Hangup
And restart with amportal restart.
This is quick and easy, but does not add the features in the FreePBX module.
my TrixBox CE release is 2.6.1.11
In a DD-WRT router to have dhcp point to the TrixBox for tftp, set the following:
In the DD-WRT control panel select:
Administration > Services > scroll down to DNSMasq
DNSMasq = enable
Additional DNS Options:
dhcp-option=66,192.168.1.40
192.192.1.40 is my TrixBox.
I had trouble with TrixBox ringing after hanging up. After hanging up, a couple seconds latter all of the phones in the incoming ring group would ring, caller ID reporting “unknown”. Answering would result in listening to dial tone. It did not matter if I was terminating or originating.
I have a digium tdm410p wildcard with 2 FXO modules. Ring back was happening on both FXO ports.
I added options wctdm24xxp ringdebounce=1536 in /etc/modprobe.conf and restarted the system.
Looks like the voltage swing/change on disconnect was being interpreted as a ring cycle. Increasing the ring-de-bounce parameter took care of it.
Since this is a driver setting I don’t think any of the many, many, changes I made in my zapata.config made a difference.