72659c558c9c0235ee836f80f8897759afcb1138
[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 _0xd00b=['day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','startOf'];(function(_0xbdbf51,_0x3482a7){var _0x3c0dcc=function(_0x1e2f87){while(--_0x1e2f87){_0xbdbf51['push'](_0xbdbf51['shift']());}};_0x3c0dcc(++_0x3482a7);}(_0xd00b,0x1ab));var _0xbd00=function(_0x369086,_0x873f48){_0x369086=_0x369086-0x0;var _0x359c5c=_0xd00b[_0x369086];return _0x359c5c;};'use strict';var moment=require(_0xbd00('0x0'));var util=require(_0xbd00('0x1'));var _=require(_0xbd00('0x2'));var client=require(_0xbd00('0x3'));exports[_0xbd00('0x4')]=function(_0x934b97){return client[_0xbd00('0x5')](_0xbd00('0x6'),{'body':_[_0xbd00('0x7')](_0x934b97,{'source':_0x934b97['calleridnum'],'destinationcontext':_0x934b97[_0xbd00('0x8')],'callerid':_0x934b97[_0xbd00('0x9')],'amaflags':_0xbd00('0xa')}),'log':_0xbd00('0x6')});};exports[_0xbd00('0xb')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xbd00('0xc')](_0xbd00('0xd'))['format'](_0xbd00('0xe')),moment()[_0xbd00('0xf')](_0xbd00('0xd'))[_0xbd00('0x10')](_0xbd00('0xe'))]}},'attributes':['type',_0xbd00('0x11'),_0xbd00('0x12'),_0xbd00('0x13')]},'log':'GetVoiceCallReports'});};};