CDR Search
از این سرویس برای بازیابی اطلاعات بخش جستوجوی سریع استفاده میشود و تفاوت آن با Quick Search در امکان جستوجو براساس پارامتر cuid است.
پارامترها
| پارامترها | پارامترهای ضروری[**]/منطقی[*] | دادههای نمونه | توضیحات | دادههای تعریف شده |
|---|---|---|---|---|
| conditions->from | - | - | - | |
| conditions->to | - | - | - | |
| conditions->cuid | - | - | ||
| date_range->from | ** | 2020-06-15 15: 16 | بازیابی گزارشات از تاریخ | - |
| date_renge->to | ** | 2022-06-22 15: 16 | بازیابی گزارشات تا تاریخ | - |
| pagination->start | 0 | - | - | |
| pagination->count | 20 | - | - | |
| pagination->sorting | - | - | - | |
| alike | ** | true | یافتن موارد مشابه | true/false |
نمونه فراخوانی
Example Code
PHP
<?php
$curl = curl_init ();
curl_setopt_array ($curl, array (CURLOPT_URL => 'http: //192. 168. 51. 20/API/v4/reports/cdr/search',
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 =>'{
"conditions": {"from": "562", "to": "09123456789", "cuid": "1624340875. 75933"},
"date_range": {"from": "2020-06-15 15: 16","to": "2022-06-22 15: 16"},
"pagination": {"start": 0,"count": 20,"sorting": {}},
"alike": "true"
}',
CURLOPT_HTTPHEADER => array ('X-APIKEY: SAMPLE_API_KEY',
'Authorization: Basic c2FkcjpTYWRyQDEyMw==',
'Content-Type: application/JSON'),));
$response = curl_exec ($curl);
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/reports/cdr/search",
"method": "POST",
"timeout": 0,
"headers": {
"X-APIKEY": "9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG",
"Authorization": "Basic c2FkcjpTYWRyQDEyMw==",
"Content-Type": "application/JSON"
},
"data": JSON. stringify ({
"conditions": {
"from": "562",
"to": "09123456789",
"cuid": "1624340875. 75933"
},
"date_range": {
"from": "2020-06-15 15: 16",
"to": "2022-06-22 15: 16"
},
"pagination": {
"start": 0,
"count": 20,
"sorting": {}
},
"alike": "true"
}),
};
$. ajax (settings). done (function (response) {
console. log (response);
});
</script>
</body>
</html>cURL
curl --location --request POST 'http: //192. 168. 51. 20/API/v4/reports/cdr/search' \
--header 'X-APIKEY: SAMPLE_API_KEY' \
--header 'Authorization: Basic c2FkcjpTYWRyQDEyMw==' \
--header 'Content-Type: application/JSON' \
--data-raw '{
"conditions": {"from": "562", "to": "09123456789", "cuid": "1624340875. 75933"},
"date_range": {"from": "2020-06-15 15: 16","to": "2022-06-22 15: 16"},
"pagination": {"start": 0,"count": 20,"sorting": {}},
"alike": "true"
}'Example Output
{
"success": 1,
"message": "",
"data": {
"pagination": {
"start": 0,
"count": 20,
"sorting": {
"starttime": -1
},
"total": 1
},
"target": "cdr",
"useGroupBy": false,
"data": [
{
"_id": "60d179d3895b44fe5bbc66e2",
"type": "outgoing",
"cuid": "1624340875. 75933",
"clid": "\"\" <09123456789>",
"src": "562",
"dst": "09123456789",
"dcontext": "main_routing",
"channel": "SIP/center-00009cb6",
"dstchannel": "",
"lastapp": "Hangup",
"lastdata": "",
"start": "1400-04-01 10: 19: 04",
"answer": "2021-06-22 10: 19: 04",
"duration": 1,
"billsec": 54,
"disposition": "ANSWERED",
"amaflags": "DOCUMENTATION",
"accountcode": "",
"uniqueid": "1624340875. 75934",
"userfield": "",
"sequence": "54231",
"comment": "",
"v": 2,
"outgoing_point": "center",
"route": [
{
"type": "OutgoingRoute",
"name": "out31041",
"duration": 0. 011272,
"date": {
"$date": {
"$numberLong": "1624340875778"
}
}
},
{
"type": "Switcher",
"name": "Switcher",
"duration": 0. 005508,
"date": {
"$date": {
"$numberLong": "1624340875787"
}
}
},
{
"type": "Answer",
"name": "Answer",
"duration": 0. 006667,
"date": {
"$date": {
"$numberLong": "1624340875797"
}
}
},
{
"type": "MixMonitor",
"name": "Mix Monitor",
"duration": 0. 005578,
"date": {
"$date": {
"$numberLong": "1624340875808"
}
}
},
{
"type": "Trunk",
"name": "Center",
"duration": 68. 601818,
"date": {
"$date": {
"$numberLong": "1624340944416"
}
}
},
{
"type": "Trunk",
"name": "Center",
"duration": 0. 004539,
"date": {
"$date": {
"$numberLong": "1624340944442"
}
}
}
],
"wait": 14,
"starttime": "1400-04-01 10: 19: 06",
"endtime": {
"$date": {
"$numberLong": "1624340947977"
}
},
"record": "20210622_1624340875. 75933. mp3",
"ANSWERED": 1,
"outgoing": 1,
"billsec_hhmmss": "00: 00: 54",
"wait_hhmmss": "00: 00: 14",
"duration_hhmmss": "00: 00: 01"
}
]
}
}