Built motion from commit (unavailable).|2.5.23
[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 _0x809b=['code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x23c2f8,_0x301a46){var _0xf10de0=function(_0x5ef624){while(--_0x5ef624){_0x23c2f8['push'](_0x23c2f8['shift']());}};_0xf10de0(++_0x301a46);}(_0x809b,0x1bd));var _0xb809=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x809b[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0xb809('0x0'));var moment=require(_0xb809('0x1'));var BPromise=require(_0xb809('0x2'));var rs=require(_0xb809('0x3'));var fs=require('fs');var Redis=require(_0xb809('0x4'));var db=require(_0xb809('0x5'))['db'];var utils=require(_0xb809('0x6'));var logger=require(_0xb809('0x7'))(_0xb809('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb809('0x9')][_0xb809('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf2fe,_0x25efe6,_0x7ad8bd){return new BPromise(function(_0x3e96e8,_0x481f81){return client['request'](_0x5bf2fe,_0x7ad8bd)[_0xb809('0xb')](function(_0x37c3a0){logger['info'](_0xb809('0xc'),_0x25efe6,'request\x20sent');logger[_0xb809('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x25efe6,_0xb809('0xe'),JSON[_0xb809('0xf')](_0x37c3a0));if(_0x37c3a0[_0xb809('0x10')]){if(_0x37c3a0[_0xb809('0x10')][_0xb809('0x11')]===0x1f4){logger['error'](_0xb809('0xc'),_0x25efe6,_0x37c3a0['error'][_0xb809('0x12')]);return _0x481f81(_0x37c3a0[_0xb809('0x10')][_0xb809('0x12')]);}logger[_0xb809('0x10')](_0xb809('0xc'),_0x25efe6,_0x37c3a0[_0xb809('0x10')][_0xb809('0x12')]);return _0x3e96e8(_0x37c3a0[_0xb809('0x10')][_0xb809('0x12')]);}else{logger[_0xb809('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x25efe6,'request\x20sent');_0x3e96e8(_0x37c3a0['result'][_0xb809('0x12')]);}})[_0xb809('0x14')](function(_0x1821e1){logger[_0xb809('0x10')](_0xb809('0xc'),_0x25efe6,_0x1821e1);_0x481f81(_0x1821e1);});});}