[Asterisk-Dev] Open source time card application for Asterisk

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Sep 26 12:57:18 MST 2005


On Monday 26 September 2005 10:56, Chuck Bunn wrote:
> I have several clients interested in this application. The primary
> has 40 nurses in the field and is having a hell of a time with time
> cards. Using an automated system through the phone seems the best
> way to meet her needs... If you have any other ways of doing this
> please let me know...

http://bugs.digium.com/view.php?id=5055

timeclock.sql:
CREATE TABLE timeclock (
	userid char(4) default '' not null,
	timein integer,
	timeout integer,
	PRIMARY KEY (userid,timeout)
);

func_odbc.conf:
[CLOCKIN]
write=INSERT INTO timeclock (userid,timein) VALUES 
('${ARG1}','${VAL1}')

[CLOCKOUT]
write=UPDATE timeclock SET timeout='${VAL1}' WHERE timeout IS NULL and 
userid='${ARG1}'

extensions.conf:
exten => 9991,1,VMAuthenticate
exten => 9991,2,Set(ODBC_CLOCKIN(${VM_AUTH})=${EPOCH})
exten => 9991,3,Hangup

exten => 9990,1,VMAuthenticate
exten => 9990,2,Set(ODBC_CLOCKOUT(${VM_AUTH})=${EPOCH})
exten => 9990,3,Hangup

Voila!  Instant timeclock.

-- 
Tilghman



More information about the asterisk-dev mailing list