b45c85031242a28b9f42e80837ebe03df6a9bbb0
[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 _0xb8f1=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport'];(function(_0x1ef6fa,_0x4fd8c6){var _0x54977d=function(_0x153699){while(--_0x153699){_0x1ef6fa['push'](_0x1ef6fa['shift']());}};_0x54977d(++_0x4fd8c6);}(_0xb8f1,0x180));var _0x1b8f=function(_0xc1676d,_0x2f2b98){_0xc1676d=_0xc1676d-0x0;var _0x2e9c2d=_0xb8f1[_0xc1676d];return _0x2e9c2d;};'use strict';var moment=require('moment');var util=require(_0x1b8f('0x0'));var _=require(_0x1b8f('0x1'));var client=require(_0x1b8f('0x2'));exports[_0x1b8f('0x3')]=function(_0x26d9ad){return client[_0x1b8f('0x4')](_0x1b8f('0x5'),{'body':_[_0x1b8f('0x6')](_0x26d9ad,{'source':_0x26d9ad[_0x1b8f('0x7')],'destinationcontext':_0x26d9ad[_0x1b8f('0x8')],'callerid':_0x26d9ad[_0x1b8f('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x1b8f('0x5')});};exports[_0x1b8f('0xa')]=function(){return function(){return client[_0x1b8f('0x4')](_0x1b8f('0xb'),{'options':{'where':{'type':[_0x1b8f('0xc')],'createdAt':{'$between':[moment()[_0x1b8f('0xd')](_0x1b8f('0xe'))[_0x1b8f('0xf')](_0x1b8f('0x10')),moment()[_0x1b8f('0x11')](_0x1b8f('0xe'))[_0x1b8f('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x1b8f('0x12'),'disposition',_0x1b8f('0x13'),_0x1b8f('0x14')]},'log':_0x1b8f('0x15')});};};