Built motion from commit (unavailable).|2.5.23
[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 _0x7643=['duration','billableseconds','util','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0x450264,_0x5358c8){var _0x5b0b81=function(_0x57822e){while(--_0x57822e){_0x450264['push'](_0x450264['shift']());}};_0x5b0b81(++_0x5358c8);}(_0x7643,0x1a4));var _0x3764=function(_0x41cb50,_0x6015fb){_0x41cb50=_0x41cb50-0x0;var _0x445c4e=_0x7643[_0x41cb50];return _0x445c4e;};'use strict';var moment=require('moment');var util=require(_0x3764('0x0'));var _=require('lodash');var client=require(_0x3764('0x1'));exports['create']=function(_0x426856){return client[_0x3764('0x2')](_0x3764('0x3'),{'body':_[_0x3764('0x4')](_0x426856,{'source':_0x426856[_0x3764('0x5')],'destinationcontext':_0x426856[_0x3764('0x6')],'callerid':_0x426856[_0x3764('0x7')],'amaflags':_0x3764('0x8')}),'log':_0x3764('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x3764('0x2')](_0x3764('0x9'),{'options':{'where':{'type':[_0x3764('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x3764('0xb'))[_0x3764('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x3764('0xd')](_0x3764('0xb'))[_0x3764('0xc')](_0x3764('0xe'))]}},'attributes':[_0x3764('0xf'),_0x3764('0x10'),_0x3764('0x11'),_0x3764('0x12')]},'log':'GetVoiceCallReports'});};};