Built motion from commit 3c2ce842.|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 _0x0a0c=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x10bd94,_0x46b509){var _0x364677=function(_0x417683){while(--_0x417683){_0x10bd94['push'](_0x10bd94['shift']());}};_0x364677(++_0x46b509);}(_0x0a0c,0x7a));var _0xc0a0=function(_0x16495f,_0x5f2cac){_0x16495f=_0x16495f-0x0;var _0x957e3e=_0x0a0c[_0x16495f];return _0x957e3e;};'use strict';var _=require(_0xc0a0('0x0'));var util=require(_0xc0a0('0x1'));var moment=require('moment');var BPromise=require(_0xc0a0('0x2'));var rs=require(_0xc0a0('0x3'));var fs=require('fs');var Redis=require(_0xc0a0('0x4'));var db=require(_0xc0a0('0x5'))['db'];var utils=require(_0xc0a0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0a0('0x7'));var jayson=require(_0xc0a0('0x8'));var client=jayson[_0xc0a0('0x9')][_0xc0a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0fef,_0x4b21c3,_0x5c5f12){return new BPromise(function(_0x28347e,_0x244ea0){return client[_0xc0a0('0xb')](_0x2b0fef,_0x5c5f12)[_0xc0a0('0xc')](function(_0x3b6bf4){logger['info'](_0xc0a0('0xd'),_0x4b21c3,_0xc0a0('0xe'));logger[_0xc0a0('0xf')](_0xc0a0('0x10'),_0x4b21c3,_0xc0a0('0xe'),JSON[_0xc0a0('0x11')](_0x3b6bf4));if(_0x3b6bf4['error']){if(_0x3b6bf4[_0xc0a0('0x12')][_0xc0a0('0x13')]===0x1f4){logger['error'](_0xc0a0('0xd'),_0x4b21c3,_0x3b6bf4[_0xc0a0('0x12')][_0xc0a0('0x14')]);return _0x244ea0(_0x3b6bf4[_0xc0a0('0x12')][_0xc0a0('0x14')]);}logger[_0xc0a0('0x12')](_0xc0a0('0xd'),_0x4b21c3,_0x3b6bf4[_0xc0a0('0x12')]['message']);return _0x28347e(_0x3b6bf4[_0xc0a0('0x12')][_0xc0a0('0x14')]);}else{logger['info'](_0xc0a0('0xd'),_0x4b21c3,_0xc0a0('0xe'));_0x28347e(_0x3b6bf4[_0xc0a0('0x15')]['message']);}})[_0xc0a0('0x16')](function(_0x4871a1){logger[_0xc0a0('0x12')](_0xc0a0('0xd'),_0x4b21c3,_0x4871a1);_0x244ea0(_0x4871a1);});});}