Built motion from commit (unavailable).|2.5.25
[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 _0xd4f4=['client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x1f1a29,_0x212f4a){var _0xbdb68e=function(_0x1a1cae){while(--_0x1a1cae){_0x1f1a29['push'](_0x1f1a29['shift']());}};_0xbdb68e(++_0x212f4a);}(_0xd4f4,0x1bc));var _0x4d4f=function(_0xfba842,_0x258fdf){_0xfba842=_0xfba842-0x0;var _0x4d0f7c=_0xd4f4[_0xfba842];return _0x4d0f7c;};'use strict';var _=require(_0x4d4f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d4f('0x1'));var rs=require(_0x4d4f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d4f('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x4d4f('0x4'));var jayson=require(_0x4d4f('0x5'));var client=jayson[_0x4d4f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x370640,_0x5e24cc,_0x54c172){return new BPromise(function(_0x4b93d3,_0x468045){return client[_0x4d4f('0x7')](_0x370640,_0x54c172)[_0x4d4f('0x8')](function(_0x32c911){logger[_0x4d4f('0x9')](_0x4d4f('0xa'),_0x5e24cc,_0x4d4f('0xb'));logger['debug'](_0x4d4f('0xc'),_0x5e24cc,_0x4d4f('0xb'),JSON[_0x4d4f('0xd')](_0x32c911));if(_0x32c911[_0x4d4f('0xe')]){if(_0x32c911[_0x4d4f('0xe')][_0x4d4f('0xf')]===0x1f4){logger[_0x4d4f('0xe')](_0x4d4f('0xa'),_0x5e24cc,_0x32c911['error'][_0x4d4f('0x10')]);return _0x468045(_0x32c911[_0x4d4f('0xe')][_0x4d4f('0x10')]);}logger['error'](_0x4d4f('0xa'),_0x5e24cc,_0x32c911[_0x4d4f('0xe')][_0x4d4f('0x10')]);return _0x4b93d3(_0x32c911[_0x4d4f('0xe')]['message']);}else{logger[_0x4d4f('0x9')](_0x4d4f('0xa'),_0x5e24cc,_0x4d4f('0xb'));_0x4b93d3(_0x32c911[_0x4d4f('0x11')][_0x4d4f('0x10')]);}})['catch'](function(_0x1caeea){logger[_0x4d4f('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x5e24cc,_0x1caeea);_0x468045(_0x1caeea);});});}