Built motion from commit (unavailable).|2.5.24
[motion2.git] / server / api / userVoiceQueue / userVoiceQueue.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 _0xc15c=['client','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x6182ff,_0x59d492){var _0x1cec22=function(_0x2e96f8){while(--_0x2e96f8){_0x6182ff['push'](_0x6182ff['shift']());}};_0x1cec22(++_0x59d492);}(_0xc15c,0xfa));var _0xcc15=function(_0x3d65f8,_0x4ccb45){_0x3d65f8=_0x3d65f8-0x0;var _0x1df443=_0xc15c[_0x3d65f8];return _0x1df443;};'use strict';var _=require(_0xcc15('0x0'));var util=require(_0xcc15('0x1'));var moment=require(_0xcc15('0x2'));var BPromise=require(_0xcc15('0x3'));var rs=require(_0xcc15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc15('0x5'))['db'];var utils=require(_0xcc15('0x6'));var logger=require(_0xcc15('0x7'))('rpc');var config=require(_0xcc15('0x8'));var jayson=require(_0xcc15('0x9'));var client=jayson[_0xcc15('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24d727,_0x254e30,_0x204f5d){return new BPromise(function(_0x31170d,_0x23ce39){return client['request'](_0x24d727,_0x204f5d)[_0xcc15('0xb')](function(_0x143881){logger[_0xcc15('0xc')](_0xcc15('0xd'),_0x254e30,_0xcc15('0xe'));logger['debug'](_0xcc15('0xf'),_0x254e30,_0xcc15('0xe'),JSON[_0xcc15('0x10')](_0x143881));if(_0x143881[_0xcc15('0x11')]){if(_0x143881[_0xcc15('0x11')]['code']===0x1f4){logger['error'](_0xcc15('0xd'),_0x254e30,_0x143881[_0xcc15('0x11')][_0xcc15('0x12')]);return _0x23ce39(_0x143881[_0xcc15('0x11')][_0xcc15('0x12')]);}logger[_0xcc15('0x11')](_0xcc15('0xd'),_0x254e30,_0x143881[_0xcc15('0x11')][_0xcc15('0x12')]);return _0x31170d(_0x143881[_0xcc15('0x11')]['message']);}else{logger[_0xcc15('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x254e30,'request\x20sent');_0x31170d(_0x143881['result'][_0xcc15('0x12')]);}})[_0xcc15('0x13')](function(_0x5ca35d){logger[_0xcc15('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x254e30,_0x5ca35d);_0x23ce39(_0x5ca35d);});});}