Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated using 4PSA automated script

...

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:

...

...

The code that makes the request can be found in <Path_To_CallMeButton>/interface/plib/lib.php and and is described below:

Code Block
php
php
// 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);									     

...

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.