Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Caller ID from SPA-3102 to 3CX Server

Discussion in '3CX Phone System - General' started by aigless, May 14, 2008.

Thread Status:
Not open for further replies.
  1. aigless

    Joined:
    May 12, 2008
    Messages:
    3
    Likes Received:
    0
    Hi,
    I have a Linksys SPA-3102 connected to a 3CX server.
    The PSTN line work and I can make and receive phone call.

    In the log I can't find the ID caller (the phone number of incoming caller), where can I find that number?
    Should I configure something in 3CX or the SPA-3102?

    (i can't see the caller id in the server status log)

    here the status log for an incoming call, where there isn't the caller ID! (the log start at bottom, see the time)

    10:22:44.109 LineCfg::getInboundTarget [CM503011]: Inbound office hours' rule for LN:10000 forwards to DN:800
    10:22:44.062 CallCtrl::eek:nLegConnected [CM503007]: Call(3): Device joined: sip:10000@192.168.1.140:5060
    10:22:44.031 CallCtrl::eek:nLegConnected [CM503007]: Call(3): Device joined: sip:
    10:22:44.000 CallCtrl::eek:nSelectRouteReq [CM503004]: Call(3): Calling: IVR:800@[Dev]
    10:22:43.984 Line::printEndpointInfo [CM505002]: Gateway:[0291210208] Device info: Device Not Identified: User Agent not matched; Capabilities:[reinvite, replaces, able-no-sdp, recvonly] UserAgent: [Linksys/SPA3102-3.3.6(GW)] Transport: [sip:192.168.1.150:5060]
    10:22:43.984 LineCfg::getInboundTarget [CM503011]: Inbound office hours' rule for LN:10000 forwards to DN:800
    10:22:43.937 CallCtrl::eek:nIncomingCall [CM503001]: Call(3): Incoming call from 10000@(Ln.10000@0291210208) to sip:800@phonesystem.mydomain.com:5060]
    10:22:43.921 LineCfg::getInboundTarget [CM503011]: Inbound office hours' rule for LN:10000 forwards to DN:800

    Thanks
    Michele
     
  2. otaku-oni

    Joined:
    Feb 7, 2007
    Messages:
    8
    Likes Received:
    0
    I don't beleive the PBX will dump them here. You would need to increase the verbosity or look at the log files in the 3CX "program files" folder.

    The Caller ID normally will be visible in the device's "From" Header in it's INVITE message.

    I don't know the PBX's behaviour off hand but I think increasing the verbosity will help you here. i.e. the PBX will show the full message in the server status log page. Once you see the whole message sent by your Device i beleive the Caller ID will show up in the aformentioned header.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. aigless

    Joined:
    May 12, 2008
    Messages:
    3
    Likes Received:
    0
    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
     
Thread Status:
Not open for further replies.