a554809b04745b9d7edb3aca1f0140d39db4efbb
[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 _0x5812=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','context','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0x2021f7,_0x1fafe1){var _0x1de488=function(_0x2a3c1d){while(--_0x2a3c1d){_0x2021f7['push'](_0x2021f7['shift']());}};_0x1de488(++_0x1fafe1);}(_0x5812,0x15e));var _0x2581=function(_0x1ce8ab,_0x56e76b){_0x1ce8ab=_0x1ce8ab-0x0;var _0x101c2d=_0x5812[_0x1ce8ab];return _0x101c2d;};'use strict';var moment=require(_0x2581('0x0'));var util=require(_0x2581('0x1'));var _=require(_0x2581('0x2'));var client=require(_0x2581('0x3'));exports['create']=function(_0xc37c76){return client[_0x2581('0x4')](_0x2581('0x5'),{'body':_[_0x2581('0x6')](_0xc37c76,{'source':_0xc37c76['calleridnum'],'destinationcontext':_0xc37c76[_0x2581('0x7')],'callerid':_0xc37c76['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x2581('0x5')});};exports[_0x2581('0x8')]=function(){return function(){return client[_0x2581('0x4')](_0x2581('0x9'),{'options':{'where':{'type':[_0x2581('0xa')],'createdAt':{'$between':[moment()[_0x2581('0xb')](_0x2581('0xc'))[_0x2581('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x2581('0xc'))[_0x2581('0xd')](_0x2581('0xe'))]}},'attributes':['type',_0x2581('0xf'),_0x2581('0x10'),_0x2581('0x11')]},'log':_0x2581('0x12')});};};