035af0fa5f70277aa278869b5f50cb7dec326dfa
[motion2.git] / server / services / ami / rpc / voiceCallReport.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xa95d=['billableseconds','GetVoiceCallReports','moment','util','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','outbound','startOf','format','endOf','day','disposition','duration'];(function(_0xa129ba,_0x5bf0c5){var _0x4da45d=function(_0x342937){while(--_0x342937){_0xa129ba['push'](_0xa129ba['shift']());}};_0x4da45d(++_0x5bf0c5);}(_0xa95d,0x1de));var _0xda95=function(_0x295049,_0x59246e){_0x295049=_0x295049-0x0;var _0x4c1452=_0xa95d[_0x295049];return _0x4c1452;};'use strict';var moment=require(_0xda95('0x0'));var util=require(_0xda95('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x2544e7){return client['Request']('CreateVoiceCallReport',{'body':_['merge'](_0x2544e7,{'source':_0x2544e7[_0xda95('0x2')],'destinationcontext':_0x2544e7[_0xda95('0x3')],'callerid':_0x2544e7[_0xda95('0x4')],'amaflags':_0xda95('0x5')}),'log':'CreateVoiceCallReport'});};exports[_0xda95('0x6')]=function(){return function(){return client[_0xda95('0x7')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xda95('0x8')],'createdAt':{'$between':[moment()[_0xda95('0x9')]('day')[_0xda95('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xda95('0xb')](_0xda95('0xc'))[_0xda95('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0xda95('0xd'),_0xda95('0xe'),_0xda95('0xf')]},'log':_0xda95('0x10')});};};