acba17b13a72ccc1a1e838a2d925d226677eaf69
[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 _0xac75=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x1b5d5f,_0x5ed766){var _0x3c9347=function(_0x21afdd){while(--_0x21afdd){_0x1b5d5f['push'](_0x1b5d5f['shift']());}};_0x3c9347(++_0x5ed766);}(_0xac75,0x69));var _0x5ac7=function(_0x490b92,_0x134190){_0x490b92=_0x490b92-0x0;var _0x4b9700=_0xac75[_0x490b92];return _0x4b9700;};'use strict';var _=require(_0x5ac7('0x0'));var util=require(_0x5ac7('0x1'));var moment=require(_0x5ac7('0x2'));var BPromise=require(_0x5ac7('0x3'));var rs=require(_0x5ac7('0x4'));var fs=require('fs');var Redis=require(_0x5ac7('0x5'));var db=require(_0x5ac7('0x6'))['db'];var utils=require(_0x5ac7('0x7'));var logger=require('../../config/logger')(_0x5ac7('0x8'));var config=require(_0x5ac7('0x9'));var jayson=require(_0x5ac7('0xa'));var client=jayson[_0x5ac7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b40ba,_0x176cbf,_0x225efe){return new BPromise(function(_0x1033c3,_0x16a2f4){return client[_0x5ac7('0xc')](_0x5b40ba,_0x225efe)[_0x5ac7('0xd')](function(_0x3db725){logger[_0x5ac7('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x176cbf,_0x5ac7('0xf'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x176cbf,_0x5ac7('0xf'),JSON[_0x5ac7('0x10')](_0x3db725));if(_0x3db725['error']){if(_0x3db725['error']['code']===0x1f4){logger[_0x5ac7('0x11')](_0x5ac7('0x12'),_0x176cbf,_0x3db725[_0x5ac7('0x11')][_0x5ac7('0x13')]);return _0x16a2f4(_0x3db725[_0x5ac7('0x11')]['message']);}logger[_0x5ac7('0x11')](_0x5ac7('0x12'),_0x176cbf,_0x3db725[_0x5ac7('0x11')][_0x5ac7('0x13')]);return _0x1033c3(_0x3db725[_0x5ac7('0x11')]['message']);}else{logger[_0x5ac7('0xe')](_0x5ac7('0x12'),_0x176cbf,_0x5ac7('0xf'));_0x1033c3(_0x3db725[_0x5ac7('0x14')]['message']);}})['catch'](function(_0x3c59fc){logger['error'](_0x5ac7('0x12'),_0x176cbf,_0x3c59fc);_0x16a2f4(_0x3c59fc);});});}