Built motion from commit (unavailable).|2.5.1
[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 _0x010c=['request\x20sent','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x010c,0x1cd));var _0xc010=function(_0x186453,_0x3b626e){_0x186453=_0x186453-0x0;var _0x30bd3c=_0x010c[_0x186453];return _0x30bd3c;};'use strict';var _=require(_0xc010('0x0'));var util=require(_0xc010('0x1'));var moment=require('moment');var BPromise=require(_0xc010('0x2'));var rs=require(_0xc010('0x3'));var fs=require('fs');var Redis=require(_0xc010('0x4'));var db=require(_0xc010('0x5'))['db'];var utils=require(_0xc010('0x6'));var logger=require(_0xc010('0x7'))(_0xc010('0x8'));var config=require(_0xc010('0x9'));var jayson=require(_0xc010('0xa'));var client=jayson[_0xc010('0xb')][_0xc010('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x279c27,_0x50e090,_0x41ed3d){return new BPromise(function(_0x5f0741,_0x2f20d4){return client[_0xc010('0xd')](_0x279c27,_0x41ed3d)['then'](function(_0x559eb0){logger[_0xc010('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x50e090,'request\x20sent');logger[_0xc010('0xf')](_0xc010('0x10'),_0x50e090,'request\x20sent',JSON[_0xc010('0x11')](_0x559eb0));if(_0x559eb0[_0xc010('0x12')]){if(_0x559eb0[_0xc010('0x12')][_0xc010('0x13')]===0x1f4){logger['error'](_0xc010('0x14'),_0x50e090,_0x559eb0[_0xc010('0x12')][_0xc010('0x15')]);return _0x2f20d4(_0x559eb0['error'][_0xc010('0x15')]);}logger[_0xc010('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x50e090,_0x559eb0[_0xc010('0x12')]['message']);return _0x5f0741(_0x559eb0['error']['message']);}else{logger[_0xc010('0xe')](_0xc010('0x14'),_0x50e090,_0xc010('0x16'));_0x5f0741(_0x559eb0['result'][_0xc010('0x15')]);}})['catch'](function(_0x501a99){logger['error'](_0xc010('0x14'),_0x50e090,_0x501a99);_0x2f20d4(_0x501a99);});});}