Hold call
Putting a call on hold
| Method | hold.call |
|---|---|
| API version | v4.0 |
| Description | Putting a call on hold |
| Return to list of methods | |
Request parameters
| Name | Type | Required | Valid values | Description | |
|---|---|---|---|---|---|
| access_token | string | yes | Authentication session key | ||
| call_session_id | number | yes | A unique call session identifier that can be obtained in the response of the start.vnumber_call, start.scenario_call, and start.employee_call methods, using the notification server or the DATA API. | ||
| Play message to caller | |||||
| contact_message | object | yes |
Defines the parameters of the message to be played to the caller.
The caller is the number specified in the contact parameter in the start.informer_call, start.vnumber_call, start.scenario_call, and start.employee_call methods, or the subscriber who called the virtual PBX.
|
||
| type | string | yes | media, tts |
Defines the message type: |
|
| value | string | yes |
If the If the Note: the length of the TTS message is regulated by the tariff plan and the established limit. |
||
Example request
{
"jsonrpc": "2.0",
"method": "hold.call",
"id": "req1",
"params": {
"access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d",
"call_session_id": 23465781,
"contact_message": {
"type": "media",
"value": "2034"
}
}
}
Example response
{
"jsonrpc": "2.0",
"id": "req1",
"result": {
"data": {
"success": "true"
}
}
}
List of returned errors
| Error text | Error code | Mnemonics | Description |
|---|---|---|---|
| This method cannot be called in this state | -32004 | invalid_state |
The method can only be called in the Talk state (see the Call state diagram section) |
The media file with id {media_file_id} was not found |
-32602 | media_file_not_found |
|
The maximum length of a Text-to-Speech message is {tts_message_max_length}. The length of your message is {sent_tts_message_length} |
-32602 | tts_text_exceeded |
Message length has exceeded the permissible limit set by the tariff plan |
| The character encoding must be UTF-8 | -32602 | character_encoding_not_allowed |
See also the section "List of errors common for all methods".