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

From innovaphone wiki
Revision as of 15:15, 7 September 2011 by Afi (talk | contribs) (→‎Configuration)
Jump to navigation Jump to search

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 log.txt. If you enable logging, make sure HTTP Server can write to this file (e.g. execute touch log.txt;chmod a+w log.txt on linux).
mobility.php
sample script

In the mobility.php adjust the PBX IP address and HTTP/SOAP credentials. The SOAP credentials must be configured on the PBX in the same way as for TSP.

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