Built motion from commit da617fac.|2.6.6
[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 _0x6325=['GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','util','lodash','../client','create','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports'];(function(_0x428c99,_0x3f22c3){var _0x51c90f=function(_0x21a28e){while(--_0x21a28e){_0x428c99['push'](_0x428c99['shift']());}};_0x51c90f(++_0x3f22c3);}(_0x6325,0x118));var _0x5632=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6325[_0x4b369d];return _0x571a98;};'use strict';var moment=require('moment');var util=require(_0x5632('0x0'));var _=require(_0x5632('0x1'));var client=require(_0x5632('0x2'));exports[_0x5632('0x3')]=function(_0x2b8203){return client['Request'](_0x5632('0x4'),{'body':_[_0x5632('0x5')](_0x2b8203,{'source':_0x2b8203['calleridnum'],'destinationcontext':_0x2b8203[_0x5632('0x6')],'callerid':_0x2b8203[_0x5632('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x5632('0x4')});};exports[_0x5632('0x8')]=function(){return function(){return client['Request'](_0x5632('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x5632('0xa'))[_0x5632('0xb')](_0x5632('0xc')),moment()[_0x5632('0xd')](_0x5632('0xa'))[_0x5632('0xb')](_0x5632('0xc'))]}},'attributes':['type',_0x5632('0xe'),_0x5632('0xf'),_0x5632('0x10')]},'log':'GetVoiceCallReports'});};};