fce86c1f170f5c2d4b922f7917047faf75b82b50
[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 _0x4e03=['YYYY-MM-DD\x20HH:mm:ss','type','disposition','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','calleridnum','callerid','DOCUMENTATION','outbound','startOf','day','format','endOf'];(function(_0x1d9333,_0xe1a4e4){var _0x4ea612=function(_0x468edc){while(--_0x468edc){_0x1d9333['push'](_0x1d9333['shift']());}};_0x4ea612(++_0xe1a4e4);}(_0x4e03,0x82));var _0x34e0=function(_0x18d7d1,_0x7d2e7d){_0x18d7d1=_0x18d7d1-0x0;var _0x140009=_0x4e03[_0x18d7d1];return _0x140009;};'use strict';var moment=require(_0x34e0('0x0'));var util=require(_0x34e0('0x1'));var _=require(_0x34e0('0x2'));var client=require('../client');exports[_0x34e0('0x3')]=function(_0x2cc572){return client[_0x34e0('0x4')](_0x34e0('0x5'),{'body':_['merge'](_0x2cc572,{'source':_0x2cc572[_0x34e0('0x6')],'destinationcontext':_0x2cc572['context'],'callerid':_0x2cc572[_0x34e0('0x7')],'amaflags':_0x34e0('0x8')}),'log':_0x34e0('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x34e0('0x9')],'createdAt':{'$between':[moment()[_0x34e0('0xa')](_0x34e0('0xb'))[_0x34e0('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x34e0('0xd')](_0x34e0('0xb'))[_0x34e0('0xc')](_0x34e0('0xe'))]}},'attributes':[_0x34e0('0xf'),_0x34e0('0x10'),'duration','billableseconds']},'log':_0x34e0('0x11')});};};