Built motion from commit (unavailable).|2.5.24
[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 _0xa3d1=['create','body','options','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa3d1,0x126));var _0x1a3d=function(_0x3030a9,_0x3e7be2){_0x3030a9=_0x3030a9-0x0;var _0x5e6b29=_0xa3d1[_0x3030a9];return _0x5e6b29;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var moment=require(_0x1a3d('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a3d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a3d('0x4'))['db'];var utils=require(_0x1a3d('0x5'));var logger=require(_0x1a3d('0x6'))(_0x1a3d('0x7'));var config=require(_0x1a3d('0x8'));var jayson=require(_0x1a3d('0x9'));var client=jayson[_0x1a3d('0xa')][_0x1a3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d4e12,_0x41e1fd,_0x59305b){return new BPromise(function(_0x3c560b,_0x415d45){return client[_0x1a3d('0xc')](_0x4d4e12,_0x59305b)['then'](function(_0xc6def0){logger[_0x1a3d('0xd')](_0x1a3d('0xe'),_0x41e1fd,_0x1a3d('0xf'));logger[_0x1a3d('0x10')](_0x1a3d('0x11'),_0x41e1fd,_0x1a3d('0xf'),JSON[_0x1a3d('0x12')](_0xc6def0));if(_0xc6def0['error']){if(_0xc6def0[_0x1a3d('0x13')][_0x1a3d('0x14')]===0x1f4){logger[_0x1a3d('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x41e1fd,_0xc6def0[_0x1a3d('0x13')]['message']);return _0x415d45(_0xc6def0['error']['message']);}logger[_0x1a3d('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x41e1fd,_0xc6def0[_0x1a3d('0x13')]['message']);return _0x3c560b(_0xc6def0['error'][_0x1a3d('0x15')]);}else{logger[_0x1a3d('0xd')](_0x1a3d('0xe'),_0x41e1fd,_0x1a3d('0xf'));_0x3c560b(_0xc6def0[_0x1a3d('0x16')]['message']);}})['catch'](function(_0xe1e7eb){logger[_0x1a3d('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x41e1fd,_0xe1e7eb);_0x415d45(_0xe1e7eb);});});}exports[_0x1a3d('0x17')]=function(_0x4a18e7){var _0xfc1d1c=this;return new Promise(function(_0x58be3b,_0x3f0765){return db[_0x1a3d('0x18')][_0x1a3d('0x19')](_0x4a18e7[_0x1a3d('0x1a')],{'raw':_0x4a18e7[_0x1a3d('0x1b')]?_0x4a18e7[_0x1a3d('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1a3d('0x1c')](function(_0x54a108){logger['info'](_0x1a3d('0x17'),_0x4a18e7);logger['debug'](_0x1a3d('0x17'),_0x4a18e7,JSON['stringify'](_0x54a108));_0x58be3b(_0x54a108);})['catch'](function(_0x46f597){logger[_0x1a3d('0x13')](_0x1a3d('0x17'),_0x46f597[_0x1a3d('0x15')],_0x4a18e7);_0x3f0765(_0xfc1d1c[_0x1a3d('0x13')](0x1f4,_0x46f597[_0x1a3d('0x15')]));});});};