ad72415187a250892f2b41eb4c264c35e27ae5fe
[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 _0x751a=['Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','moment','util','../client','create','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x751a,0x1ea));var _0xa751=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x751a[_0x725a4c];return _0x37b2cc;};'use strict';var moment=require(_0xa751('0x0'));var util=require(_0xa751('0x1'));var _=require('lodash');var client=require(_0xa751('0x2'));exports[_0xa751('0x3')]=function(_0xd51a04){return client['Request'](_0xa751('0x4'),{'body':_['merge'](_0xd51a04,{'source':_0xd51a04[_0xa751('0x5')],'destinationcontext':_0xd51a04[_0xa751('0x6')],'callerid':_0xd51a04[_0xa751('0x7')],'amaflags':_0xa751('0x8')}),'log':_0xa751('0x4')});};exports[_0xa751('0x9')]=function(){return function(){return client[_0xa751('0xa')](_0xa751('0xb'),{'options':{'where':{'type':[_0xa751('0xc')],'createdAt':{'$between':[moment()[_0xa751('0xd')](_0xa751('0xe'))[_0xa751('0xf')](_0xa751('0x10')),moment()['endOf'](_0xa751('0xe'))['format'](_0xa751('0x10'))]}},'attributes':[_0xa751('0x11'),_0xa751('0x12'),'duration',_0xa751('0x13')]},'log':'GetVoiceCallReports'});};};