Built motion from commit b58257bb.|2.5.37
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.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 _0xd20f=['request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','client','http'];(function(_0x25df0b,_0xb959dd){var _0x375e6e=function(_0x30dadd){while(--_0x30dadd){_0x25df0b['push'](_0x25df0b['shift']());}};_0x375e6e(++_0xb959dd);}(_0xd20f,0xbf));var _0xfd20=function(_0x42500b,_0x56fa75){_0x42500b=_0x42500b-0x0;var _0x3ab73e=_0xd20f[_0x42500b];return _0x3ab73e;};'use strict';var _=require(_0xfd20('0x0'));var util=require(_0xfd20('0x1'));var moment=require('moment');var BPromise=require(_0xfd20('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd20('0x3'))['db'];var utils=require(_0xfd20('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd20('0x5')][_0xfd20('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x16ee70,_0x15c501,_0x1758bc){return new BPromise(function(_0x6d511,_0x2841f9){return client[_0xfd20('0x7')](_0x16ee70,_0x1758bc)['then'](function(_0x5a838a){logger[_0xfd20('0x8')](_0xfd20('0x9'),_0x15c501,_0xfd20('0xa'));logger[_0xfd20('0xb')](_0xfd20('0xc'),_0x15c501,_0xfd20('0xa'),JSON['stringify'](_0x5a838a));if(_0x5a838a[_0xfd20('0xd')]){if(_0x5a838a[_0xfd20('0xd')][_0xfd20('0xe')]===0x1f4){logger[_0xfd20('0xd')](_0xfd20('0x9'),_0x15c501,_0x5a838a[_0xfd20('0xd')][_0xfd20('0xf')]);return _0x2841f9(_0x5a838a['error'][_0xfd20('0xf')]);}logger[_0xfd20('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x15c501,_0x5a838a['error'][_0xfd20('0xf')]);return _0x6d511(_0x5a838a['error']['message']);}else{logger[_0xfd20('0x8')]('VoiceQueuesLog,\x20%s,\x20%s',_0x15c501,_0xfd20('0xa'));_0x6d511(_0x5a838a[_0xfd20('0x10')]['message']);}})[_0xfd20('0x11')](function(_0x227786){logger[_0xfd20('0xd')](_0xfd20('0x9'),_0x15c501,_0x227786);_0x2841f9(_0x227786);});});}