08f58c693e018aa07b2e1117d12148b461c83ffe
[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 _0x4aa8=['duration','billableseconds','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x131415,_0x28607d){var _0x2b4605=function(_0x560bf3){while(--_0x560bf3){_0x131415['push'](_0x131415['shift']());}};_0x2b4605(++_0x28607d);}(_0x4aa8,0x162));var _0x84aa=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x4aa8[_0x50007c];return _0x5c1ec7;};'use strict';var moment=require(_0x84aa('0x0'));var util=require('util');var _=require(_0x84aa('0x1'));var client=require(_0x84aa('0x2'));exports[_0x84aa('0x3')]=function(_0x13e73f){return client[_0x84aa('0x4')](_0x84aa('0x5'),{'body':_[_0x84aa('0x6')](_0x13e73f,{'source':_0x13e73f[_0x84aa('0x7')],'destinationcontext':_0x13e73f[_0x84aa('0x8')],'callerid':_0x13e73f[_0x84aa('0x9')],'amaflags':_0x84aa('0xa')}),'log':'CreateVoiceCallReport'});};exports[_0x84aa('0xb')]=function(){return function(){return client[_0x84aa('0x4')](_0x84aa('0xc'),{'options':{'where':{'type':[_0x84aa('0xd')],'createdAt':{'$between':[moment()[_0x84aa('0xe')](_0x84aa('0xf'))[_0x84aa('0x10')](_0x84aa('0x11')),moment()[_0x84aa('0x12')]('day')[_0x84aa('0x10')](_0x84aa('0x11'))]}},'attributes':[_0x84aa('0x13'),'disposition',_0x84aa('0x14'),_0x84aa('0x15')]},'log':'GetVoiceCallReports'});};};