Queue Add
از این سرویس برای افزودن صف استفاده میشود.
پارامترها
| پارامترها | پارامترهای ضروری[**]/منطقی[*] | دادههای نمونه | توضیحات | دادههای تعریف شده |
|---|---|---|---|---|
| name | ** | NasimTelecom | نام صف | - |
| number | ** | 9009 | شماره صف | - |
| strategy | * | ringall | استراتژی تماس | Ring All/Least Recent/Fewest Calls/Random/RR Memory/RR Ordered/Linear/W Random |
| ringinuse | * | no | - | yes/no |
| call_record | * | yes | ضبطمکالمات صف | yes/no |
| setinterfacevar | * | yes | - | yes/no |
| autofill | * | yes | - | yes/no |
| setqueuevar | * | yes | - | yes/no |
| setqueueentryvar | * | yes | - | yes/no |
| persistentmembers | * | no | - | yes/no |
| shared_lastcall | * | no | - | yes/no |
| announce_holdtime | * | no | - | yes/no |
| announce_position | * | yes | - | yes/no |
| joinempty | * | strict | - | yes/no/Strict |
| leavewhenempty | * | yes | - | yes/no |
| reportholdtime | * | no | - | yes/no |
| maxlen | * | 0 | - | - |
| announce_frequency | * | 120 | - | - |
| min_announce_frequency | * | 60 | - | - |
| periodic_announce_frequency | * | 120 | - | - |
| music | * | gole orkideh | موزیک انتظار صف | - |
| queue_callswaiting | * | queue-callswaiting | - | - |
| queue_thankyou | * | queue-thankyou | - | - |
| queue_thereare | * | queue-thereare | - | - |
| queue_youarenext | * | queue-youarenext | - | - |
| retry | * | 5 | - | - |
| servicelevel | * | 60 | - | - |
| timeout | * | 30 | - | - |
| weight | * | 10 | - | - |
| wrapuptime | * | 1 | - | - |
| monitor_type | * | MixMonitor | - | - |
| monitor_format | * | wav | - | - |
| monitor_format | * | wav | - | - |
نمونه فراخوانی
Example Code
PHP
<?php
$curl = curl_init ();
curl_setopt_array ($curl, array (CURLOPT_URL => 'http: //192. 168. 51. 20/API/v4/pbx/queues/add',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "NasimTelecom",
"number": "9009",
"strategy": "ringall",
"ringinuse": "no",
"call_record": "yes",
"setinterfacevar": "yes",
"autofill": "yes",
"setqueuevar": "yes",
"setqueueentryvar": "yes",
"persistentmembers": "no",
"shared_lastcall": "no",
"announce_holdtime": "no",
"announce_position": "yes",
"joinempty": "strict",
"leavewhenempty": "yes",
"reportholdtime": "no",
"maxlen": "0",
"announce_frequency": "120",
"min_announce_frequency": "60",
"periodic_announce_frequency": "120",
"music": "gole orkideh",
"queue_callswaiting": "queue-callswaiting",
"queue_thankyou": "queue-thankyou",
"queue_thereare": "queue-thereare",
"queue_youarenext": "queue-youarenext",
"retry": "5",
"servicelevel": "60",
"timeout": "30",
"weight": "10",
"wrapuptime": "1",
"monitor_type": "MixMonitor",
"monitor_format": "wav",
"more_options": ""
}',
CURLOPT_HTTPHEADER => array ('X-APIKEY: SAMPLE_API_KEY',
'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==',
'Content-Type: application/JSON'),));
$response = curl_exec ($curl);
if (! curl_errno ($curl)) {
$httpcode = curl_getinfo ($curl, CURLINFO_HTTP_CODE);
echo 'response code: '. $httpcode, '<br/>';
}
curl_close ($curl);
echo $response;
?>JavaScript
<html>
<head>
<script src="https: //ajax. googleAPIs. com/ajax/libs/jquery/3. 5. 1/jquery. min. js"></script>
</head>
<body>
<script>
var settings = {
"url": "http: //192. 168. 51. 20/API/v4/pbx/queues/add",
"method": "POST",
"timeout": 0,
"headers": {
"X-APIKEY": "vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG",
"Authorization": "Basic dGVzdDpBYTEyMzQ1Ng==",
"Content-Type": "application/JSON"
},
"data": JSON. stringify ({
"name": "NasimTelecom",
"number": "9009",
"strategy": "ringall",
"ringinuse": "no",
"call_record": "yes",
"setinterfacevar": "yes",
"autofill": "yes",
"setqueuevar": "yes",
"setqueueentryvar": "yes",
"persistentmembers": "no",
"shared_lastcall": "no",
"announce_holdtime": "no",
"announce_position": "yes",
"joinempty": "strict",
"leavewhenempty": "yes",
"reportholdtime": "no",
"maxlen": "0",
"announce_frequency": "120",
"min_announce_frequency": "60",
"periodic_announce_frequency": "120",
"music": "gole orkideh",
"queue_callswaiting": "queue-callswaiting",
"queue_thankyou": "queue-thankyou",
"queue_thereare": "queue-thereare",
"queue_youarenext": "queue-youarenext",
"retry": "5",
"servicelevel": "60",
"timeout": "30",
"weight": "10",
"wrapuptime": "1",
"monitor_type": "MixMonitor",
"monitor_format": "wav",
"more_options": ""
}),
};
$. ajax (settings). always (function (jqXHR) {
console. log ("response code: " + jqXHR. status + " " + jqXHR. statusText);
console. log ("response body: " + jqXHR. responseText);
});
</script>
</body>
</html>cURL
curl --location --request POST 'http: //192. 168. 51. 20/API/v4/pbx/queues/add' \
--header 'X-APIKEY: SAMPLE_API_KEY' \
--header 'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==' \
--header 'Content-Type: application/JSON' \
--data-raw '{
"name": "NasimTelecom",
"number": "9009",
"strategy": "ringall",
"ringinuse": "no",
"call_record": "yes",
"setinterfacevar": "yes",
"autofill": "yes",
"setqueuevar": "yes",
"setqueueentryvar": "yes",
"persistentmembers": "no",
"shared_lastcall": "no",
"announce_holdtime": "no",
"announce_position": "yes",
"joinempty": "strict",
"leavewhenempty": "yes",
"reportholdtime": "no",
"maxlen": "0",
"announce_frequency": "120",
"min_announce_frequency": "60",
"periodic_announce_frequency": "120",
"music": "gole orkideh",
"queue_callswaiting": "queue-callswaiting",
"queue_thankyou": "queue-thankyou",
"queue_thereare": "queue-thereare",
"queue_youarenext": "queue-youarenext",
"retry": "5",
"servicelevel": "60",
"timeout": "30",
"weight": "10",
"wrapuptime": "1",
"monitor_type": "MixMonitor",
"monitor_format": "wav",
"more_options": ""
}'Example Output
{
"success": 1,
"message": "Requested operation is done successfully",
"data": {
"_id": "64b78b96dc412c6dd0306ecc"
}
}