e0389c26d0ed79d06197c36d061635e4f2482426
[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 _0xa8b8=['day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xa8b8,0xaf));var _0x8a8b=function(_0x319209,_0x5913f0){_0x319209=_0x319209-0x0;var _0x2c1e3a=_0xa8b8[_0x319209];return _0x2c1e3a;};'use strict';var moment=require(_0x8a8b('0x0'));var util=require(_0x8a8b('0x1'));var _=require('lodash');var client=require(_0x8a8b('0x2'));exports[_0x8a8b('0x3')]=function(_0x2260d0){return client[_0x8a8b('0x4')](_0x8a8b('0x5'),{'body':_['merge'](_0x2260d0,{'source':_0x2260d0[_0x8a8b('0x6')],'destinationcontext':_0x2260d0[_0x8a8b('0x7')],'callerid':_0x2260d0[_0x8a8b('0x8')],'amaflags':_0x8a8b('0x9')}),'log':_0x8a8b('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x8a8b('0xa'),{'options':{'where':{'type':[_0x8a8b('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x8a8b('0xc'))[_0x8a8b('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0x8a8b('0xd')](_0x8a8b('0xe'))]}},'attributes':['type',_0x8a8b('0xf'),'duration','billableseconds']},'log':_0x8a8b('0x10')});};};