4281366637d89d1e76993abdfd49ca4944ffd117
[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 _0x7172=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','moment','lodash','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','Request'];(function(_0x4cef95,_0x361d19){var _0x1d72e9=function(_0x310d06){while(--_0x310d06){_0x4cef95['push'](_0x4cef95['shift']());}};_0x1d72e9(++_0x361d19);}(_0x7172,0x167));var _0x2717=function(_0x11aa9c,_0x2e9dd9){_0x11aa9c=_0x11aa9c-0x0;var _0x14f952=_0x7172[_0x11aa9c];return _0x14f952;};'use strict';var moment=require(_0x2717('0x0'));var util=require('util');var _=require(_0x2717('0x1'));var client=require('../client');exports['create']=function(_0x222542){return client['Request']('CreateVoiceCallReport',{'body':_[_0x2717('0x2')](_0x222542,{'source':_0x222542[_0x2717('0x3')],'destinationcontext':_0x222542[_0x2717('0x4')],'callerid':_0x222542[_0x2717('0x5')],'amaflags':_0x2717('0x6')}),'log':_0x2717('0x7')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x2717('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x2717('0x9')],'createdAt':{'$between':[moment()[_0x2717('0xa')](_0x2717('0xb'))[_0x2717('0xc')](_0x2717('0xd')),moment()['endOf'](_0x2717('0xb'))[_0x2717('0xc')](_0x2717('0xd'))]}},'attributes':['type',_0x2717('0xe'),'duration',_0x2717('0xf')]},'log':'GetVoiceCallReports'});};};