4d433496472c8097a0707f0df2b6a505dcac08ba
[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 _0xa566=['outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','duration','billableseconds','GetVoiceCallReports','moment','util','create','Request','CreateVoiceCallReport','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x1cf745,_0x526146){var _0xeedd5f=function(_0x5afa45){while(--_0x5afa45){_0x1cf745['push'](_0x1cf745['shift']());}};_0xeedd5f(++_0x526146);}(_0xa566,0x1bf));var _0x6a56=function(_0x8b3257,_0x59ce3a){_0x8b3257=_0x8b3257-0x0;var _0x1ead89=_0xa566[_0x8b3257];return _0x1ead89;};'use strict';var moment=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var _=require('lodash');var client=require('../client');exports[_0x6a56('0x2')]=function(_0x427fa3){return client[_0x6a56('0x3')](_0x6a56('0x4'),{'body':_['merge'](_0x427fa3,{'source':_0x427fa3['calleridnum'],'destinationcontext':_0x427fa3['context'],'callerid':_0x427fa3[_0x6a56('0x5')],'amaflags':_0x6a56('0x6')}),'log':_0x6a56('0x4')});};exports[_0x6a56('0x7')]=function(){return function(){return client[_0x6a56('0x3')](_0x6a56('0x8'),{'options':{'where':{'type':[_0x6a56('0x9')],'createdAt':{'$between':[moment()[_0x6a56('0xa')](_0x6a56('0xb'))['format'](_0x6a56('0xc')),moment()[_0x6a56('0xd')]('day')[_0x6a56('0xe')](_0x6a56('0xc'))]}},'attributes':[_0x6a56('0xf'),'disposition',_0x6a56('0x10'),_0x6a56('0x11')]},'log':_0x6a56('0x12')});};};