419f3de97721a22fec163be669b9e8bf9d1ab631
[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 _0x6621=['billableseconds','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','disposition','duration'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x6621,0xc0));var _0x1662=function(_0x418afb,_0x4ebded){_0x418afb=_0x418afb-0x0;var _0x1f67e4=_0x6621[_0x418afb];return _0x1f67e4;};'use strict';var moment=require(_0x1662('0x0'));var util=require(_0x1662('0x1'));var _=require(_0x1662('0x2'));var client=require('../client');exports['create']=function(_0x3ab191){return client[_0x1662('0x3')](_0x1662('0x4'),{'body':_[_0x1662('0x5')](_0x3ab191,{'source':_0x3ab191[_0x1662('0x6')],'destinationcontext':_0x3ab191[_0x1662('0x7')],'callerid':_0x3ab191[_0x1662('0x8')],'amaflags':_0x1662('0x9')}),'log':_0x1662('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x1662('0xa')],'createdAt':{'$between':[moment()['startOf']('day')[_0x1662('0xb')](_0x1662('0xc')),moment()[_0x1662('0xd')](_0x1662('0xe'))['format'](_0x1662('0xc'))]}},'attributes':['type',_0x1662('0xf'),_0x1662('0x10'),_0x1662('0x11')]},'log':_0x1662('0x12')});};};