Simple asterisk call manager
Updated: April the 27. 2006
Welcome to my simple asterisk call manager. Only a running HTTP server
and perl is required for this call manager.
This distributed files are very basic and written from the scratch.
As I looked around for a simple call manager I didn't find anything
like this. All I found were some huge programs, definitely an overkill
for a small business.
So I decided to write my own call manager, and to distribute my scripts
on the net. Please feel free to use, modify and improve them. Be so
kind and mail me your improvements for future releases.
Warning: Those scripts are distributed as they are.
Features
- All you need is a web browser
- Different users share one global directory
- Every user has its own personal directory and its local phone
number
- A simple click on an entry dials the number, sends an SMS or
deletes it
- Missed calls will be displayed. This entries will be deleted, if
you had an successful connection to this number.
- Phone numbers from incoming calls will be looked up in every
stored phone book and in public directories.
- Own number and name are just parameters in the URL (i. e.
http://192.168.0.5/cgi-bin/cm.cgi?SIP/200,john)
Screenshots
Download
Installation
- make an temp directory
- tar zxf asterisk_call_manager_0.1beta.gz
- mv all files in html to
your root html directory (i. e. /var/www/html)
- mv all files in cgi-bin
to your cgi-bin directory (i. e. /var/www/cgi.bin)
- mkdir cm-data under /var/lib/asterisk/
- make asterisk the owner of this directory (chown
asterisk:asterisk cm-data)
- make sure asterisk have permission to read and write cm-data
- mv all files in /var/lib/asterisk/cm-data
to /var/lib/asterisk/cm-data/
Configuration of call manager files
I suggest you use as the data directory the default one.
(/var/lib/asterisk/cm-data/)
So you have just to configure a few settings in the scripts.
cgi-bin/cm.cgi
- company Title in main
page
- datadir where to store
and read your directories (default /var/lib/asterisk/cm-data/)
As said before: installing in default will be a good idea
- asthost must contain the
ip address of your asterisk server
cgi-bin/call.pl
- $context must contain
your context to call you locally (i. e. from-internal). In other words,
where your exten for SIP/200 is.
cgi-bin/put_entry.pl
cgi-bin/rm_bookentry.cgi
- datadir same as above
- asthost must contain the
ip address of your asterisk server
cgi-bin/rm_missed_call.cgi
- datadir same as above
- asthost must contain the
ip address of your asterisk server
cgi-bin/send_sms.pl
- $smsprg asterisk's cmd
line interface for sms handling
- $smssvc SMS service
centre number (including channel). i. e. SIP/0800800800@yourprovider
- $aeracode trailing part
for SMS caller ID ($aeracode
+ [match from cid.lst] = outgoing caller ID)
/var/lib/asterisk/cm-data/cid.lst
This file makes the link between internal SIP channels and external
callerID. An entry of SIP/202;124324
makes outgoing calls originated from SIP/202 with the callerID 124324.
- semicolon separated list of channel;callerID
/var/lib/asterisk/cm-data/<username>.lst
Make sure a file <username>.lst
exists for every user.
/var/lib/asterisk/agi-bin/lookup_ch.agi
This script does a look up of incoming calls in local directories and
in a public directory. If you use it outside Switzerland you have to
modify the public part.
- Make sure asterisk has read and execute rights (r-x)
- datadir same as above
/var/lib/asterisk/agi-bin/put_missed_call.agi
<>- Make sure asterisk has read and execute rights (r-x)
- datadir same as above
/var/lib/asterisk/agi-bin/rm_missed_call.agi
- Make sure asterisk has read and execute rights (r-x)
- datadir same as above
Configuration of asterisk's extensions.conf
As well for looking up in public and local directories, as for handling
missed calls you have to add some lines in your extensions.conf
Example for an incoming exten
Lets assume, John has got the external number 123456789. Inserting
these lines in the correct context will lookup the caller ID, displays
it on John phone, and prepare some variables for the missed call
handler:
exten =>
123456789,1,AGI,lookup_ch.agi| ${CALLERIDNUM}
exten => 123456789,2,Set(CallerNum=${CALLERIDNUM})
exten => 123456789,3,SetCIDNum(${LONGNAME})
exten => 123456789,4,SetCIDName(Call to John)
exten => 123456789,5,Set(CalledNum=John)
exten => 123456789,6,Dial(SIP/200)
exten => 123456789,107,Busy
The missed call handler needs the following lines in the same
context as the lines above (but only once) :
exten => h,1,Set(result=${DIALSTATUS})
exten => h,2,GotoIf($["${RESULT}" = "CANCEL"]?3:5)
exten =>
h,3,DeadAGI(put_missed_call.agi|${CalledNum}|${CallerNum}|${LONGNAME})
exten => h,4,Goto(100)
exten => h,5,GotoIf($["${RESULT}" = "ANSWER"]?6:100)
exten => h,6,DeadAGI(rm_missed_call.agi|${CallerNum})
exten => h,100,NoOp
Do not forget to include the h
extensions also in the outgoing context (i. e. from-internal). This allows the
missed call handler to remove successful calls made originated from you.
Using
Just enter in your browser:
http://ip.add.re.ss/cgi-bin/cm.cgi?<channel>/<nmbr>,<username>
i. e. http://192.168.0.5/cgi-bin/cm.cgi?SIP/200,john
Contact
For suggestions, questions or feedback's, use my email.