PHP SDK for Dummies using Windows

This page provides instruction for how to using the BT SDK in PHP with XXAMP
1 .. Install XAMPP (http://www.apachefriends.org/en/xampp.html)

This is not required but this particular apache configuration has been tested.

2 .. Register for an account at http://sdk.bt.com/

3 .. Download the PHP source files: Downloads > PHP

4 .. Unzip the directory into your htdocs folder. If you installed XAMPP to the default location the htdocs folder will be in : C:\xampp\htdocs

Unzip the files to a folder of your choosing. With the default install this can be found at:

C:\xampp\htdocs\phpWeb21C

5 .. Registering your applications

Note : Before you can use the SDK you will need to register an application (One registration covers all of your programs)

You can register application at the URL below:

 

https://sdk.bt.com/Default.aspx?TabId=127

In order to run the certificate generation tool you may need the latest version of “Java Runtime Environment (JRE)” from http://java.sun.com/javase/downloads/index.jsp (you will receive an error when attempting to run the tool if you require this upgrade.)

When you use the tool 3 files will be generated on your desktop. (I called my app Umbrella)

Umbrella_Sandbox_PrivateKey.pem

Umbrella_Sandbox_PublicKey.pem

Umbrella_Sandbox_SignedCert.pem

Two of those files :

Umbrella_Sandbox_PrivateKey.pem

Umbrella_Sandbox_SignedCert.pem

Should then be place in a folder called keys (which you may need to create). E.g.

C:\xampp\htdocs\phpWeb21C\keys

6 .. Open the common.php file which can be found in the folder:

C:\xampp\htdocs\phpWeb21C\examples\common.php

7 .. Ensure that the application name is the same as the one specified when generating your certificate.

8 .. Open the folder C:\xampp\htdocs\phpWeb21C\examples\cmds

You should now be able to configure and run these files.

9 .. Running the code. If you have used the default installation settings go to and edit the file:

C:\xampp\htdocs\phpWeb21C\examples\cmds\makeCall.php

Change the variables for :

$calling = “tel:+44791”;

$called = “tel:+44791”;

To the numbers you wish to ring when the page is run.

When you now open the file in a browser the phones should start ringing. http://127.0.0.1/phpWeb21C/examples/cmds/makeCall.php

Advertisements

9 thoughts on “PHP SDK for Dummies using Windows

  1. Hello,

    I have followed your steps. donwloaded XAMPP and register application. and created PEM files in keys directory. Should I also leave SignedCert file in same directory, keys. I also modified common.php appropriately. I also changed tel numbers. When I access URL makeCall.php nothing happens. I tried to put some print statement before new Web21C in makeCall.php.. they are also not getting printed. I am successfully able to use Java version.

    Any help is appreciated..

    Thanks
    Rajan

  2. Hello,

    In addition to my previous post, I ran tests.php from phpWeb21C/tests directory and received following error.
    I downloadead XAMPP.. and check php.ini file where SOAP extension is enabled.. any idea ? This seems to be a root cause..
    Fatal error: Class ‘SoapClient’ not found in C:\xampp\htdocs\phpWeb21C\lib\web21clibs.php on line 211

    Thanks
    Rajan

  3. Rajan,

    could you please post your code on a comment. followed by the error your getting.

    it may be a number formatting issue so please just change afew of the numbers.

  4. Thanks for responding. I also put a issue at forum in PHP SDK and Milan responded. I do appreciate your effort.

    Regards
    Rajan

  5. Simon,

    When I try MakeCall sample with the 5.2.1 web21c PHP library, library complains that openssl is not installed, which is strange because I installed XAMPP 1.6.7 and expected it to have openssl compiled in. May be it is not.

    And them MakeCall fails with more cryptic messages.

    Notice: the required builtin module “openssl” is missing from the PHP interpreter in C:\xampp\htdocs\Web21C-PHP\lib\web21clibs.php on line 97

    Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in C:\xampp\htdocs\Web21C-PHP\lib\web21clibs.php on line 407

    Fatal error: Uncaught SoapFault exception: [Client] Call to undefined method domdocument::loadXML() in C:\xampp\htdocs\Web21C-PHP\lib\web21clibs.php:409 Stack trace: #0 C:\xampp\htdocs\Web21C-PHP\lib\web21clibs.php(409): Web21cSoapHeaders->__construct() #1 C:\xampp\htdocs\Web21C-PHP\lib\web21clibs.php(282): Web21cSoapHeaders->__construct(Object(Web21c), ‘__doRequest(‘__soapCall(‘makeCall’, Array) #4 C:\xampp\htdocs\Web21C-PHP\web21c.php(432): Web21cSoapClient->web21cSoapCall(‘makeCall’, Array) #5 C:\xampp\htdocs\Web21C-PHP\examples\cmds\makeCall.php(56): Web21c_2007_10_SessionThirdPartyCall->makeCall(‘tel: xxxx…’, ‘tel: xxxx…’, 30, ”, ”) #6 {main} thrown in C:\xampp\htdocs\Web21C-PHP\lib\web21clibs.php on line 409

    Any ideas what is going on?

Comments are closed.