6d7a007b684a478485b6214a4d117c34bd9e2db0
[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 _0xe20d=['type','disposition','duration','GetVoiceCallReports','moment','lodash','../client','Request','CreateVoiceCallReport','calleridnum','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf'];(function(_0x5c956b,_0xa87d11){var _0xaff46a=function(_0x463d89){while(--_0x463d89){_0x5c956b['push'](_0x5c956b['shift']());}};_0xaff46a(++_0xa87d11);}(_0xe20d,0x1d8));var _0xde20=function(_0x36ed6c,_0x302b25){_0x36ed6c=_0x36ed6c-0x0;var _0x13a7e4=_0xe20d[_0x36ed6c];return _0x13a7e4;};'use strict';var moment=require(_0xde20('0x0'));var util=require('util');var _=require(_0xde20('0x1'));var client=require(_0xde20('0x2'));exports['create']=function(_0x116230){return client[_0xde20('0x3')](_0xde20('0x4'),{'body':_['merge'](_0x116230,{'source':_0x116230[_0xde20('0x5')],'destinationcontext':_0x116230['context'],'callerid':_0x116230[_0xde20('0x6')],'amaflags':'DOCUMENTATION'}),'log':_0xde20('0x4')});};exports[_0xde20('0x7')]=function(){return function(){return client[_0xde20('0x3')](_0xde20('0x8'),{'options':{'where':{'type':[_0xde20('0x9')],'createdAt':{'$between':[moment()[_0xde20('0xa')](_0xde20('0xb'))[_0xde20('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xde20('0xd')]('day')[_0xde20('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xde20('0xe'),_0xde20('0xf'),_0xde20('0x10'),'billableseconds']},'log':_0xde20('0x11')});};};