Real life SOAP: connecting your browser to a VoIP PBX

Avatar von Björn Schotte

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?

Avatar von Björn Schotte

Kommentare

3 Antworten zu „Real life SOAP: connecting your browser to a VoIP PBX“

  1. Hi !
    This post is really interesting.
    Is it possible to take a look at your code ?

    I mean the php SOAP client library with some example and the Firefox sidebar application ?

    You can contact me at my email address.

    Thanks in advance
    Pierluigi

    1. I JUST ran into this problem and you’re the only one I’ve seen with this fix I’m lonikog forward to giving it a try, but I’m really not sure what to do with this DIFF file? I can see its a text file, and its got sections of code, but it looks like it’s formatted for some program to do code replacement in the nusoap.php file? Can you tell me which program it is that is supposed to do this? Otherwise, I can try to decipher what the section numbers mean and update nusoap.php manually are the -6392,7 +6392,7 tags indicating line numbers? Just guessing at it so far let me know, thanks!

  2. Hi !
    your classes for connecting with pbx is really interesting.

    Is it possible to take a look at your classes for soap in php ?

    You can contact me at my email address.

    Thanks in advance

    Best Regard

    Stefano

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert


Für das Handling unseres Newsletters nutzen wir den Dienst HubSpot. Mehr Informationen, insbesondere auch zu Deinem Widerrufsrecht, kannst Du jederzeit unserer Datenschutzerklärung entnehmen.