HTTP API - Get CDR: Difference between revisions
(Created page with "==== 9.1 Request ==== '''POST <nowiki>https://gateway_ip/api/get_cdr</nowiki>''' ==== 9.2 Request Parameter ==== {| class="wikitable" |'''Parameter''' |'''Type''' |'''Description''' |- | colspan="3" |'''Required Parameter''' |- | colspan="3" |'''Optional Parameter''' |- |port |Array |Port(s) whose CDR is to be queried; Each port number should be an integer ranging from 0 to 31. |- |time_after |String |String like "YYYY-MM-DD HH:MM:SS"; Query t...") |
No edit summary Tag: 2017 source edit |
||
Line 1: | Line 1: | ||
Request | |||
'''POST <nowiki>https://gateway_ip/api/get_cdr</nowiki>''' | '''POST <nowiki>https://gateway_ip/api/get_cdr</nowiki>''' | ||
Request Parameter | |||
{| class="wikitable" | {| class="wikitable" | ||
|'''Parameter''' | |'''Parameter''' | ||
Line 31: | Line 31: | ||
|} | |} | ||
Response Parameter | |||
{| class="wikitable" | {| class="wikitable" | ||
|'''Parameter''' | |'''Parameter''' | ||
Line 75: | Line 75: | ||
|} | |} | ||
Example of Getting CDR | |||
Request: | |||
curl -k --anyauth -u admin:admin -d '{"port":[2,3]}' -H "Content-Type: application/json" <nowiki>http://gateway_ip/api/get_cdr</nowiki> | curl -k --anyauth -u admin:admin -d '{"port":[2,3]}' -H "Content-Type: application/json" <nowiki>http://gateway_ip/api/get_cdr</nowiki> | ||
Revision as of 12:43, 5 May 2024
Request POST https://gateway_ip/api/get_cdr
Request Parameter
Parameter | Type | Description |
Required Parameter | ||
Optional Parameter | ||
port | Array | Port(s) whose CDR is to be queried;
Each port number should be an integer ranging from 0 to 31. |
time_after | String | String like "YYYY-MM-DD HH:MM:SS";
Query the CDRs which are sent after this time. |
time_before | String | String like "YYYY-MM-DD HH:MM:SS";
Query CDRs are sent before this time. |
Response Parameter
Parameter | Type | Description |
error_code | Integer | Codes that may be returned: 200: Request has been processed 400: Request format is not valid
500: Other errors |
sn | String | SN of the gateway |
cdr | Array | Each CDR will be returned according to the query. |
port: port number;
start_date: start time of the call; answer_date: answer time of the call; duration: call duration source_number:source number destination_number:destination number direction: call direction which could be gsm->ip, ip->gsm or callback; ip: the source ip of an ip->gsm call codec: it could be:G.711U, G.723.1, G.711A or G.729AB; hangup: the party to hang up the call ; it could be the called party, the calling party or the gateway; gsm_code: the code of the reason why the GSM side hangs up the call; bcch: BCCH used for this call |
Example of Getting CDR
Request: curl -k --anyauth -u admin:admin -d '{"port":[2,3]}' -H "Content-Type: application/json" http://gateway_ip/api/get_cdr
Response:
{"error_code":200,"sn":"xxxx-xxxx-xxxx-xxxx","cdr":[{"port":2, "start_date":"2015-07-21 16:35:20","answer_date":"2015-07-21 16:35:31","duration":3,"source_number":"1010","destination_num ber":"6717","direction":"ip->gsm","ip":"172.16.100.136","codec
":"G.711U","hangup":"called","gsm_code":16,"bcch":""}]}