diff --git a/README.html b/README.html deleted file mode 100644 index 0876558..0000000 --- a/README.html +++ /dev/null @@ -1,333 +0,0 @@ -
This repo contains a collection of projects and scripts both stand alone and dockerized that make use of the CALLR PHP SDK
- -The installation and usage of the php-sdk requires the following:
- -The Docker and docker-compose projects require Docker to be installed: -Docker is available for download on their website https://www.docker.com/
- -On Windows make sure you install Docker toolbox,
-and use the Kitematic application to manage your containers and view their logs and output (installed by default)
On Windows and Mac the docker-compose utility is installed automatically with docker-toolbox
-For other users, follow the instructions on the official Docker website here
php-composer (https://getcomposer.org/download/) is recommended for use with the sdk and for managing your project dependencies.
-The download page contains instructions and necessary files for installation on Windows and other platforms.
if not being installed as root/super user, make sure to use the switch --install-dir=
After downloading and installing composer, make sure you have a composer.json file located in the document root of your project, it should contain as a minimum the following:
{
- "require": {
- "callr/sdk-php": "dev-master"
- }
-}As an alternative, to automatically create the composer.json and install the sdk run composer require callr/sdk-php:dev-master
In your project source files, be sure to require the file autoload.php
<?php
- require 'vendor/autoload.php';Run composer update, which will download the sdk either via git ( if found in the environment ), or a zip and install it into the vendor directory.
$ composer update
-Loading composer repositories with package information
-Updating dependencies (including require-dev)
-- Installing callr/sdk-php (dev-master 09a2e40)
-Loading from cache
-
-Writing lock file
-Generating autoload filesIf you wish to use the sdk without the dependency management of php-composer it is possible with the following steps
- -Download the sdk from the CALLR php-sdk github
Unzip the archive and move the src directory into your project structure
Require each object source file being used, typically for making all api calls it will be the following:
- -// require source objects
-require '../src/CALLR/Api/Client.php';
-require '../src/CALLR/Api/Request.php';
-require '../src/CALLR/Api/Response.php';
-
-// get api client object
-$api = new \CALLR\API\Client;
-
-// set authentication credentials
-$api->setAuthCredentials($login, $password);
-...For creating realtime application flows, the libraries needed are the following:
- -// require source objects
-require '../src/CALLR/Realtime/Server.php';
-require '../src/CALLR/Realtime/Request.php';
-require '../src/CALLR/Realtime/Response.php';
-require '../src/CALLR/Realtime/CallFlow.php';
-require '../src/CALLR/Realtime/Command.php';
-require '../src/CALLR/Realtime/Command/Params.php';
-require '../src/CALLR/Realtime/Command/ConferenceParams.php';
-
-// get callflow object
-$flow = new CallFlow;
-...
-
-When docker is installed using the docker-toolbox, an application called Kitematic
-is installed alongside, to give a graphical interface for managing your docker images and containers.
-If you want to see the output of a docker-compose command, you must select the correct container listed on the left side of the interface.
docker-compose can be run in interactive mode under linux, so you should see the output from containers directly, run docker-compose commands with --rm -for container cleanup after the script has terminated.
- -Dockerfilesms.php located in the repo root, allows you to send an SMS and check its status$ php sms.php send +33123456789 'Hello from CALLR!'
-Starting script sms.php
-To: +33123456789
-Message: 'Hello from CALLR!'
-Returned result from sms.send: H45HC0D3
-
-$ php sms.php status H45HC0D3
-stdClass Object
-(
- [type] => OUT
- [hash] => H45HC0D3
- [from] =>
- [to] => +33123456789
- [text] => hello from bob, how are you?
- ...
- [date_received] => 2016-01-01 06:06:06
-)
-
-
-On windows, for each run of docker-compose a container will be created, dont forget to remove any unwanted containers using docker rm
-or the Kitematic tool.
-On Linux docker-compose run script.. can be executed with --rm for after execution cleanup
If you would like to delete a container, hover your mouse over the container name and click the round X button. -If you would like to delete a docker image ( to rebuild if you have made a change to a script )
- -Advanced users can remove containers and images with docker rm/rmi
- -If you have any further questions or require assistance with these examples, please contact CALLR Support
- -This demo uses environment variables set in the file .htaccess found in the src/ directory, that needs to be defined for your use case
SetEnv CALLR_LOGIN <your callr login>
-SetEnv CALLR_PASS <your callr password>
-SetEnv CALLR_TARGET <target number>
-SetEnv APP_ID <app id>
-
-
-click2call.appid
-A typical .htaccess for Bob Smith, with a telephone number of '+336123456789' and a predefined click to call application would look like the following:
SetEnv CALLR_LOGIN bobsmith
-SetEnv CALLR_PASS mySecr3tp@ssw0rd
-SetEnv CALLR_TARGET +336123456789
-SetEnv APP_ID H45HC0D3
-
-
-APP_ID blank, or remove the line completely.Docker is available for download on their website https://www.docker.com/
- -On Windows make sure you install Docker toolbox, or Docker for Windows (Requires Microsoft Windows 10 Professional or Enterprise 64-bit)
-and use the Kitematic application to manage your containers and view their logs and output (installed by default)
On Windows and Mac the docker-compose utility is installed automatically with docker-toolbox
-For other users, follow the instructions on the official Docker website here
Before running the docker-compose up c2cwebdemo command, please modify the .htaccess file found in the src directory.
If using MacOS / Windows launch the Docker quickstart terminal, and use the provided console to run this demo.
After installing Docker and docker-compose, run the following command in the same directory as Dockerfile,
$ docker-compose up
-
-
-you will see output similar to the following:
- -Building c2cwebdemo
-Step 1 : FROM php:5.6-apache
----> 7374b3b98172
-Step 2 : RUN apt-get update && apt-get install -y zip && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
----> Using cache
----> 82c0a0de5ff7
-Step 3 : COPY src/ /var/www/html/
----> a5dd2bea4c5c
-Removing intermediate container 5ecde79f4420
-Step 4 : COPY composer.json /var/www
----> 52d9fe05d3c7
-Removing intermediate container ab5d4eae9847
-...
-[Thu Jul 01 01:15:00.301234 2016] [mpm_prefork:notice] [pid 10] AH00163: Apache/2.4.10 (Debian) PHP/5.6.23 configured -- resuming normal operations
-[Thu Jul 02 01:15:00.301234 2016] [core:notice] [pid 10] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
-
-You can then connect to the docker container ip address with http:// to view the website. ( the ip address is displayed with the initial startup of the docker quickstart console )
If any modifications are made to the project, you will need to restart the container and rebuild the image, this can be done with the docker-compose command docker-compose up --build.
When running on windows, you should use the Kitematic utility to view the container output and website.
After launching the docker-compose command, from the Kitematic utility windows, you are able to click on the running container, view the 'web preview'
- and launch a browser connection to the website.
If you have any further questions or require assistance with these examples, please contact CALLR Support
- -This demo uses environment variables set in the file .htaccess found in the src/ directory, that needs to be defined for your use case
SetEnv CALLR_LOGIN <your callr login>
-SetEnv CALLR_PASS <your callr password>
-SetEnv CALLR_TARGET <target number>
-SetEnv APP_ID <app id>
-
-
-click2call.appid
-A typical .htaccess for Bob Smith, with a telephone number of '+336123456789' and a predefined click to call application would look like the following:
SetEnv CALLR_LOGIN bobsmith
-SetEnv CALLR_PASS mySecr3tp@ssw0rd
-SetEnv CALLR_TARGET +336123456789
-SetEnv APP_ID H45HC0D3
-
-
-APP_ID blank, or remove the line completely.Docker is available for download on their website https://www.docker.com/
- -On Windows make sure you install Docker toolbox, or Docker for Windows (Requires Microsoft Windows 10 Professional or Enterprise 64-bit)
-and use the Kitematic application to manage your containers and view their logs and output (installed by default)
On Windows and Mac the docker-compose utility is installed automatically with docker-toolbox
-For other users, follow the instructions on the official Docker website here
Before running the docker-compose up c2cwebdemo command, please modify the .htaccess file found in the src directory.
If using MacOS / Windows launch the Docker quickstart terminal, and use the provided console to run this demo.
After installing Docker and docker-compose, run the following command in the same directory as Dockerfile,
$ docker-compose up
-
-
-you will see output similar to the following:
- -Building c2cwebdemo
-Step 1 : FROM php:5.6-apache
----> 7374b3b98172
-Step 2 : RUN apt-get update && apt-get install -y zip && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
----> Using cache
----> 82c0a0de5ff7
-Step 3 : COPY src/ /var/www/html/
----> a5dd2bea4c5c
-Removing intermediate container 5ecde79f4420
-Step 4 : COPY composer.json /var/www
----> 52d9fe05d3c7
-Removing intermediate container ab5d4eae9847
-...
-[Thu Jul 01 01:15:00.301234 2016] [mpm_prefork:notice] [pid 10] AH00163: Apache/2.4.10 (Debian) PHP/5.6.23 configured -- resuming normal operations
-[Thu Jul 02 01:15:00.301234 2016] [core:notice] [pid 10] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
-
-You can then connect to the docker container ip address with http:// to view the website. ( the ip address is displayed with the initial startup of the docker quickstart console )
If any modifications are made to the project, you will need to restart the container and rebuild the image, this can be done with the docker-compose command docker-compose up --build.
When running on windows, you should use the Kitematic utility to view the container output and website.
After launching the docker-compose command, from the Kitematic utility windows, you are able to click on the running container, view the 'web preview'
- and launch a browser connection to the website.
If you have any further questions or require assistance with these examples, please contact CALLR Support
- -