Built motion from commit 3c2ce842.|2.6.31
[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 _0x3e0e=['callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','GetVoiceCallReports','moment','util','../client','create','CreateVoiceCallReport','merge','calleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e0e,0x14f));var _0xe3e0=function(_0x42453c,_0x5cc5bf){_0x42453c=_0x42453c-0x0;var _0x5b3465=_0x3e0e[_0x42453c];return _0x5b3465;};'use strict';var moment=require(_0xe3e0('0x0'));var util=require(_0xe3e0('0x1'));var _=require('lodash');var client=require(_0xe3e0('0x2'));exports[_0xe3e0('0x3')]=function(_0x230604){return client['Request'](_0xe3e0('0x4'),{'body':_[_0xe3e0('0x5')](_0x230604,{'source':_0x230604[_0xe3e0('0x6')],'destinationcontext':_0x230604['context'],'callerid':_0x230604[_0xe3e0('0x7')],'amaflags':_0xe3e0('0x8')}),'log':_0xe3e0('0x4')});};exports[_0xe3e0('0x9')]=function(){return function(){return client[_0xe3e0('0xa')](_0xe3e0('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xe3e0('0xc'))[_0xe3e0('0xd')](_0xe3e0('0xe')),moment()[_0xe3e0('0xf')](_0xe3e0('0xc'))[_0xe3e0('0xd')](_0xe3e0('0xe'))]}},'attributes':['type',_0xe3e0('0x10'),_0xe3e0('0x11'),'billableseconds']},'log':_0xe3e0('0x12')});};};