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 received in a call response message methods start.vnumber_call, start.scenario_call, start.employee_call, using the notification server or 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 methods
start.informer_call,
start.vnumber_call,
start.scenario_call,
start.employee_call or the subscriber who called the virtual PBX.
|
||
| type | string | yes | media, tts |
Defines the message type. |
|
| value | string | yes |
If the If the The length of the TTS message is regulated by the tariff plan and the established limit. |
||
Example request```json
{ "jsonrpc": "2.0", "method": "hold.call", "id": "req1", "params": { "access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d", "call_session_id": 23465781, "contact_message": { "type": "media", "value": "2034" } } }
#### Sample answer```json
{
"jsonrpc": "2.0",
"id": "req1",
"result": {
"data": {
"success": "true"
}
}
}
List of returned errors
| Error text | Error code | Error mnemonics | Description |
|---|---|---|---|
| This method can not be called in this state | -32004 | invalid_state |
The method can only be called in the Talk state (see Call State Diagram) |
The media file with id {media_file_id} not found |
-32602 | media_file_not_found |
|
The maximum length of 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 section "List of errors common to all methods"