Built motion from commit 9d7072cc.|2.5.39
[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 _0x6e00=['stringify','error','code','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x23d35b,_0x12d273){var _0x3b1018=function(_0xd0439e){while(--_0xd0439e){_0x23d35b['push'](_0x23d35b['shift']());}};_0x3b1018(++_0x12d273);}(_0x6e00,0x155));var _0x06e0=function(_0x7ff56f,_0x252bc8){_0x7ff56f=_0x7ff56f-0x0;var _0x52df28=_0x6e00[_0x7ff56f];return _0x52df28;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x06e0('0x0'));var BPromise=require(_0x06e0('0x1'));var rs=require(_0x06e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06e0('0x3'))['db'];var utils=require(_0x06e0('0x4'));var logger=require(_0x06e0('0x5'))(_0x06e0('0x6'));var config=require(_0x06e0('0x7'));var jayson=require(_0x06e0('0x8'));var client=jayson[_0x06e0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b4dc6,_0x5a3344,_0x4526b1){return new BPromise(function(_0x33a3df,_0x1e224e){return client[_0x06e0('0xa')](_0x5b4dc6,_0x4526b1)[_0x06e0('0xb')](function(_0x52f7c8){logger[_0x06e0('0xc')](_0x06e0('0xd'),_0x5a3344,_0x06e0('0xe'));logger[_0x06e0('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5a3344,_0x06e0('0xe'),JSON[_0x06e0('0x10')](_0x52f7c8));if(_0x52f7c8[_0x06e0('0x11')]){if(_0x52f7c8[_0x06e0('0x11')][_0x06e0('0x12')]===0x1f4){logger['error'](_0x06e0('0xd'),_0x5a3344,_0x52f7c8[_0x06e0('0x11')]['message']);return _0x1e224e(_0x52f7c8['error'][_0x06e0('0x13')]);}logger[_0x06e0('0x11')](_0x06e0('0xd'),_0x5a3344,_0x52f7c8['error'][_0x06e0('0x13')]);return _0x33a3df(_0x52f7c8['error'][_0x06e0('0x13')]);}else{logger[_0x06e0('0xc')](_0x06e0('0xd'),_0x5a3344,'request\x20sent');_0x33a3df(_0x52f7c8[_0x06e0('0x14')][_0x06e0('0x13')]);}})['catch'](function(_0x5e7607){logger[_0x06e0('0x11')](_0x06e0('0xd'),_0x5a3344,_0x5e7607);_0x1e224e(_0x5e7607);});});}