CDR Ordered
این سرویس برای بازیابی اطلاعات جدول جستجوی سریع از ابتدا تا انتها کاربرد دارد، پارامتر ورودی این سرویس id رکوردی است که میخواهید اطلاعات بعد از آن بازیابی نمایید، خروجی سرویس رکوردهای جدول بصورت ترتیبی میباشد.(در هر فراخوانی 20 رکورد به ترتیب بازگردانده میشود).
نکته
درصورتی که میخواهید اطلاعات جدول را از ابتدا بازیابی کنید مقدار پارامتر id_ برابر با خالی قرار دهید.
نکته
پارامتر last_id در جواب سمت شما برگردانده میشود و id آخرین رکورد بازیابی شده را به شما میدهد، پس برای بازیابی اطلاعات بعدی(به ترتیب) این شناسه را به عنوان ورودی دوباره به سرویس بدهید.
#
پارامترهاتوضیحات | داده های تعریف شده | داده های نمونه | پارامترهای ضروری[**]/منطقی[*] | پارامترها |
---|---|---|---|---|
شناسه یکتای که میخواهیم اطلاعات بعد از آن به ترتیب بازیابی شوند(last_id) | 5ddb9e925171cd0429088bad | id_ |
#
نمونه خروجی درخواست{ "success": 1, "message": "Requested operation is done successfully", "data": { "last_id": "5ddb9e925171cd0429088bad", "data": [ { "_id": "5ddb9c1d5171cd0429088b95", "cuid": "1574673436.0", "wait": 0, "userfield": "", "comment": "", "NO ANSWER": 1, "billsec": 0, "disposition": "NO ANSWER", "v": 2, "dstchannel": "", "src": null, "dst": null, "start": "1398-09-04 12:47:16", "accountcode": "", "starttime": "1398-09-04 12:47:17", "type": "not defined", "clid": "\"\" <9122163462>", "dcontext": "from-310410", "sequence": "0", "duration": 0, "uniqueid": "1574673436.0", "amaflags": "DOCUMENTATION", "answer": "", "channel": "SIP/cisco-00000000", "lastapp": "AGI", "not defined": 1, "endtime": "1398-09-04 12:47:17", "lastdata": "agi://127.0.0.1:4573/dialplan, from-310410", "billsec_hhmmss": "00:00:00", "wait_hhmmss": "00:00:00" }, { "_id": "5ddb9c6b5171cd0429088b97", "cuid": "1574673514.9", "wait": 0, "userfield": "", "comment": "", "NO ANSWER": 1, "billsec": 0, "disposition": "NO ANSWER", "v": 2, "dstchannel": "", "src": "553", "dst": "554", "start": "1398-09-04 12:48:34", "accountcode": "", "starttime": "1398-09-04 12:48:35", "type": "local", "local": 1, "clid": "\"Mr.Bolandi\" <553>", "dcontext": "main_routing", "sequence": "9", "duration": 0, "uniqueid": "1574673514.9", "amaflags": "DOCUMENTATION", "answer": "", "channel": "SIP/553-00000005", "lastapp": "Dial", "endtime": "1398-09-04 12:48:35", "lastdata": "SIP/554,15,tTkKgmwd", "billsec_hhmmss": "00:00:00", "wait_hhmmss": "00:00:00" }, { "_id": "5ddb9c7c5171cd0429088b98", "cuid": "1574673453.2", "wait": 13, "userfield": "", "incoming": 1, "comment": "", "billsec": 64, "qnum": "910", "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/553-00000004", "src": "09364348002", "dst": "553", "old_caller_id": "9364348002", "start": "1398-09-04 12:47:46", "record": "20191125_1574673453.2.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:47:49", "type": "incoming", "clid": "\"\" <09364348002>", "did": "31041000", "dcontext": "from-310410", "sequence": "8", "duration": 63, "uniqueid": "1574673453.2", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:47:46", "entry_point": "cisco", "channel": "SIP/cisco-00000001", "lastapp": "Queue", "endtime": "1398-09-04 12:48:52", "lastdata": "910,ctTKkHn,,,,", "billsec_hhmmss": "00:01:04", "wait_hhmmss": "00:00:13" }, { "_id": "5ddb9c905171cd0429088b9b", "cuid": "1574673543.23", "wait": 7, "userfield": "", "comment": "", "billsec": 1, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/cisco-0000000a", "src": "202", "dst": "09331984585", "old_caller_id": "202", "outgoing_point": "cisco", "start": "1398-09-04 12:49:03", "record": "20191125_000.09331984585.1574673543.23.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:49:04", "type": "outgoing", "clid": "\"omid_laptop\" <000>", "dcontext": "main_routing", "sequence": "20", "duration": 8, "uniqueid": "1574673543.23", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:49:03", "channel": "SIP/microtic-00000009", "lastapp": "Dial", "endtime": "1398-09-04 12:49:12", "lastdata": "SIP/cisco/09331984585,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:01", "wait_hhmmss": "00:00:07" }, { "_id": "5ddb9c9f5171cd0429088b9c", "cuid": "1574673566.26", "wait": 0, "userfield": "", "comment": "", "billsec": 0, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/to-Monshi-0000000c", "src": "09151516318", "dst": "31041012", "old_caller_id": "989151516318", "outgoing_point": "to-Monshi", "start": "1398-09-04 12:49:26", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:49:27", "type": "outgoing", "clid": "\"\" <09151516318>", "did": "31041012", "dcontext": "from-310410", "sequence": "22", "duration": 0, "uniqueid": "1574673566.26", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:49:26", "entry_point": "cisco", "channel": "SIP/cisco-0000000b", "lastapp": "Dial", "endtime": "1398-09-04 12:49:27", "lastdata": "SIP/to-Monshi/31041012,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:00", "wait_hhmmss": "00:00:00" }, { "_id": "5ddb9ca15171cd0429088b9d", "cuid": "1574673453.3", "wait": 21, "userfield": "", "comment": "", "billsec": 94, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/cisco-00000003", "src": "555", "dst": "09023040687", "old_caller_id": "555", "outgoing_point": "cisco", "start": "1398-09-04 12:47:33", "record": "20191125_555.09023040687.1574673453.3.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:47:33", "type": "outgoing", "clid": "\"Shafiei\" <000>", "dcontext": "main_routing", "sequence": "2", "duration": 116, "uniqueid": "1574673453.3", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:47:33", "channel": "SIP/555-00000002", "lastapp": "Dial", "endtime": "1398-09-04 12:49:29", "lastdata": "SIP/cisco/09023040687,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:01:34", "wait_hhmmss": "00:00:21" }, { "_id": "5ddb9cfb5171cd0429088b9f", "cuid": "1574673652.37", "wait": 6, "userfield": "", "comment": "", "billsec": 6, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/to-Monshi-00000012", "src": "09129223775", "dst": "31041049", "old_caller_id": "9129223775", "outgoing_point": "to-Monshi", "start": "1398-09-04 12:50:52", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:50:53", "type": "outgoing", "clid": "\"\" <09129223775>", "did": "31041049", "dcontext": "from-310410", "sequence": "32", "duration": 6, "uniqueid": "1574673652.37", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:50:53", "entry_point": "cisco", "channel": "SIP/cisco-00000011", "lastapp": "Dial", "endtime": "1398-09-04 12:50:59", "lastdata": "SIP/to-Monshi/31041049,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:06", "wait_hhmmss": "00:00:06" }, { "_id": "5ddb9d125171cd0429088ba0", "cuid": "1574673623.35", "wait": 9, "userfield": "", "comment": "", "billsec": 49, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/cisco-00000010", "src": "560", "dst": "09123705210", "old_caller_id": "560", "outgoing_point": "cisco", "start": "1398-09-04 12:50:23", "record": "20191125_560.09123705210.1574673623.35.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:50:24", "type": "outgoing", "clid": "\"Mr.hoshmand\" <000>", "dcontext": "main_routing", "sequence": "30", "duration": 58, "uniqueid": "1574673623.35", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:50:23", "channel": "SIP/560-0000000f", "lastapp": "Dial", "endtime": "1398-09-04 12:51:22", "lastdata": "SIP/cisco/09123705210,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:49", "wait_hhmmss": "00:00:09" }, { "_id": "5ddb9d185171cd0429088ba1", "cuid": "1574673687.42", "wait": 0, "userfield": "", "comment": "", "NO ANSWER": 1, "billsec": 0, "disposition": "NO ANSWER", "v": 2, "dstchannel": "SIP/cisco-00000015", "src": "560", "dst": "09123705210", "old_caller_id": "560", "outgoing_point": "cisco", "start": "1398-09-04 12:51:27", "accountcode": "", "starttime": "1398-09-04 12:51:27", "type": "outgoing", "clid": "\"Mr.hoshmand\" <000>", "dcontext": "main_routing", "sequence": "35", "duration": 0, "uniqueid": "1574673687.42", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:51:27", "channel": "SIP/560-00000014", "lastapp": "Dial", "endtime": "1398-09-04 12:51:27", "lastdata": "SIP/cisco/09123705210,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:00", "wait_hhmmss": "00:00:00" }, { "_id": "5ddb9d2b5171cd0429088ba2", "cuid": "1574673692.45", "wait": 15, "userfield": "", "comment": "", "NO ANSWER": 1, "billsec": 0, "disposition": "NO ANSWER", "v": 2, "dstchannel": "SIP/554-00000017", "src": "560", "dst": "554", "start": "1398-09-04 12:51:32", "accountcode": "", "starttime": "1398-09-04 12:51:32", "type": "local", "local": 1, "clid": "\"Mr.hoshmand\" <560>", "dcontext": "main_routing", "sequence": "37", "duration": 15, "uniqueid": "1574673692.45", "amaflags": "DOCUMENTATION", "answer": "", "channel": "SIP/560-00000016", "lastapp": "Dial", "endtime": "1398-09-04 12:51:47", "lastdata": "SIP/554,15,tTkKgmwd", "billsec_hhmmss": "00:00:00", "wait_hhmmss": "00:00:15" }, { "_id": "5ddb9d305171cd0429088ba3", "cuid": "1574673606.30", "wait": 7, "userfield": "", "incoming": 1, "comment": "", "billsec": 96, "qnum": "910", "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/554-0000000e", "src": "05138481480", "dst": "554", "old_caller_id": "5138481480", "start": "1398-09-04 12:50:14", "record": "20191125_1574673606.30.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:50:16", "type": "incoming", "clid": "\"\" <05138481480>", "did": "310410", "dcontext": "from-310410", "sequence": "29", "duration": 96, "uniqueid": "1574673606.30", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:50:14", "entry_point": "cisco", "channel": "SIP/cisco-0000000d", "lastapp": "Queue", "endtime": "1398-09-04 12:51:52", "lastdata": "910,ctTKkHn,,,,", "billsec_hhmmss": "00:01:36", "wait_hhmmss": "00:00:07" }, { "_id": "5ddb9d645171cd0429088ba4", "cuid": "1574673712.49", "wait": 3, "userfield": "", "comment": "", "billsec": 48, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/560-00000019", "src": "554", "dst": "560", "start": "1398-09-04 12:51:52", "record": "20191125_554.560.1574673712.49.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:51:53", "type": "local", "local": 1, "clid": "\"Fathi\" <554>", "dcontext": "main_routing", "sequence": "39", "duration": 51, "uniqueid": "1574673712.49", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:51:55", "channel": "SIP/554-00000018", "lastapp": "Dial", "endtime": "1398-09-04 12:52:44", "lastdata": "SIP/560,10,TtKkg", "billsec_hhmmss": "00:00:48", "wait_hhmmss": "00:00:03" }, { "_id": "5ddb9da55171cd0429088ba6", "cuid": "1574673660.40", "wait": 118, "userfield": "", "incoming": 1, "comment": "", "billsec": 46, "qnum": "910", "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/554-0000001a", "src": "09361336200", "dst": "554", "old_caller_id": "9361336200", "start": "1398-09-04 12:52:58", "record": "20191125_1574673660.40.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:53:03", "type": "incoming", "clid": "\"\" <09361336200>", "did": "31041000", "dcontext": "from-310410", "sequence": "45", "duration": 46, "uniqueid": "1574673660.40", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:52:58", "entry_point": "cisco", "channel": "SIP/cisco-00000013", "lastapp": "Queue", "endtime": "1398-09-04 12:53:49", "lastdata": "910,ctTKkHn,,,,", "billsec_hhmmss": "00:00:46", "wait_hhmmss": "00:01:58" }, { "_id": "5ddb9daa5171cd0429088ba7", "cuid": "1574673833.67", "wait": 0, "userfield": "", "comment": "", "NO ANSWER": 1, "billsec": 0, "disposition": "NO ANSWER", "v": 2, "dstchannel": "", "src": "559", "dst": "552", "start": "1398-09-04 12:53:53", "accountcode": "", "starttime": "1398-09-04 12:53:54", "type": "local", "local": 1, "clid": "\"559\" <559>", "dcontext": "main_routing", "sequence": "52", "duration": 0, "uniqueid": "1574673833.67", "amaflags": "DOCUMENTATION", "answer": "", "channel": "SIP/559-00000021", "lastapp": "Dial", "endtime": "1398-09-04 12:53:54", "lastdata": "SIP/552,15,tTkKgmwd", "billsec_hhmmss": "00:00:00", "wait_hhmmss": "00:00:00" }, { "_id": "5ddb9dac5171cd0429088ba8", "cuid": "1574673828.59", "wait": 5, "userfield": "", "comment": "", "billsec": 1, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/cisco-0000001c", "src": "202", "dst": "09331984585", "old_caller_id": "202", "outgoing_point": "cisco", "start": "1398-09-04 12:53:48", "record": "20191125_000.09331984585.1574673828.59.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:53:49", "type": "outgoing", "clid": "\"omid_laptop\" <000>", "dcontext": "main_routing", "sequence": "46", "duration": 7, "uniqueid": "1574673828.59", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:53:48", "channel": "SIP/microtic-0000001b", "lastapp": "Dial", "endtime": "1398-09-04 12:53:56", "lastdata": "SIP/cisco/09331984585,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:01", "wait_hhmmss": "00:00:05" }, { "_id": "5ddb9dba5171cd0429088ba9", "cuid": "1574673831.65", "wait": 5, "userfield": "", "comment": "560 group picked up 550", "billsec": 13, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/560-00000022", "src": "557", "dst": "560", "start": "1398-09-04 12:53:56", "record": "20191125_557.550.1574673831.65.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:53:57", "type": "local", "local": 1, "clid": "\"Iravani\" <557>", "dcontext": "main_routing", "sequence": "54", "duration": 13, "uniqueid": "1574673831.65", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:53:56", "channel": "SIP/557-0000001f", "lastapp": "Dial", "endtime": "1398-09-04 12:54:10", "lastdata": "SIP/550,15,tTkKgmwd", "billsec_hhmmss": "00:00:13", "wait_hhmmss": "00:00:05" }, { "_id": "5ddb9de25171cd0429088baa", "cuid": "1574673865.73", "wait": 25, "userfield": "", "incoming": 1, "comment": "", "NO ANSWER": 1, "billsec": 0, "qnum": "910", "disposition": "NO ANSWER", "v": 2, "dstchannel": "", "src": "09361336200", "dst": "", "old_caller_id": "9361336200", "start": "1398-09-04 12:54:25", "accountcode": "", "starttime": "1398-09-04 12:54:25", "type": "incoming", "clid": "\"\" <09361336200>", "did": "31041000", "dcontext": "from-310410", "sequence": "55", "duration": 25, "uniqueid": "1574673865.73", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:54:25", "entry_point": "cisco", "channel": "SIP/cisco-00000023", "lastapp": "Queue", "endtime": "1398-09-04 12:54:50", "lastdata": "910,ctTKkHn,,,,", "billsec_hhmmss": "00:00:00", "wait_hhmmss": "00:00:25" }, { "_id": "5ddb9e355171cd0429088bab", "cuid": "1574673523.11", "wait": 14, "userfield": "", "incoming": 1, "comment": "", "billsec": 434, "qnum": "910", "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/553-00000008", "src": "05131233", "dst": "553", "old_caller_id": "5131233", "start": "1398-09-04 12:48:58", "record": "20191125_1574673523.11.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:48:59", "type": "incoming", "clid": "\"\" <05131233>", "did": "31041", "dcontext": "from-310410", "sequence": "19", "duration": 434, "uniqueid": "1574673523.11", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:48:58", "entry_point": "cisco", "channel": "SIP/cisco-00000006", "lastapp": "Queue", "endtime": "1398-09-04 12:56:13", "lastdata": "910,ctTKkHn,,,,", "billsec_hhmmss": "00:07:14", "wait_hhmmss": "00:00:14" }, { "_id": "5ddb9e595171cd0429088bac", "cuid": "1574674005.81", "wait": 3, "userfield": "", "comment": "", "billsec": 2, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/to-Monshi-00000027", "src": "09376072951", "dst": "31041044", "old_caller_id": "9376072951", "outgoing_point": "to-Monshi", "start": "1398-09-04 12:56:45", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:56:46", "type": "outgoing", "clid": "\"\" <09376072951>", "did": "31041044", "dcontext": "from-310410", "sequence": "58", "duration": 3, "uniqueid": "1574674005.81", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:56:45", "entry_point": "cisco", "channel": "SIP/cisco-00000026", "lastapp": "Dial", "endtime": "1398-09-04 12:56:49", "lastdata": "SIP/to-Monshi/31041044,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:02", "wait_hhmmss": "00:00:03" }, { "_id": "5ddb9e925171cd0429088bad", "cuid": "1574674002.79", "wait": 15, "userfield": "", "comment": "", "billsec": 47, "disposition": "ANSWERED", "v": 2, "dstchannel": "SIP/cisco-00000025", "src": "560", "dst": "09123705210", "old_caller_id": "560", "outgoing_point": "cisco", "start": "1398-09-04 12:56:42", "record": "20191125_560.09123705210.1574674002.79.mp3", "accountcode": "", "ANSWERED": 1, "starttime": "1398-09-04 12:56:44", "type": "outgoing", "clid": "\"Mr.hoshmand\" <000>", "dcontext": "main_routing", "sequence": "56", "duration": 62, "uniqueid": "1574674002.79", "amaflags": "DOCUMENTATION", "answer": "2019-11-25 12:56:42", "channel": "SIP/560-00000024", "lastapp": "Dial", "endtime": "1398-09-04 12:57:46", "lastdata": "SIP/cisco/09123705210,30,TtKkg", "outgoing": 1, "billsec_hhmmss": "00:00:47", "wait_hhmmss": "00:00:15" } ] }}
#
نمونه فراخوانی- PHP
- JS
- Linux
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'http://192.168.51.20//api/v3/reports/cdr/ordered/id', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_POSTFIELDS =>'{ "_id": ""}', CURLOPT_HTTPHEADER => array( 'X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG', 'Authorization: Basic c2Fkcjo=', 'Content-Type: application/json' ),));
$response = curl_exec($curl);
curl_close($curl);echo $response;
<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/v3/reports/cdr/ordered/id", "method": "GET", "timeout": 0, "headers": { "X-APIKEY": "9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG", "Authorization": "Basic c2Fkcjo=", "Content-Type": "application/json" }, "data": JSON.stringify({ "_id": "" }), };
$.ajax(settings).done(function (response) { console.log(response); }); </script> </body></html>
curl --location --request GET 'http://192.168.51.20//api/v3/reports/cdr/ordered/id' \--header 'X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG' \--header 'Authorization: Basic c2Fkcjo=' \--header 'Content-Type: application/json' \--data-raw '{ "_id": ""}'