...
You also need to give proper permissions and ownership rights to the files of the App. The App needs to be owned by the web server user and group.
For example, if httpd
is is the name of the user and the name of the group to which the webserver belongs to:
...
As soon as the setup process is complete, the user may access the interface at at https://<hostname>//PATH_TO_callmebutton/index.php
. The following form is displayed where the user can enter his/hers phone number:
...
To place the phone call, the App uses the Unified API Create Simple PhoneCalls request. It uses the extension defined in the global variable VN_EXTENSION as the source of the call as in the example below. All fields are fictitious.
...
The code that makes the request can be found in <Path_To_CallMeButton>/interface/plib/lib.php and and is described below:
Code Block | ||||
---|---|---|---|---|
| ||||
// Fetch token $token = getToken(); $headers = array( 'Content-type' => 'application/json', 'Authorization' => $token ); // Initialize the cURL request $reqUrl = 'https://'.$config['VN_SERVER_IP'].'/uapi/phoneCalls/@me/simple'; $request = new cURLRequest(); $request->setMethod(cURLRequest::METHOD_POST); $request->setHeaders($headers); $jsonRequest = array( 'extension' => $config['VN_EXTENSION'], // Number of the extension configured to run with CallMeButton 'phoneCallView' => array( array('source' => array($config['VN_EXTENSION']), // Number of the extension configured to run with CallMeButton 'destination' => $phoneNumber // The phone number entered in the form field. ) ); $request->setBody(json_encode($jsonRequest)); // Receive the response in JSON format $response = $request->sendRequest($reqUrl); |
The source and and extension request parameters can be different as described in the Create Simple PhoneCalls recommendations. The CallMeButton App uses the same extension for both parameters.
...
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.