Mitel Forums - The Unofficial Source 







Articles & FAQs

and How To

User Guides



If you find this site helpful, please consider a donation to help keep this type of assistance on-line and available.

Sponsor Links


 How To Capture Mitel 3300 Traffic Files


  The Mitel 3300 has the ability to generate traffic files that can give you a lot of information about what's going on with your trunks.  There is a problem, however.  They system will only keep ten files and then it will overwrite the oldest one.   That means you have no ability to go back more than a day to see what was happening on the trunks then.  One of the things I've always wanted to do was to capture the traffic files produced by the 3300 and save them long term.

Thanks to a lot of help by member bajangerry who provided the following script we can now do that.

To do this I used a Ubuntu Linux on a virtual machine.

The script will create a new file everyday to save the traffic information in.  Be aware that over the course of a year it will generate 365 files.  Since this file is not compressed it can take up quite a bit of space so be sure to keep an eye on your available hard drive space.


Setting Up the Mitel 3300

Turn On Traffic Reporting In Mitel

Edit the form "Traffic Reporting Options".  Set your active time slot.  I have always set this to be active during normal business hours.  The reason I don't normally run it 24 hours is because the system will produce a lot of data and I don't like the idea of wading through all that when off hours isn't interesting to me.

Set the "Period Length" to 60 minutes.

Set the "Usage Units" to Erlangs.   I prefer Erlangs here because to me it's easier to read than CCS.

Set "Autoprint" to Yes.

Set "Maximum Number of Traffic Files" to 10.  This is the number of files that the 3300 keeps on its own hard drive.  It over writes the oldest when producing reports.

Set the following fields to Yes.


Trunk Groups


Routes will show you if specific ARS routes in your system is being used.

Trunk Groups will show you if specific Trunk Groups are being used.

Trunks will show you what Trunks are being used.

With the exception of Attendant information, I have not found the other options to be of any value but feel free to experiment.


Set Up the Output Printer

Edit the form "Application Logical Ports".

Set the field for "Traffic Report Port" to be LPR3.   Note that the "LPR3" may be case sensitive.



Setting Up Linux Script

Create a directory for storage of the files.   I used "/home/mitel/traffic/".

Upload the following script to the "/home/mitel/" directory.  I used the name ""


#script by member bajangerry
# usage: perl <ip> <port> <directory>

use strict;
use IO::Socket;
use POSIX;

my $host = shift || $ARGV[0];
my $port = shift || $ARGV[1];
my $dir = shift || $ARGV[2];
my $proto = getprotobyname('tcp');
my $iaddr = inet_aton($host);
my $paddr = sockaddr_in($port, $iaddr);

for(;; ){

my $sock = new IO::Socket::INET(PeerAddr => $host, PeerPort => $port,Proto => "tcp",)
or die "Cannot connect to PBX at address: $host port: $port: $!";

while (<$sock>) {
s/^\0+//; # Remove leading null characters
print $_;
chomp ($_);

#my $file = strftime("%B%d%Y",localtime(time));
my $file = $dir.strftime '%Y-%m-%d', localtime;
#print $file;
if (-f $file){
open (my $fh,'>>', $file);
print $fh "$_";
close $file;
else {
open (my $fh,'>', $file);
print $fh "$_";
close $file;


The usage of this script is "perl <3300 IP Address> <port> <path>"

An example of usage is "perl 1754 ./traffic/"

Note the trailing '/' for the path.


You can enter the above command from the user interface but it will stop when you log out.


Begin Script At Linux Start Up.


To start the script automatically at reboot you'll need to edit the cron file.

You can do that by entering "crontab -e".

Add the following line towards the beginning of the file:

@reboot perl /home/mitel/ <IP Address> <port> <path>

Example:  @reboot perl /home/mitel/ 1754 /home/mitel/traffic/


Once you reboot you can check to see if it's running by entering the command "pgrep perl".   This should show you the number of the PID.


A Note About Ports

The Mitel 3300 uses some specific IP ports or sockets that will allow you to connect the script to it.

Log Output


Software Logs


Maintenance Logs




Hotel/Motel Logs


LPR1 Printer Port


ACD Real Time Event


IP PMS (3300 Release 6.0)


PMS Voice Mail Integration







Click Here For the Mitel Forum


Related Forum Post



Please join our forum and follow our newsletter.  Your participation may help others.

If you've found this article useful please


Copyright 2011-2016                     Notice: We are not associated with Mitel Networks in any way.   We're just big fans.