Built motion from commit (unavailable).|2.5.4
[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 _0xe021=['disposition','duration','GetVoiceCallReports','../client','create','context','DOCUMENTATION','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x5e6e40,_0x28e2e3){var _0x160b17=function(_0x5a68f3){while(--_0x5a68f3){_0x5e6e40['push'](_0x5e6e40['shift']());}};_0x160b17(++_0x28e2e3);}(_0xe021,0xb9));var _0x1e02=function(_0x4f60f5,_0x2fcf76){_0x4f60f5=_0x4f60f5-0x0;var _0x18d003=_0xe021[_0x4f60f5];return _0x18d003;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require(_0x1e02('0x0'));exports[_0x1e02('0x1')]=function(_0x35f2a2){return client['Request']('CreateVoiceCallReport',{'body':_['merge'](_0x35f2a2,{'source':_0x35f2a2['calleridnum'],'destinationcontext':_0x35f2a2[_0x1e02('0x2')],'callerid':_0x35f2a2['callerid'],'amaflags':_0x1e02('0x3')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x1e02('0x4')],'createdAt':{'$between':[moment()[_0x1e02('0x5')](_0x1e02('0x6'))[_0x1e02('0x7')](_0x1e02('0x8')),moment()[_0x1e02('0x9')](_0x1e02('0x6'))[_0x1e02('0x7')](_0x1e02('0x8'))]}},'attributes':[_0x1e02('0xa'),_0x1e02('0xb'),_0x1e02('0xc'),'billableseconds']},'log':_0x1e02('0xd')});};};