Built motion from commit d32f51f5.|2.6.31
[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 _0xd64b=['../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2f3806,_0x5dfe77){var _0x5f112d=function(_0x39030b){while(--_0x39030b){_0x2f3806['push'](_0x2f3806['shift']());}};_0x5f112d(++_0x5dfe77);}(_0xd64b,0xf6));var _0xbd64=function(_0x551c0b,_0x2d9a29){_0x551c0b=_0x551c0b-0x0;var _0x176c38=_0xd64b[_0x551c0b];return _0x176c38;};'use strict';var _=require(_0xbd64('0x0'));var util=require(_0xbd64('0x1'));var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rs=require(_0xbd64('0x4'));var fs=require('fs');var Redis=require(_0xbd64('0x5'));var db=require(_0xbd64('0x6'))['db'];var utils=require(_0xbd64('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbd64('0x8'));var client=jayson['client'][_0xbd64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af2fb,_0x2e051c,_0x8b926d){return new BPromise(function(_0x3d6812,_0x40c940){return client[_0xbd64('0xa')](_0x2af2fb,_0x8b926d)[_0xbd64('0xb')](function(_0x2325c1){logger[_0xbd64('0xc')](_0xbd64('0xd'),_0x2e051c,_0xbd64('0xe'));logger[_0xbd64('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2e051c,_0xbd64('0xe'),JSON[_0xbd64('0x10')](_0x2325c1));if(_0x2325c1[_0xbd64('0x11')]){if(_0x2325c1[_0xbd64('0x11')][_0xbd64('0x12')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2e051c,_0x2325c1[_0xbd64('0x11')]['message']);return _0x40c940(_0x2325c1[_0xbd64('0x11')][_0xbd64('0x13')]);}logger[_0xbd64('0x11')](_0xbd64('0xd'),_0x2e051c,_0x2325c1[_0xbd64('0x11')][_0xbd64('0x13')]);return _0x3d6812(_0x2325c1[_0xbd64('0x11')][_0xbd64('0x13')]);}else{logger[_0xbd64('0xc')](_0xbd64('0xd'),_0x2e051c,_0xbd64('0xe'));_0x3d6812(_0x2325c1['result'][_0xbd64('0x13')]);}})[_0xbd64('0x14')](function(_0x86ce22){logger[_0xbd64('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x2e051c,_0x86ce22);_0x40c940(_0x86ce22);});});}