Built motion from commit 616d3211.|2.6.4
[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 _0x820a=['http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x4368b1,_0x490382){var _0x2cb611=function(_0x5ea25c){while(--_0x5ea25c){_0x4368b1['push'](_0x4368b1['shift']());}};_0x2cb611(++_0x490382);}(_0x820a,0x175));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa820('0x0'));var util=require(_0xa820('0x1'));var moment=require(_0xa820('0x2'));var BPromise=require(_0xa820('0x3'));var rs=require(_0xa820('0x4'));var fs=require('fs');var Redis=require(_0xa820('0x5'));var db=require(_0xa820('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa820('0x7'));var config=require(_0xa820('0x8'));var jayson=require(_0xa820('0x9'));var client=jayson[_0xa820('0xa')][_0xa820('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d0bb8,_0x1b6e92,_0x12d213){return new BPromise(function(_0x7ef7be,_0x1cb985){return client[_0xa820('0xc')](_0x3d0bb8,_0x12d213)[_0xa820('0xd')](function(_0x407a24){logger['info'](_0xa820('0xe'),_0x1b6e92,_0xa820('0xf'));logger[_0xa820('0x10')](_0xa820('0x11'),_0x1b6e92,'request\x20sent',JSON[_0xa820('0x12')](_0x407a24));if(_0x407a24[_0xa820('0x13')]){if(_0x407a24[_0xa820('0x13')][_0xa820('0x14')]===0x1f4){logger[_0xa820('0x13')](_0xa820('0xe'),_0x1b6e92,_0x407a24[_0xa820('0x13')][_0xa820('0x15')]);return _0x1cb985(_0x407a24[_0xa820('0x13')][_0xa820('0x15')]);}logger[_0xa820('0x13')](_0xa820('0xe'),_0x1b6e92,_0x407a24[_0xa820('0x13')][_0xa820('0x15')]);return _0x7ef7be(_0x407a24['error'][_0xa820('0x15')]);}else{logger[_0xa820('0x16')](_0xa820('0xe'),_0x1b6e92,_0xa820('0xf'));_0x7ef7be(_0x407a24['result']['message']);}})[_0xa820('0x17')](function(_0x31f32c){logger[_0xa820('0x13')](_0xa820('0xe'),_0x1b6e92,_0x31f32c);_0x1cb985(_0x31f32c);});});}