Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMDR Script

Status
Not open for further replies.

rocky4j

Technical User
Nov 11, 2009
14
GB
Hi,

I am hoping someone might be able to help!

I have a few sites with Mitel 3300's but I want a windows script or tool which can collect the SMDR's. I know there are loads of Call Accounting software out there but too expensive.
I tried a web gui called simpleSMDR but it only captures 1 ICP. I hope someone may have some kind of windows tool!

Thanks in advance.
 
Try this:

Install Pearl on a Windows PC and run the following script. Add as many sites you wish and then run a Schedule task to perform as many times during the day. You may also need a script to kill the telnet sessions and to produce the text files, a killtelnet script is also included at the end.

#!/bin/perl

$root = "c:\\captura_xeno\\";
$new_root = "C:\\WINDOWS\\repair\\xeno\\";
$ip = "10.0.117.10";

while (1)
{

system("mkdir $root");
system("mkdir $new_root");

($second, $minute, $hour, $day_month, $month, $year_offset, $day_week, $day_year, $daylight_savings) = localtime();
$year = 1900 + $year_offset;
$month++;

$folder = $root . "XENO__" . "$day_month"."_"."$month"."_"."$year";

system("mkdir $folder");
$path = $folder . "\\" . "XENO__" . "$hour"."_"."$minute"."_"."$second".".txt";
system("telnet -f $path $ip 1752");

$new_folder = $new_root . "HATK_" . "$day_month"."_"."$month"."_"."$year";

system("mkdir $new_folder");
system("copy $path $new_folder");


}


KILL TELNET SCRIPT:


#!/bin/perl

system("taskkill /F /IM telnet.exe");
exit 0;



What I've done some times is to create .bat files and run those as Schedule Tasks, make sure you include the
mode 120,5 command so you can capture the whole smdr record on one line.

Let me know if something's still unclear, I will clarify and may also attach the files you need.

This is a very cheap way to capture smdrs but it works, and it works well.

You can centralize the capture of smdrs, or also if the budget allows, have a PC at each site and then sincronize them to a central one.

I hope this helps, let me know, Regards,

Daniel

 
danramirez,
Thank you! I've also had my eyes out for such a script. Would you happen to have a linux version?
I'd be interested in putting together a script that would capture the data to a mysql database in a raw format that could be searched and sorted from a web page.

Dry Aquaman
 
dryaquaman,

As long as I know, Perl is available for PC, Mac and Linux OSs. All you have to do is install Perl on you Linux PC and then run the scrip as required.

Go to w w w pearl dot org and download it from there. What I remember is that linux already comes with Perl installed, have a look at the url I mentioned above.

Regards,

Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top