2b28d0561082c1910657d2d31b3538637ef861a7
[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 _0xbb5d=['endOf','day','type','disposition','billableseconds','GetVoiceCallReports','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1a2c57,_0x39ffb2){var _0x1a9fd0=function(_0x47a5a2){while(--_0x47a5a2){_0x1a2c57['push'](_0x1a2c57['shift']());}};_0x1a9fd0(++_0x39ffb2);}(_0xbb5d,0x1d1));var _0xdbb5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbb5d[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xdbb5('0x0'));var client=require('../client');exports['create']=function(_0x39387b){return client[_0xdbb5('0x1')](_0xdbb5('0x2'),{'body':_[_0xdbb5('0x3')](_0x39387b,{'source':_0x39387b[_0xdbb5('0x4')],'destinationcontext':_0x39387b[_0xdbb5('0x5')],'callerid':_0x39387b['callerid'],'amaflags':_0xdbb5('0x6')}),'log':_0xdbb5('0x2')});};exports[_0xdbb5('0x7')]=function(){return function(){return client[_0xdbb5('0x1')](_0xdbb5('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')[_0xdbb5('0x9')](_0xdbb5('0xa')),moment()[_0xdbb5('0xb')](_0xdbb5('0xc'))[_0xdbb5('0x9')](_0xdbb5('0xa'))]}},'attributes':[_0xdbb5('0xd'),_0xdbb5('0xe'),'duration',_0xdbb5('0xf')]},'log':_0xdbb5('0x10')});};};