Built motion from commit (unavailable).|2.4.20
[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 _0xdd83=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x431e76,_0xe29ef1){var _0x2a85f0=function(_0x5e2413){while(--_0x5e2413){_0x431e76['push'](_0x431e76['shift']());}};_0x2a85f0(++_0xe29ef1);}(_0xdd83,0x85));var _0x3dd8=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xdd83[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x3dd8('0x0'));var util=require('util');var moment=require(_0x3dd8('0x1'));var BPromise=require(_0x3dd8('0x2'));var rs=require(_0x3dd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3dd8('0x4'))['db'];var utils=require(_0x3dd8('0x5'));var logger=require(_0x3dd8('0x6'))(_0x3dd8('0x7'));var config=require(_0x3dd8('0x8'));var jayson=require(_0x3dd8('0x9'));var client=jayson[_0x3dd8('0xa')][_0x3dd8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd642,_0x5b4211,_0x12c274){return new BPromise(function(_0x53f845,_0x96352f){return client['request'](_0x5bd642,_0x12c274)[_0x3dd8('0xc')](function(_0x4782a4){logger[_0x3dd8('0xd')](_0x3dd8('0xe'),_0x5b4211,_0x3dd8('0xf'));logger[_0x3dd8('0x10')](_0x3dd8('0x11'),_0x5b4211,_0x3dd8('0xf'),JSON[_0x3dd8('0x12')](_0x4782a4));if(_0x4782a4[_0x3dd8('0x13')]){if(_0x4782a4[_0x3dd8('0x13')][_0x3dd8('0x14')]===0x1f4){logger[_0x3dd8('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x5b4211,_0x4782a4['error'][_0x3dd8('0x15')]);return _0x96352f(_0x4782a4[_0x3dd8('0x13')]['message']);}logger['error'](_0x3dd8('0xe'),_0x5b4211,_0x4782a4[_0x3dd8('0x13')][_0x3dd8('0x15')]);return _0x53f845(_0x4782a4[_0x3dd8('0x13')][_0x3dd8('0x15')]);}else{logger['info'](_0x3dd8('0xe'),_0x5b4211,_0x3dd8('0xf'));_0x53f845(_0x4782a4[_0x3dd8('0x16')]['message']);}})['catch'](function(_0x13d295){logger[_0x3dd8('0x13')](_0x3dd8('0xe'),_0x5b4211,_0x13d295);_0x96352f(_0x13d295);});});}