501e7bccc1671c1b2c3703f5e44daf094c73d9f4
[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 _0xa246=['callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','type','disposition','duration','billableseconds','moment','util','../client','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0xa246,0xfd));var _0x6a24=function(_0x469004,_0x42ff12){_0x469004=_0x469004-0x0;var _0x1e1c76=_0xa246[_0x469004];return _0x1e1c76;};'use strict';var moment=require(_0x6a24('0x0'));var util=require(_0x6a24('0x1'));var _=require('lodash');var client=require(_0x6a24('0x2'));exports['create']=function(_0x3605a8){return client[_0x6a24('0x3')](_0x6a24('0x4'),{'body':_[_0x6a24('0x5')](_0x3605a8,{'source':_0x3605a8[_0x6a24('0x6')],'destinationcontext':_0x3605a8['context'],'callerid':_0x3605a8[_0x6a24('0x7')],'amaflags':_0x6a24('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x6a24('0x9')]=function(){return function(){return client['Request'](_0x6a24('0xa'),{'options':{'where':{'type':[_0x6a24('0xb')],'createdAt':{'$between':[moment()[_0x6a24('0xc')]('day')[_0x6a24('0xd')](_0x6a24('0xe')),moment()['endOf'](_0x6a24('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x6a24('0x10'),_0x6a24('0x11'),_0x6a24('0x12'),_0x6a24('0x13')]},'log':'GetVoiceCallReports'});};};