VoIP is not only fun with Skype. Instead, your company might use OpenSource solutions like Asterisk
or even more proprietary solutions like an Innovaphone VoIP infrastructure. Here at Mayflower, we’re using two Innovaphone IP800 gateways at each of our departments (Munich and Würzburg). They are connected to each other and replicate their data. Besides that, the Gateways do use LDAP for saving the contact data and provide a SOAP interface for connecting to the PBX.
In a crazy moment in my sparse free time, I had a look at Gregor’s PhoneMonitor application he’s written in C# and decided to write a PHP5 based approach to connect to the PBX and handle calls.
The result is a SOAP client library that is able to connect to a PBX, poll for events, register users and create calls between two endpoints.
Making calls is a piece of cake:
// $pbxbase is an instance of a class that handles the low-level PHP5 SOAP calls $sessionId = $pbxbase->createSession('Björn Schotte', 'mydemoapp'); $userobj = $pbxbase->createUserObjectID('Björn Schotte', true); $pbxuser = new PBXUser($pbxbase); $call_handle = $pbxuser->callCN($userobj, 'Gregor Streng'); // if you want to dial an external number, just use // $call_handle = $pbxuser->callPhone($userobj, '093112345');
This will place a call between me (cn „Björn Schotte“) and Gregor (cn „Gregor Streng“). If I run this script from command line, my hardware telephone (or my softphone if I’m on Mauritius :-) ) will ring and if I pick up I’ll have Gregor on the line.
In the screenshot you can see a small Firefox sidebar application (streaming) that polls for events on the PBX, meaning that is able to show which user in your PBX group currently has an active call and which user is free (in the screenshot „Björn Schotte“ is currently having an active call and his name displayed in red + a small icon. If he hangs up the phone, his name will be displayed normally and the icon will disappear). The next step will be some kind of integration in our groupware PHProjekt so that I’m able to easily call a contact inside the web application. Of course, there’s also TAPI, but SOAP could be another approach.
I’m not sure if there’s something similar yet available for the Asterisk stuff (SOAP interface). Does anyone have a clue?
Schreibe einen Kommentar