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


Screenshots

Download

Installation

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


cgi-bin/call.pl

cgi-bin/put_entry.pl

cgi-bin/rm_bookentry.cgi

cgi-bin/rm_missed_call.cgi

cgi-bin/send_sms.pl

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

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

/var/lib/asterisk/agi-bin/put_missed_call.agi

/var/lib/asterisk/agi-bin/rm_missed_call.agi


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.