I can't understand very well your reply (maybe because i don't speak english), however i've made a small application in perl to log the Linksys Spa3102.
Anyone who's interested in my application can download perl language from
http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.822-MSWin32-x86-280952.msi
after installation create a file with notepad with extension .pl (example myprog.pl) and paste all lines at the and of the post (from #!/usr/bin/perl)
modify the 3 param (ip gateway,phone number,language).
after save and run.
will be create 2 file log (full log , call log)
full log is like this
13:16:30> Start Capture
13:16:31> Line Inactive
13:16:47> Ringing
13:16:53> Answer done
13:16:53> Check Caller ID
13:16:53> Caller ID: 0332423442
13:16:55> Call in progress
13:17:06> Call end
13:17:06> Call duration: 13sec.
13:17:06> Line Inactive
call log like this
12:46:07>
12:46:07> ********************************
12:46:07>
12:46:07> LOG DEL 16/05/2008 12:46:07
12:46:07>
12:46:44> Tx: 3933243434 8sec.
12:47:42> Rx: 0332423127 14sec.
enjoy (copy from now)
#!/usr/bin/perl
use HTTP::Request::Common qw(POST);
use LWP::Simple;
use LWP::UserAgent;
use Switch;
$ua = LWP::UserAgent->new();
$ua -> agent('Mozilla/8.0');
$ua -> cookie_jar({});
# PARAMETRI
$ipgateway = "192.168.1.140"; # SET HERE IP SPA-3102
$ntel = "0212345678"; # SET HERE YOUR PHONE NUMBER
$checkdelay = 2; # SET HERE THE DELAY BETWEEN CHECK (second)
$language = "ita"; # SET HERE YOUR LANGUAGE (only ita or eng)
# SOFTWARE PRODUCT BY GISACOM - Milano ITALY
# http://www.gisacom.it
#
# SPAZIO FUNZIONI
#
sub aggiornaora()
{
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$t1=time();
$year=$year+1900;
$mon++;
if($mday<10)
{$mday="0".$mday;}
if($mon<10)
{$mon="0".$mon;}
if($min<10)
{$min="0".$min;}
if($sec<10)
{$sec="0".$sec;}
if($hour<10)
{$hour="0".$hour;}
$mydata=$mday."/".$mon."/".$year." ".$hour.":".$min.":".$sec;
}
sub scrivilog($myriga)
{
open FILE,">>Reg_".$ntel.".TXT";
print FILE $hour.":".$min.":".$sec."> ".$_[0]."\n";
close FILE;
}
sub scrivicmd($mycmd)
{
aggiornaora();
print $hour.":".$min.":".$sec."> ".$_[0]."\n";
open FILE,">>FULL_CMD_".$ntel.".TXT";
print FILE $hour.":".$min.":".$sec."> ".$_[0]."\n";
close FILE;
}
sub aggiornacontenuto()
{
$res = $ua->get("http://".$ipgateway."/voice/");
$mycontent=$res->content;
}
#
# FINE SPAZIO FUNZIONI
#
#
# INIZIO PROGRAMMA
#
aggiornaora();
&scrivilog("");
&scrivilog("********************************");
&scrivilog("");
&scrivilog("LOG ".$mydata);
&scrivilog("");
if($language eq "ita")
{
&scrivicmd("Inizio registrazione");
}
else
{
&scrivicmd("Start Capture");
}
while(true)
{
aggiornacontenuto();
$mycontent=~/PSTN State:<td><font color="darkblue">(.+)<\/font>/;
$mycase=$1;
switch($mycase)
{
case "Idle" {
if($language eq "ita")
{
&scrivicmd("Linea Inattiva");
}
else
{
&scrivicmd("Line Inactive");
}
while($mycontent=~/PSTN State:<td><font color="darkblue">Idle<\/font>/)
{
sleep($checkdelay);
aggiornacontenuto();
}
}
case "Ringing" {
if($language eq "ita")
{
&scrivicmd("Sta squillando");
}
else
{
&scrivicmd("Ringing");
}
while($mycontent=~/PSTN State:<td><font color="darkblue">Ringing<\/font>/)
{
sleep($checkdelay);
aggiornacontenuto();
}
}
case "PSTN Caller Accepted" {
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$mystart=time();
if($language eq "ita")
{
&scrivicmd("Risposta effettuata");
}
else
{
&scrivicmd("Answer done");
}
if($language eq "ita")
{
&scrivicmd("Risalgo al numero del chiamante");
}
else
{
&scrivicmd("Check Caller ID");
}
if($mycontent=~/PSTN Peer Number:<td><font color="darkblue">(.+)<\/font>/)
{
$nchiamante=$1;
if($language eq "ita")
{
&scrivicmd("Tel Chiamante: ".$nchiamante);
}
else
{
&scrivicmd("Caller ID: ".$nchiamante);
}
}
else
{
if($language eq "ita")
{
$nchiamante="Anonimo";
}
else
{
$nchiamante="Anonymous";
}
if($language eq "ita")
{
&scrivicmd("Tel Chiamante: ".$nchiamante);
}
else
{
&scrivicmd("Caller ID: ".$nchiamante);
}
}
sleep($checkdelay);
if($language eq "ita")
{
&scrivicmd("Chiamata in corso");
}
else
{
&scrivicmd("Call in progress");
}
aggiornacontenuto();
while($mycontent=~/PSTN State:<td><font color="darkblue">PSTN Caller Accepted<\/font>/)
{
sleep($checkdelay);
aggiornacontenuto();
}
if($language eq "ita")
{
&scrivicmd("Chiamata terminata");
}
else
{
&scrivicmd("Call end");
}
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$mystop=time();
$mydurata=$mystop-$mystart;
if($language eq "ita")
{
&scrivicmd("Durata Chiamata: ".$mydurata."sec.");
}
else
{
&scrivicmd("Call duration: ".$mydurata."sec.");
}
&scrivilog("Rx: ".$nchiamante." ".$mydurata."sec.");
}
case "Connected to PSTN" {
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$mystart=time();
if($language eq "ita")
{
&scrivicmd("Chiamata in uscita");
&scrivicmd("Risalgo al numero chiamato");
}
else
{
&scrivicmd("Outgoing Call");
&scrivicmd("Check outgoing phone number");
}
if($mycontent=~/PSTN Peer Number:<td><font color="darkblue">(.+)<\/font>/)
{
$nchiamante=$1;
if($language eq "ita")
{
&scrivicmd("Tel Chiamato: ".$nchiamante);
}
else
{
&scrivicmd("Called phone number: ".$nchiamante);
}
}
sleep($checkdelay);
if($language eq "ita")
{
&scrivicmd("Chiamata in corso");
}
else
{
&scrivicmd("Chiamata in progress");
}
aggiornacontenuto();
while($mycontent=~/PSTN State:<td><font color="darkblue">Connected to PSTN<\/font>/)
{
sleep($checkdelay);
aggiornacontenuto();
}
if($language eq "ita")
{
&scrivicmd("Chiamata terminata");
}
else
{
&scrivicmd("Call end");
}
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$mystop=time();
$mydurata=$mystop-$mystart;
if($language eq "ita")
{
&scrivicmd("Durata Chiamata: ".$mydurata."sec.");
}
else
{
&scrivicmd("Call duration: ".$mydurata."sec.");
}
&scrivilog("Tx: ".$nchiamante." ".$mydurata."sec.");
}
else {&scrivicmd("Stato sconosciuto: ".$mycase); sleep($checkdelay);}
}
} #FINE WHILE TRUE