The code example caters for browsers that require plugins by implementing the SDK's appropriate callback function.
The files, available on bitbucket along with detailed step-by-step instructions, can be deployed on a web server capable of serving PHP, MAMP / Apache for example.
- session.php (PHP invoked by web page to provision session.)
- Provision a session suitable for anonymous calling.
- Initialise UC by calling UC.start passing in the encoded session token obtained when the session was provisioned.
- In the implementation of UC.onInitialised create the call, then call the Call.dial method.
- You will need to add the following web application id using the web admin UI - the-minimal-code.
- Alternatively change the webAppId in session.php to match one already created.
- You will need to change the IP address in the source files, your.server.ip.address, to match your FCSDK instance.
- The curl has an option (CURLOPT_SSL_VERIFYPEER) that allows you to make the post internally (between your app server and the web gateway) over https. It's worth noting that this way is not secure, it simply handles http as https, when you don't have trust certificates established between you app server and the web gateway.
- You will also need to change the domain in the provisioning JSON to match your cluster domain. If you don't know the domain value, you can get it from the FCSDK sample app as highlighted below:
The application is defaulted to make the call to destination 1001. This is one of the default numbers created when the FCSDK sample application is installed.
You can download the sample code below or you can fork the project here.