Mitel 5000 PHP SMDR Script

You may have read my short writeup about reading SMDR from the Mitel 5000 with a simple PERL script. If not you can see it HERE.

This script is basically the same thing but in PHP. You will have to setup PHP to run from the CLI for this to work… I also set the execution time really long and could run it from a web page as well. It was really ugly but this gets the idea out there…

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, '', 4000);
socket_write($socket, chr(2),1);
socket_write($socket, chr(0) . chr(0) . chr(0),3);
socket_write($socket, chr(132) . chr(0),2);
	$data = socket_read($socket,512);
		echo $data;
This entry was posted in PHP, Scripts, Telephony and tagged , . Bookmark the permalink.

4 Responses to Mitel 5000 PHP SMDR Script

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.