Child pages
  • Setting up an RTCP-XR collector for Polycom Productivity Suite

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageperl
titlemessagedunmp.pl
borderStylesolid
use OpenSIPS qw ( log );
use OpenSIPS::Constants;
use DBI;

$my_database=voip;
$my_user=voip;
$my_password=password;
$my_host="127.0.0.1";
$my_platform="Pg";
# For MYSQL database use
# $my_platform="mysql";

sub messagedump {
    my $m = shift;
    my $name;
    my $number;
    my $localUA;
    my $remoteUA;
    my $callID;
    my $packetLoss;
    my $moslq;
    my $moscq;
    my $rtd;
    my $timeStart;
    my $timeStop;

#	open F,">>/tmp/opensips-perl-messagedump";
    my $fh = $m->getHeader("From");
    if($fh =~ /"(.*)"\s+<sip:(\d+)@.*$/)
    {
        $name=$1;
        $number=$2;
    }
#	print F "NAME:$name\nNUMBER:$number\n";
    my $mb = $m->getBody();
#	print F "$mb\n";
    if($mb =~ /.*CallID:(.+).*/)
    {
        $callID = $1;
        $callID =~ s/\@.*//g; #remove the @symbol and everthing after
    }
    if($mb =~ /.*LocalAddr:IP=(.+)\s+PORT.*/)
    {
        $localUA = $1;
    }
    if($mb =~ /.*RemoteAddr:IP=(.+)\s+PORT.*/)
    {
        $remoteUA = $1;
    }
    if($mb =~ /.*RTD=(.+)\s+ESD.*/)
    {
        $rtd = $1;
    }
    if($mb =~ /.*PacketLoss:NLR=(\d+\.\d+).*/)
    {
    $packetLoss=$1;
    }
    if($mb =~ /.*MOSLQ=(\d.\d)\s+MOSCQ=(\d.\d).*/)
    {
        $moslq = $1;
        $moscq = $2;
    }
    if($mb =~ /.*START=(.+)\s+STOP=(.+).*/)
    {
        $timeStart = $1;
        $timeStop = $2;
    }

Code Block
languagexml
titledatabase_structure_postgresql
CREATE TABLE qos (
    callid character varying(50),
    name character varying(50),
    number character varying(12),
    timestart timestamp without time zone,
    timestop timestamp without time zone,
    localua character varying(20),
    remoteua character varying(20),
    rtd integer,
    moslq character varying(10),
    moscq character varying(10),
    packetloss character varying(10)
);
Code Block
languagexml
titledatabase_structure_mysql
CREATE TABLE qos (
  callid varchar(50),
  name varchar(50),
  number varchar(12),
  timestart datetime,
  timestop datetime,
  localua varchar(20),
  remoteua varchar(20),
  rtd int(4),
  moslq varchar(10),
  moscq varchar(10),
  packetloss varchar(10)
);