home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
gpm108b.zip
/
Utils
/
CALLERID.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-09-23
|
2KB
|
91 lines
/* CallerID.log for GPMailer */
'@echo off'
GPMlog='\fido\logs\GPMail.Log' /* ï«ú ¼Ñ⌐½Ñαá */
CIDlog='\fido\logs\CallerID.Log' /* ï«ú óσ«ñ∩Θ¿σ ºó«¡¬«ó */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
call stream GPMlog,'c','open read'
call stream CIDlog,'c','open write'
call lineout CIDlog, 'CallerID.log started on' Date(European) 'at' Time()
call lineout CIDlog, '----------------------------------------------------------------------------'
subdate = substr(Date(European),4,2)
day = substr(Date(European),1,2)
Select
when subdate = 01 then date = day 'Jan'
when subdate = 02 then date = day 'Feb'
when subdate = 03 then date = day 'Mar'
when subdate = 04 then date = day 'Apr'
when subdate = 05 then date = day 'May'
when subdate = 06 then date = day 'Jun'
when subdate = 07 then date = day 'Jul'
when subdate = 08 then date = day 'Aug'
when subdate = 09 then date = day 'Sep'
when subdate = 10 then date = day 'Oct'
when subdate = 11 then date = day 'Nov'
when subdate = 12 then date = day 'Dec'
otherwise do
say 'Strange date. Unable to continue.'
call lineout CIDlog, 'Strange date. Unable to continue.'
signal Done
end
end
activity = 0
incalls = 0
q = 0
do until lines(GPMlog)=0
var=linein(GPMlog)
if substr(var,3,6)=date then do
activity = 1
if substr(var,24,23) = 'Ring #1 detected [RING]' then q = 2
if substr(var,24,14) = 'Incoming call:' then q = 1
if substr(var,24,4) = '+FCO' then q = 1
if substr(var,24,16) = "Caller's Number:" then q = 1
if q = 2 then do
say ''
call lineout CIDlog, ''
q = 1
end
if q = 1 then do
CID = substr(var,3,15) substr(var,24,50)
say CID
call lineout CIDlog, CID
incalls = 1
end
q = 0
end
end
if activity = 0 then do
CID = 'No activity today.'
say CID
call lineout CIDlog, CID
end
if activity = 1 & incalls = 0 then do
CID = 'No incoming calls today.'
say CID
call lineout CIDlog, CID
end
Done:
call lineout CIDlog, '----------------------------------------------------------------------------'
call lineout CIDlog, ''
call stream GPMlog,'c','close'
call stream CIDlog,'c','close'
Say ''
Say 'Press a key to exit...'
Call SysGetKey(Noecho)
exit