Built motion from commit 3e059bc2.|2.5.32
[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 _0xeb5f=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x412786,_0x1d3564){var _0x558bd4=function(_0x3e80c6){while(--_0x3e80c6){_0x412786['push'](_0x412786['shift']());}};_0x558bd4(++_0x1d3564);}(_0xeb5f,0xdd));var _0xfeb5=function(_0x5c74b2,_0x383a87){_0x5c74b2=_0x5c74b2-0x0;var _0x3cedef=_0xeb5f[_0x5c74b2];return _0x3cedef;};'use strict';var _=require(_0xfeb5('0x0'));var util=require(_0xfeb5('0x1'));var moment=require(_0xfeb5('0x2'));var BPromise=require('bluebird');var rs=require(_0xfeb5('0x3'));var fs=require('fs');var Redis=require(_0xfeb5('0x4'));var db=require(_0xfeb5('0x5'))['db'];var utils=require(_0xfeb5('0x6'));var logger=require(_0xfeb5('0x7'))(_0xfeb5('0x8'));var config=require('../../config/environment');var jayson=require(_0xfeb5('0x9'));var client=jayson[_0xfeb5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19ed89,_0x2d4df1,_0x59a6d1){return new BPromise(function(_0x486ba3,_0xa324a2){return client[_0xfeb5('0xb')](_0x19ed89,_0x59a6d1)['then'](function(_0x5e201c){logger[_0xfeb5('0xc')](_0xfeb5('0xd'),_0x2d4df1,_0xfeb5('0xe'));logger[_0xfeb5('0xf')](_0xfeb5('0x10'),_0x2d4df1,_0xfeb5('0xe'),JSON[_0xfeb5('0x11')](_0x5e201c));if(_0x5e201c[_0xfeb5('0x12')]){if(_0x5e201c[_0xfeb5('0x12')]['code']===0x1f4){logger['error'](_0xfeb5('0xd'),_0x2d4df1,_0x5e201c[_0xfeb5('0x12')][_0xfeb5('0x13')]);return _0xa324a2(_0x5e201c[_0xfeb5('0x12')]['message']);}logger[_0xfeb5('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2d4df1,_0x5e201c[_0xfeb5('0x12')][_0xfeb5('0x13')]);return _0x486ba3(_0x5e201c[_0xfeb5('0x12')][_0xfeb5('0x13')]);}else{logger[_0xfeb5('0xc')](_0xfeb5('0xd'),_0x2d4df1,'request\x20sent');_0x486ba3(_0x5e201c[_0xfeb5('0x14')][_0xfeb5('0x13')]);}})[_0xfeb5('0x15')](function(_0x132952){logger[_0xfeb5('0x12')](_0xfeb5('0xd'),_0x2d4df1,_0x132952);_0xa324a2(_0x132952);});});}