/**********************************************************************
|
通话记录
|
*************************************************************************/
|
@RestResource(urlMapping='/SBGCallLog/*')
|
global with sharing class SBGCallLogRest {
|
|
global class GeDatasRest {
|
public GeDatas GeDatas;
|
}
|
|
global class GeDatas {
|
public NFMUtil.Monitoring Monitoring;
|
public GeData[] GeData;
|
}
|
/*
|
通话记录: 1 呼叫标识(callid) 2 呼叫类型(callType 0呼入 1 呼出)3 主叫号码(callerNo) 4 被叫号码( calleeNo) 5 呼叫时间 6.接听时间 7 挂机时间 8 录音文件名地址
|
未接电话: 1呼叫标识(callid) 2 来电号码 3 来电时间
|
*/
|
global class GeData {
|
|
public String callid; //呼叫标识
|
public String callType; //呼叫类型
|
public String callerNo; //主叫号码
|
public String calleeNo; //被叫号码
|
public String callTime; //呼叫时间
|
public String answerTime; //接听时间
|
public String hangUpTime; //挂机时间
|
public String recordingAddress; //录音文件名地址
|
public String callLogType;//通话状态
|
|
}
|
|
@HttpPost
|
global static void execute() {
|
// 取得接口传输内容
|
String strData = RestContext.request.requestBody.toString();
|
GeDatasRest ges = (GeDatasRest) JSON.deserializeStrict(strData, GeDatasRest.class);
|
|
if (ges == null ) {
|
return;
|
}
|
|
NFMUtil.Monitoring Monitoring = ges.GeDatas.Monitoring;
|
if (Monitoring == null) {
|
return;
|
}
|
|
BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'SBGCallLog', ges.GeDatas.GeData);
|
if (String.isBlank(rowData.Log__c) == false) {
|
executefuture(rowData.Id);
|
}
|
// JSONを戻す
|
RestResponse res = RestContext.response;
|
res.addHeader('Content-Type', 'application/json');
|
res.statusCode = 200;
|
String jsonResponse = '{"status": "Success", "Message":""}';
|
res.responseBody = blob.valueOf(jsonResponse);
|
return;
|
}
|
|
@future
|
global static void executefuture(String rowData_Id) {
|
main(rowData_Id);
|
}
|
|
global static void main(String rowData_Id) {
|
}
|
}
|