HTTP API - Get CDR: Difference between revisions
No edit summary Tag: 2017 source edit |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''POST <nowiki>https://gateway_ip/api/get_cdr</nowiki>''' | '''POST <nowiki>https://gateway_ip/api/get_cdr</nowiki>''' | ||
Request | '''Request Parameters:''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|'''Parameter''' | |'''Parameter''' | ||
Line 31: | Line 30: | ||
|} | |} | ||
Response | '''Response Parameters:''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|'''Parameter''' | |'''Parameter''' | ||
Line 50: | Line 49: | ||
|Array | |Array | ||
|Each CDR will be returned according to the query. | |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 | '''start_date''': start time of the call; '''answer_date''': answer time of the call; '''duration''': call duration '''source_number''':source number | ||
Line 75: | Line 68: | ||
|} | |} | ||
Example of Getting CDR | '''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> | ||
'''Response:''' | |||
":"G.711U","hangup":"called","gsm_code":16,"bcch":""}]} | {"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":""}]} |
Latest revision as of 12:48, 5 May 2024
POST https://gateway_ip/api/get_cdr
Request Parameters:
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 Parameters:
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":""}]}