Sitephone
ViewController
For the sitephone to work, you need to register a ViewController with the name sitephone.
Methods
startCall(params)
Method that allows you to request a call to a specified phone number. The params object contains the following properties:
- phone - the phone number to which the call is being made. This field is required.
- captcha_key - captcha key received from the server. The field needs to be filled in only if captcha is enabled in the sitephone settings.
- captcha_value - captcha entered by a visitor. The field needs to be filled in only if captcha is enabled in the sitephone settings.
- group_id - ID of an operator group with which a website visitor should be connected. This field must be filled in if the option "Process call in accordance with the selected group on the widget" is selected in the call-processing method in the sitephone settings.
- delayed_call_time - parameter for making a delayed call. Set as a number of milliseconds, UTC.
Events
callcomplete
The event occurs after a call is requested and allows you to find out whether the call order was successful.
callcomplete event properties: An object containing the following fields:
- success -
trueif the call was ordered,falseif there were errors in the process. - info - object containing text fields
titleandmessageto display a message to a website visitor.