WEB API

From VoIPmonitor.org
Revision as of 13:03, 27 May 2013 by Festr (talk | contribs)
Jump to navigation Jump to search

CDR HTTP API

This API is equivalent to Call_Detail_Record_-_CDR#Filter_Form_button

INPUT

HTTP POST address - php/model/sql.php

Mandatory parameters

task:LISTING module:CDR

Datetime range

fdatefrom:1986-01-09T00:00:00 fdateto:2013-05-28T00:00:00

Caller / called numbers

fcaller: caller num
fcalled: called num
fcallerd_type: 0 (if type is 0 searching is done for fcaller OR fcalled and value is taken from fcaller. If value is 1 searching is done for fcaller AND fcalled)


Domain

fcaller_domain: caller domain fcalled_domain: caller domain
fcallerd_domain_type:0 (if type is 0 searching is done for fcaller OR fcalled and value is taken from fcaller. If value is 1 searching is done for fcaller AND fcalled)

Caller id name

fcallername: caller name

SIP caller / called IP

fsipcallerip: caller SIP IP fsipcalledip: called SIP IP
fsipcallerdip_type:0 (if type is 0 searching is done for fcaller OR fcalled and value is taken from fcaller. If value is 1 searching is done for fcaller AND fcalled)

RTP source / destination IP

fa_saddr: 192.168.0.1
fb_saddr: 192.168.0.2
fab_saddr_type:0 (if type is 0 searching is done for fcaller OR fcalled and value is taken from fcaller. If value is 1 searching is done for fcaller AND fcalled)

Codecs

fcodec: 4, 12

list of numbers delimited by ','. Here is list of numbers and its codecs

define("PAYLOAD_PCMU", 0); define("PAYLOAD_GSM", 3); define("PAYLOAD_G723", 4); define("PAYLOAD_PCMA", 8); define("PAYLOAD_G722", 9); define("PAYLOAD_QCELP", 12); define("PAYLOAD_CN", 13); define("PAYLOAD_G729", 18); define("PAYLOAD_ILBC", 97); define("PAYLOAD_SPEEX", 98); define("PAYLOAD_SILK", 301); define("PAYLOAD_SILK8", 302); define("PAYLOAD_SILK12", 303); define("PAYLOAD_SILK16", 304); define("PAYLOAD_SILK24", 305); define("PAYLOAD_ISAC", 306); define("PAYLOAD_ISAC16", 307); define("PAYLOAD_ISAC32", 308); define("PAYLOAD_T38", 1000);

Call duration

example: less than 30 and greater than 10 seconds

fdurationgt: 30 fdurationlt: 10

PDD

example: greater than 10 and less than 30 seconds

fpddgt: 10 fpddlt: 30

Sip response code

fsipresponse: 503

Interrupted call

false or true

fbye:false

Direction (by trunk)

false or true

ftrunk:

SIP user agent

fa_ua: caller agent string fb_ua: called agent string
fab_ua_type:0 (if type is 0 searching is done for fcaller OR fcalled and value is taken from fcaller. If value is 1 searching is done for fcaller AND fcalled)

SIP Call-ID header

fcallid: string

SIP sensor ID (database ID)

fsensor_id:


Paging

page:1 start:0 limit:30

Ordering

sort:[{"property":"calldate2","direction":"DESC"}]


Special Ordering

orderByLoss: orderByDelay: orderByFixed1: orderByFixed2: orderByAdapt: orderByCallDuration_asc: orderByCallDuration_desc: orderBySrcSIP_IP_asc: orderBySrcSIP_IP_desc: orderByDstSIP_IP_asc: orderByDstSIP_IP_desc: orderBySrcNumber_asc: orderBySrcNumber_desc: orderByDstNumber_asc: orderByDstNumber_desc: orderByCallerName_asc: orderByCallerName_desc: orderByLastSIPrespNum_asc: orderByLastSIPrespNum_desc:

RTP

frtcp_maxjitter: frtcp_avgjitter: frtcp_maxfr: frtcp_avgfr: fmosf1: fmosf2: fmosadapt: f_d50: f_d70: f_d90: f_d120: f_d150: f_d200: f_d300: floss1: floss2: floss3: floss4: floss5: floss6: floss7: floss8: floss9: floss10: ffilterTemplate:

OUTPUT

Output is JSON formated array of CDR Example:

{"total":"25","results":[{"lastSIPresponseNum":"200","lastSIPresponse_id":"3","cnt_all":"110011","duration_all":"5388692","acd_all":"49.3737","asr_all":"99.2092","mos_all":"4.36034442","packets_lost_all":"0.15386185","jitter_all":"1.03656707","delay_all":"116.5833","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"200 OK","id":"200 OK"},{"lastSIPresponseNum":"487","lastSIPresponse_id":"27","cnt_all":"535","duration_all":"256","acd_all":"6.2439","asr_all":"7.6636","mos_all":"3.67647059","packets_lost_all":"0.05965854","jitter_all":"1.00000000","delay_all":"0.5042","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"487 Request Terminated","id":"487 Request Terminated"},{"lastSIPresponseNum":"404","lastSIPresponse_id":"14","cnt_all":"377","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":"1.19886364","packets_lost_all":null,"jitter_all":"1.00000000","delay_all":"0.0000","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"404 Not Found","id":"404 Not Found"},{"lastSIPresponseNum":"603","lastSIPresponse_id":"36","cnt_all":"184","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"603 Declined","id":"603 Declined"},{"lastSIPresponseNum":"500","lastSIPresponse_id":"30","cnt_all":"167","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":"1.00000000","packets_lost_all":null,"jitter_all":null,"delay_all":"0.0000","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"500 Server Internal Error","id":"500 Server Internal Error"},{"lastSIPresponseNum":"481","lastSIPresponse_id":"19","cnt_all":"114","duration_all":"38456","acd_all":"337.3333","asr_all":"100.0000","mos_all":"4.41052632","packets_lost_all":"0.02726316","jitter_all":"1.00000000","delay_all":"437.9386","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"481 Call leg\/transaction does not exist","id":"481 Call leg\/transaction does not exist"},{"lastSIPresponseNum":"480","lastSIPresponse_id":"18","cnt_all":"72","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"480 Temporarily unavailable","id":"480 Temporarily unavailable"},{"lastSIPresponseNum":"503","lastSIPresponse_id":"33","cnt_all":"61","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":"4.22000000","packets_lost_all":null,"jitter_all":"1.00000000","delay_all":"0.0000","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"503 Service Unavailable","id":"503 Service Unavailable"},{"lastSIPresponseNum":"0","lastSIPresponse_id":"1","cnt_all":"47","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"000 not response","id":"000 not response"},{"lastSIPresponseNum":"404","lastSIPresponse_id":"16","cnt_all":"44","duration_all":"879","acd_all":"19.9773","asr_all":"100.0000","mos_all":"1.00000000","packets_lost_all":"0.01131818","jitter_all":null,"delay_all":"9.8864","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"404 Not here","id":"404 Not here"},{"lastSIPresponseNum":"403","lastSIPresponse_id":"11","cnt_all":"39","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"403 Not allowed - ip","id":"403 Not allowed - ip"},{"lastSIPresponseNum":"403","lastSIPresponse_id":"7","cnt_all":"29","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":"4.50000000","packets_lost_all":null,"jitter_all":"1.00000000","delay_all":"0.0000","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"403 Forbidden","id":"403 Forbidden"},{"lastSIPresponseNum":"486","lastSIPresponse_id":"25","cnt_all":"21","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"486 Circuit busy - sb","id":"486 Circuit busy - sb"},{"lastSIPresponseNum":"403","lastSIPresponse_id":"10","cnt_all":"19","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"403 No permission for this kind of call (S-CSCF FRA)","id":"403 No permission for this kind of call (S-CSCF FRA)"},{"lastSIPresponseNum":"403","lastSIPresponse_id":"9","cnt_all":"15","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"403 No permission for this kind of call (S-CSCF DUS)","id":"403 No permission for this kind of call (S-CSCF DUS)"},{"lastSIPresponseNum":"500","lastSIPresponse_id":"29","cnt_all":"11","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":"4.50000000","packets_lost_all":null,"jitter_all":"1.00000000","delay_all":"0.0000","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"500 Internal Server Error","id":"500 Internal Server Error"},{"lastSIPresponseNum":"486","lastSIPresponse_id":"26","cnt_all":"10","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"486 Circuit busy - srs and dst blocked","id":"486 Circuit busy - srs and dst blocked"},{"lastSIPresponseNum":"403","lastSIPresponse_id":"5","cnt_all":"9","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"403 CLIR call with no valid A-number (S-CSCF DUS)","id":"403 CLIR call with no valid A-number (S-CSCF DUS)"},{"lastSIPresponseNum":"486","lastSIPresponse_id":"23","cnt_all":"9","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":"4.50000000","packets_lost_all":null,"jitter_all":"1.00000000","delay_all":"0.0000","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"486 Busy Here","id":"486 Busy Here"},{"lastSIPresponseNum":"403","lastSIPresponse_id":"13","cnt_all":"8","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"403 Not relaying","id":"403 Not relaying"},{"lastSIPresponseNum":"403","lastSIPresponse_id":"6","cnt_all":"3","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"403 CLIR call with no valid A-number (S-CSCF FRA)","id":"403 CLIR call with no valid A-number (S-CSCF FRA)"},{"lastSIPresponseNum":"481","lastSIPresponse_id":"20","cnt_all":"3","duration_all":"5419","acd_all":"1806.3333","asr_all":"100.0000","mos_all":"4.10000000","packets_lost_all":"0.00200000","jitter_all":"1.00000000","delay_all":"56415.0000","cnt_ok":null,"cnt_err":null,"lastSIPresponse":"481 Call\/Transaction Does Not Exist","id":"481 Call\/Transaction Does Not Exist"},{"lastSIPresponseNum":"200","lastSIPresponse_id":"2","cnt_all":"2","duration_all":"13","acd_all":"6.5000","asr_all":"100.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"200 canceling","id":"200 canceling"},{"lastSIPresponseNum":"500","lastSIPresponse_id":"32","cnt_all":"2","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"500 Service Unavailable","id":"500 Service Unavailable"},{"lastSIPresponseNum":"404","lastSIPresponse_id":"15","cnt_all":"2","duration_all":"0","acd_all":null,"asr_all":"0.0000","mos_all":null,"packets_lost_all":null,"jitter_all":null,"delay_all":null,"cnt_ok":null,"cnt_err":null,"lastSIPresponse":"404 Not found (f1)","id":"404 Not found (f1)"}]}