Integrate VICIphone in other applications

VICIphone has been designed to be easily integrated with other web applications, not just VICIdial. There are two methods to integrate with VICIphone. The first is to just use the POST variable interpreter. The second is to directly include the VICIphone template code in your app.

 

Method 1 – VICIphone POST/GET Interpreter:

The VICIphone code base includes a PHP script called vp_interpreter.php. This is the VICIphone POST/GET Interpreter. It will interpret POST/GET variables sent to it and start VICIphone with those values. Please note that it does not do any error handling, but it does has default values in place. As such you do not need to set every POST/GET variable. The POST/GET variables are:

layout – The path or URL to the CSS layout to use. default.css is recommended but is not set by default.
cid_name – This is the display name that VICIphone will use when placing calls
sip_uri – This is the SIP uri VICIphone will register to.
auth_user – This is the SIP user VICIphone will use when authenticating with the SIP server.
password – This is the SIP user’s password that VICIphone will use when authenticating with the SIP server.
ws_server – This is the SIP servers websocket URL that VICIphone will communicate with.
debug_enabled – This determines if VICIphone will display debug information on the users screen. Acceptable values are “true” and “false”.
hide_dialpad – This determines if the Dialpad will be displayed in VICIphone.  Acceptable values are “true” and “false”.
hide_dialbox – This determines if the Dial text field will be displayed in VICIphone.  Acceptable values are “true” and “false”.
hide_mute – This determines if the Mute button will be displayed in VICIphone.  Acceptable values are “true” and “false”.
hide_volume – This determines if the Volume control buttons will be displayed in VICIphone.  Acceptable values are “true” and “false”.
auto_answer – This determines if incoming calls to VICIphone will automatically be answered or not.

Here is an example URL :

https://phone.viciphone.com/vp_interpreter.php?layout=css%2Fdefault.css&cid_name=100
&sip_uri=100%40192.168.0.100&auth_user=100&password=1234
&ws_server=wss%3A%2F%2Fyourdialerurl.com%2F8089&debug_enabled=true
&hide_dialpad=false&hide_dialbox=false&hide_mute=false&hide_volume=false
&auto_answer=true

 

Method 2 – Directly Including VICIphone:

VICIphone is written in PHP. Your whole application does not need to be written in PHP, but to use this method you will have to write a basic PHP script to accept parameters and set required variables. The VICIphone PHP variables that need to be set are as follows:

$layout – The path or URL to the CSS layout to use. default.css is recommended but is not set by default.
$cid_name – This is the display name that VICIphone will use when placing calls
$sip_uri – This is the SIP uri VICIphone will register to.
$auth_user – This is the SIP user VICIphone will use when authenticating with the SIP server.
$password – This is the SIP user’s password that VICIphone will use when authenticating with the SIP server.
$ws_server – This is the SIP servers websocket URL that VICIphone will communicate with.
$debug_enabled – This determines if VICIphone will display debug information on the users screen. Acceptable values are “true” and “false”.
$hide_dialpad – This determines if the Dialpad will be displayed in VICIphone.  Acceptable values are “true” and “false”.
$hide_dialbox – This determines if the Dial text field will be displayed in VICIphone.  Acceptable values are “true” and “false”.
$hide_mute – This determines if the Mute button will be displayed in VICIphone.  Acceptable values are “true” and “false”.
$hide_volume – This determines if the Volume control buttons will be displayed in VICIphone.  Acceptable values are “true” and “false”.
$auto_answer – This determines if incoming calls to VICIphone will automatically be answered or not.

Once those variables are set you just need to call the vp_template.php PHP script. Please note that none of these variables have any error handling or default values in vp_template.php. It is up to you to set each of them.

Below is a very simple example PHP script:

<?php
 // set the VICIphone variables
 $layout = "css/default.css";
 $cid_name = "100";
 $sip_uri = "100@192.168.0.100";
 $auth_user = "100";
 $password = "1234";
 $ws_server = "wss://yourdialerurl.com/8089";
 $debug_enabled = true;
 $hide_dialpad = false;
 $hide_dialbox = false;
 $hide_mute = false;
 $hide_volume = false;
 $auto_answer= true;

// call the template
 require_once('vp_template.php');
?>