Network Traffic Analytics API

How It Works

Network traffic analytics for each SIP meter are stored as a set of CSV files in an Amazon S3 bucket. Software Developers can retrieve these files using the Amazon S3 REST API.

Network Traffic Analytics API

In order to make requests to Amazon S3 to retrieve the CSV files, developers require the following information which will be provided by Prilink:

  • Credentials (AWS access Key ID and AWS secret access key).
  • Bucket name for each SIP meter.

With the above information, developers can make REST API calls directly from code, or use the AWS SDKs or AWS CLI to make Amazon S3 API calls. For full details, follow the Amazon S3 Rest API documentation:

https://docs.aws.amazon.com/AmazonS3/latest/API

For each CSV file, the enpoint URL can be contrsucted by combining the bucket name with the CSV file name (key):

https://{bucket}.s3.amazonaws.com/{key}

Example

AWS provides SDKs for many programming languages – in this example, we are using Python to retrieve a single CSV file. The AWS SDK for Python is called Boto3. To retrieve the file, we need our credentials (access key and secret access key) and the SIP meter bucket name (in this example, ‘ip-meter-8192-3’).

In this snippet, the CSV file we are downloading contains 24 Hour Chart data (24hr-chart.csv). See the CSV File Layout section below for the full list of CSV files available.

import boto3

client = boto3.client('s3',
                      aws_access_key_id='AKIAIOSFODNN7EXAMPLE',
                      aws_secret_access_key='wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY')

client.download_file('ip-meter-8192-3', '24hr-chart.csv', '24hr-chart.csv')


CSV File layout

Network traffic analytics consists of a set of 10 CSV files. The name and format of each file is documented below.

24 Hour Chart24 Hour Response Code24 Hour Internal Number24 Hour External Number14 Day Chart14 Day Response Code14 Day Internal Number14 Day External NumberCDRTop 3 Number

24 Hour Chart (24hr-chart.csv)

This file contains traffic statistics for every 15-minute interval over the last 24 hours. For each interval, seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,time,channel,ans,nAns
1,0,2020-1-3 00:00:00,4,12,0
2,0,2020-1-3 00:15:00,5,12,0
3,0,2020-1-3 00:30:00,6,16,0
4,0,2020-1-3 00:45:00,5,17,0
5,0,2020-1-3 01:00:00,3,8,0
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
time Datetime (YYYY-MM-DD HH:mm:ss) 15-minute interval.
channel Number Maximum number of simultaneous calls during 15-minute interval.
ans Number Total number of answered calls during 15-minute interval.
nAns Number Total number of not-answered calls during 15-minute interval.

24 Hour Response Code (24hr-resCode.csv)

This file contains a summary of the SIP response codes used for not-answered calls over the last 24 hours. Seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,count,resCode
1,0,29,481 Call/Transaction Does Not Exist
2,0,1,0 call error/timeout
3,1,35,486 Busy Here
4,1,18,487 Request Terminated
5,2,6,481 Call/Transaction Does Not Exist
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
count Number Total number of not-answered calls using this response code.
resCode String 3-digit SIP response code, plus corresponding reason phrase.

24 Hour Internal Number (24hr-intNum.csv)

This file contains a summary of the most active internal numbers over the last 24 hours. Seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,internal#,name,ans,nAns,avgTalk(s)
1,0,2086207916,,2084,6,161
2,0,2084209377,,1558,2,119
3,0,2089490468,,468,9,164
4,0,2086208411,,134,0,95
5,0,2083920437,,113,0,126
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
internal# String Internal phone number.
name String Internal phone number name display (if available).
ans Number Total number of answered calls.
nAns Number Total number of not-answered calls.
avgTalk(s) Number Average duration of answered calls (in seconds).

24 Hour External Number (24hr-extNum.csv)

This file contains a summary of the most active external numbers over the last 24 hours. Seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,external#,name,ans,nAns,avgTalk(s)
1,0,2056907000,xxxxxxxxxx,422,0,189
2,0,2081665374,xxxxxxxxxx,154,0,160
3,0,1599175786,xxxxxxxxxx,143,0,44
4,0,anonymous,xxxxxxxxx,123,0,125
5,0,2083920456,xxxxxxxxxx,120,0,250
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
internal# String External phone number.
name String External phone number name display (if available).
ans Number Total number of answered calls.
nAns Number Total number of not-answered calls.
avgTalk(s) Number Average duration of answered calls (in seconds).

14 Day Chart (14Day-chart.csv)

This file contains traffic statistics for every 15-minute interval over the last 14 days. For each interval, seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,time,channel,ans,nAns
1,0,2020-1-3 00:00:00,4,12,0
2,0,2020-1-3 00:15:00,5,12,0
3,0,2020-1-3 00:30:00,6,16,0
4,0,2020-1-3 00:45:00,5,17,0
5,0,2020-1-3 01:00:00,3,8,0
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
time Datetime (YYYY-MM-DD HH:mm:ss) 15-minute interval.
channel Number Maximum number of simultaneous calls during 15-minute interval.
ans Number Total number of answered calls during 15-minute interval.
nAns Number Total number of not-answered calls during 15-minute interval.

14 Day Response Code (24Day-resCode.csv)

This file contains a summary of the SIP response codes used for not-answered calls over the last 14 days. Seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,count,resCode
1,0,29,481 Call/Transaction Does Not Exist
2,0,1,0 call error/timeout
3,1,35,486 Busy Here
4,1,18,487 Request Terminated
5,2,6,481 Call/Transaction Does Not Exist
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
count Number Total number of not-answered calls using this response code.
resCode String 3-digit SIP response code, plus corresponding reason phrase.

14 Day Internal Number (14Day-intNum.csv)

This file contains a summary of the most active internal numbers over the last 14 days. Seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,internal#,name,ans,nAns,avgTalk(s)
1,0,2086207916,,2084,6,161
2,0,2084209377,,1558,2,119
3,0,2089490468,,468,9,164
4,0,2086208411,,134,0,95
5,0,2083920437,,113,0,126
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
internal# String Internal phone number.
name String Internal phone number name display (if available).
ans Number Total number of answered calls.
nAns Number Total number of not-answered calls.
avgTalk(s) Number Average duration of answered calls (in seconds).

14 Day External Number (14Day-extNum.csv)

This file contains a summary of the most active external numbers over the last 14 days. Seperate records are created for incoming and outgoing traffic, as well as the top 3 most active phone numbers.

Sample

0,type,external#,name,ans,nAns,avgTalk(s)
1,0,2056907000,xxxxxxxxxx,422,0,189
2,0,2081665374,xxxxxxxxxx,154,0,160
3,0,1599175786,xxxxxxxxxx,143,0,44
4,0,anonymous,xxxxxxxxx,123,0,125
5,0,2083920456,xxxxxxxxxx,120,0,250
...
Download full sample


Fields

Name Value Description
0 Number Record number
type Number (0‑4) The type of traffic included in this record. Possible values are as follows:
  • 0: Incoming
  • 1: Outgoing
  • 2: most active phone number
  • 3: 2nd most active phone number
  • 4: 3rd most active phone number
internal# String External phone number.
name String External phone number name display (if available).
ans Number Total number of answered calls.
nAns Number Total number of not-answered calls.
avgTalk(s) Number Average duration of answered calls (in seconds).

CDR (cdr.csv)

This file contains Call Detail Records (CDR) for each call in the last 14 days.

Sample

0,state,dir,setupTime,talkTime,int#,ext#,name,resCode,ringing(s),disconnect,  local_MOS,  pTime(ms),RTP codec,RTP port,RTP_port error,talk_time(ms),  packet_total,packet_receive,packet_lost(%%),packet_factor,  latency(ms),latency_factor,  jitter(ms),jitter_sample,jitter_factor,  R-factor,  telco_MOS,  pTime(ms),RTP codec,RTP port,RTP_port error,talk_time(ms),  packet_total,packet_receive,packet_lost(%%),packet_factor,  latency(ms),latency_factor,  jitter(ms),jitter_sample,jitter_factor,  R-factor
1,ans,in,2019-11-14 20:59:24 ,0.47hr,0006*4602,51592129547,xxxxxxxxxxx,200 OK,12.00,telco,  4.32,  20,0,20471,0,1709704,  85483,85112,0.00%,0.00,  40,1.00,  50542,65535,3.00,  89.20,  4.29,  20,0,15186,0,1709704,  85476,85033,0.00%,0.00,  177,2.00,  57496,65535,3.00,  88.20
2,ans,out,2019-11-14 19:45:25 ,0.49hr,0006*4602,9142256408, ,200 OK,12.00,telco,  4.39,  20,0,20469,0,1788493,  89423,88966,0.00%,0.00,  23,0.00,  30540,65535,1.00,  92.20,  4.34,  20,0,17668,0,1788493,  89424,88925,0.00%,0.00,  10,0.00,  51989,65535,3.00,  90.20
3,ans,in,2019-11-14 18:41:39 ,0.00hr,0006*4602,52081452829,xxxxxxxxxx,200 OK,14.00,local,  4.31,  20,0,20467,0,7936,  394,387,1.00%,2.50,  43,1.00,  182,381,1.00,  88.70,  4.29,  20,0,12536,0,7936,  392,392,0.00%,0.00,  163,2.00,  341,384,3.00,  88.20
4,ans,in,2019-11-14 17:57:41 ,0.00hr,0006*4602,56007993232,xxxxxxxxxxx,200 OK,14.00,telco,  4.33,  20,0,20465,0,12110,  603,594,1.00%,2.50,  33,1.00,  113,586,0.00,  89.70,  4.32,  20,0,11044,0,12110,  603,603,0.00%,0.00,  166,2.00,  369,599,2.00,  89.20
5,ans,in,2019-11-14 15:23:24 ,0.00hr,0006*4602,52088245576,xxxxxxx,200 OK,14.00,telco,  4.26,  20,0,20463,0,4207,  208,202,2.00%,5.00,  37,1.00,  31,200,0.00,  87.20,  4.29,  20,0,10628,0,4207,  209,209,0.00%,0.00,  170,2.00,  160,207,3.00,  88.20
...
Download full sample


Fields

Name Value Description
0 Number Record number
state String The conclusion of the call. Possible values are as follows:
  • ans: Answered
  • nans: Not Answered
  • ringing: Call attempt in progress
dir String Call direction (incoming or outgoing).
setupTime Datetime (YYYY-MM-DD HH:mm:ss) Time of the first INVITE message.
talkTime Number Duration of the call in hours.
int# String Internal phone number.
ext# String External phone number.
name String Call display name (if available).
resCode String 3-digit SIP response code, plus corresponding reason phrase.
ringing(s) Number Number of seconds between first INVITE message and call acceptance or rejection.
disconnect String Indicates which party disconnected the call, telco or local.
local_MOS Number Mean Opinion Score.
pTime(ms) Number pTime(ms).
RTP codec Number RTP codec.
RTP port Number RTP port.
RTP_port error Number RTP_port error.
talk_time(ms) Number talk_time(ms).
packet_total Number packet_total.
packet_receive Number packet_receive.
packet_lost(%%) Number packet_lost(%%).
packet_factor Number packet_factor.
latency(ms) Number latency(ms).
latency_factor Number latency_factor.
jitter(ms) Number jitter(ms).
jitter_sample Number jitter_sample.
jitter_factor Number jitter_factor.
R-factor Number R-factor.

Top 3 Number (qsSipMsg.csv)

This file contains the top 3 most active phone numbers over the last 14 days. Traffic analytics for these phone numbers are reported in several other CSV files that include a type field.

Sample

0,name 
1,2086207916 ext
2,2089490468 int    
3,2084209377 int
...
Download full sample


Fields

Name Value Description
0 Number Ranking of the phone number
name String The phone number, followed by int or ext to indicate an internal or external phone number.