Howto:Initiate a Mobility CallBack via simple HTTP GET or POST request: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
mNo edit summary
Line 24: Line 24:
; mobility.php : sample script
; mobility.php : sample script


The <code>mobility.php</code> script takes parameters for call back from POST or GET request and initiates a call via SOAP API. The HTTP credentials for SOAP session are hard coded in the PHP script (you may change it to submin the credentials with each HTTP request).
The <code>mobility.php</code> script takes parameters for call back from POST or GET request and initiates a call via SOAP API. The HTTP credentials for SOAP session are hard coded in the PHP script (you may change it to submit the credentials with each HTTP request).


Example GET request with following URL:
Example GET request with following URL:
Line 32: Line 32:
In this example a User <code>Reiner Zufall</code> will call phone number 123 and will use device <code>iphone</code>:
In this example a User <code>Reiner Zufall</code> will call phone number 123 and will use device <code>iphone</code>:
*The PBX Object with Long Name <code>Reiner Zufall</code> is used to start the call
*The PBX Object with Long Name <code>Reiner Zufall</code> is used to start the call
*The Mobility Fork Destination with [[Reference9:PBX/Objects/Edit_Forks|Device]] labeled <code>iphone</code>
*The phone number 123 will be called after the callback is answered on mobility device
*The Mobility Fork Destination with [[Reference9:PBX/Objects/Edit_Forks|Device]] labelled <code>iphone</code>


===Known Problems===
===Known Problems===

Revision as of 19:43, 5 September 2011

This article describes how to setup a PHP script to enable CallBack on Mobility devices supporting IP CallBack only via simple HTTP GET or POST request.

Applies To

This information applies to

  • innovaphone PBX, V9 hotfix 3
  • PHP, version 5.2


More Information

The innovaphone PBX supports CallBack via IP via SOAP API for all User Devices registered on it, but also for Mobility For destinations.

In order to use this CallBack feature SOAP API must be used. If only a simple HTTP GET or POST is supported on client side, a sample PHP script described in this article, can be used to convert simple HTTP requests to SOAP messages for PBX.

$/wiki-src/xml/IPCallBack/

Configuration

First download the sample PHP script and extract it to a folder on your PHP 5.2 enabled web server.

The sample contains following files:

innopbx.class.php
PHP implementation of SOAP API for innovaphone PBX
logger.class.php
simple logger for debugging, writes into local text file
mobility.php
sample script

The mobility.php script takes parameters for call back from POST or GET request and initiates a call via SOAP API. The HTTP credentials for SOAP session are hard coded in the PHP script (you may change it to submit the credentials with each HTTP request).

Example GET request with following URL:

http://192.168.0.1/mobility.php?cn=Reiner%20Zufall&e164=123&hw=iphone

In this example a User Reiner Zufall will call phone number 123 and will use device iphone:

  • The PBX Object with Long Name Reiner Zufall is used to start the call
  • The phone number 123 will be called after the callback is answered on mobility device
  • The Mobility Fork Destination with Device labelled iphone

Known Problems

Download

Related Articles