Built motion from commit (unavailable).|2.5.28
[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 _0xbdea=['rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x42f6a5,_0x18bf00){var _0x3fa7db=function(_0x2f7c44){while(--_0x2f7c44){_0x42f6a5['push'](_0x42f6a5['shift']());}};_0x3fa7db(++_0x18bf00);}(_0xbdea,0x8c));var _0xabde=function(_0x34b863,_0x572731){_0x34b863=_0x34b863-0x0;var _0x42e135=_0xbdea[_0x34b863];return _0x42e135;};'use strict';var _=require(_0xabde('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xabde('0x1'));var rs=require(_0xabde('0x2'));var fs=require('fs');var Redis=require(_0xabde('0x3'));var db=require(_0xabde('0x4'))['db'];var utils=require(_0xabde('0x5'));var logger=require(_0xabde('0x6'))(_0xabde('0x7'));var config=require(_0xabde('0x8'));var jayson=require(_0xabde('0x9'));var client=jayson[_0xabde('0xa')][_0xabde('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e1c1c,_0x283824,_0x20a0c2){return new BPromise(function(_0xa1b667,_0x465bf7){return client['request'](_0x2e1c1c,_0x20a0c2)[_0xabde('0xc')](function(_0x359017){logger[_0xabde('0xd')](_0xabde('0xe'),_0x283824,_0xabde('0xf'));logger[_0xabde('0x10')](_0xabde('0x11'),_0x283824,_0xabde('0xf'),JSON['stringify'](_0x359017));if(_0x359017[_0xabde('0x12')]){if(_0x359017['error']['code']===0x1f4){logger[_0xabde('0x12')](_0xabde('0xe'),_0x283824,_0x359017['error'][_0xabde('0x13')]);return _0x465bf7(_0x359017[_0xabde('0x12')]['message']);}logger[_0xabde('0x12')](_0xabde('0xe'),_0x283824,_0x359017['error'][_0xabde('0x13')]);return _0xa1b667(_0x359017[_0xabde('0x12')]['message']);}else{logger['info'](_0xabde('0xe'),_0x283824,_0xabde('0xf'));_0xa1b667(_0x359017['result'][_0xabde('0x13')]);}})[_0xabde('0x14')](function(_0xf2c2ce){logger[_0xabde('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x283824,_0xf2c2ce);_0x465bf7(_0xf2c2ce);});});}