Built motion from commit (unavailable).|2.5.27
[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 _0xf03f=['code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14525d,_0x747b83){var _0x26b05c=function(_0xf98e52){while(--_0xf98e52){_0x14525d['push'](_0x14525d['shift']());}};_0x26b05c(++_0x747b83);}(_0xf03f,0x194));var _0xff03=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xf03f[_0x4063a4];return _0x17908d;};'use strict';var _=require(_0xff03('0x0'));var util=require(_0xff03('0x1'));var moment=require(_0xff03('0x2'));var BPromise=require(_0xff03('0x3'));var rs=require(_0xff03('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff03('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff03('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xff03('0x7'));var client=jayson[_0xff03('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10314a,_0x697859,_0x26697e){return new BPromise(function(_0x5e72d4,_0x59b8c1){return client[_0xff03('0x9')](_0x10314a,_0x26697e)[_0xff03('0xa')](function(_0x5300c7){logger[_0xff03('0xb')](_0xff03('0xc'),_0x697859,_0xff03('0xd'));logger['debug'](_0xff03('0xe'),_0x697859,_0xff03('0xd'),JSON[_0xff03('0xf')](_0x5300c7));if(_0x5300c7['error']){if(_0x5300c7['error'][_0xff03('0x10')]===0x1f4){logger[_0xff03('0x11')](_0xff03('0xc'),_0x697859,_0x5300c7[_0xff03('0x11')][_0xff03('0x12')]);return _0x59b8c1(_0x5300c7['error'][_0xff03('0x12')]);}logger[_0xff03('0x11')](_0xff03('0xc'),_0x697859,_0x5300c7[_0xff03('0x11')][_0xff03('0x12')]);return _0x5e72d4(_0x5300c7[_0xff03('0x11')]['message']);}else{logger[_0xff03('0xb')](_0xff03('0xc'),_0x697859,_0xff03('0xd'));_0x5e72d4(_0x5300c7[_0xff03('0x13')][_0xff03('0x12')]);}})[_0xff03('0x14')](function(_0x4e67aa){logger['error'](_0xff03('0xc'),_0x697859,_0x4e67aa);_0x59b8c1(_0x4e67aa);});});}