1e7bbeb4a9bcc721976b645078b24688bb750724
[motion2.git] / server / api / voiceTransferReport / voiceTransferReport.rpc.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 _0x95e9=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VoiceTransferReport','create','body','options','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0x95e9,0xfd));var _0x995e=function(_0x105ace,_0x3bb3c1){_0x105ace=_0x105ace-0x0;var _0x3131b7=_0x95e9[_0x105ace];return _0x3131b7;};'use strict';var _=require('lodash');var util=require(_0x995e('0x0'));var moment=require(_0x995e('0x1'));var BPromise=require(_0x995e('0x2'));var rs=require(_0x995e('0x3'));var fs=require('fs');var Redis=require(_0x995e('0x4'));var db=require(_0x995e('0x5'))['db'];var utils=require(_0x995e('0x6'));var logger=require(_0x995e('0x7'))(_0x995e('0x8'));var config=require(_0x995e('0x9'));var jayson=require(_0x995e('0xa'));var client=jayson[_0x995e('0xb')][_0x995e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x255236,_0x32cff1,_0x4595e0){return new BPromise(function(_0x2632b9,_0x5434e2){return client[_0x995e('0xd')](_0x255236,_0x4595e0)[_0x995e('0xe')](function(_0x30ec6f){logger[_0x995e('0xf')](_0x995e('0x10'),_0x32cff1,_0x995e('0x11'));logger[_0x995e('0x12')](_0x995e('0x13'),_0x32cff1,_0x995e('0x11'),JSON[_0x995e('0x14')](_0x30ec6f));if(_0x30ec6f['error']){if(_0x30ec6f[_0x995e('0x15')]['code']===0x1f4){logger['error'](_0x995e('0x10'),_0x32cff1,_0x30ec6f[_0x995e('0x15')]['message']);return _0x5434e2(_0x30ec6f[_0x995e('0x15')][_0x995e('0x16')]);}logger[_0x995e('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x32cff1,_0x30ec6f[_0x995e('0x15')][_0x995e('0x16')]);return _0x2632b9(_0x30ec6f[_0x995e('0x15')][_0x995e('0x16')]);}else{logger[_0x995e('0xf')](_0x995e('0x10'),_0x32cff1,_0x995e('0x11'));_0x2632b9(_0x30ec6f['result'][_0x995e('0x16')]);}})[_0x995e('0x17')](function(_0x537982){logger[_0x995e('0x15')](_0x995e('0x10'),_0x32cff1,_0x537982);_0x5434e2(_0x537982);});});}exports['CreateVoiceTransferReport']=function(_0x3aae80){var _0x4b127f=this;return new Promise(function(_0x5cbbbf,_0x4ea95c){return db[_0x995e('0x18')][_0x995e('0x19')](_0x3aae80[_0x995e('0x1a')],{'raw':_0x3aae80[_0x995e('0x1b')]?_0x3aae80['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x37acea){logger[_0x995e('0xf')](_0x995e('0x1c'),_0x3aae80);logger[_0x995e('0x12')]('CreateVoiceTransferReport',_0x3aae80,JSON[_0x995e('0x14')](_0x37acea));_0x5cbbbf(_0x37acea);})['catch'](function(_0x1d0380){logger[_0x995e('0x15')]('CreateVoiceTransferReport',_0x1d0380[_0x995e('0x16')],_0x3aae80);_0x4ea95c(_0x4b127f[_0x995e('0x15')](0x1f4,_0x1d0380[_0x995e('0x16')]));});});};