2db1dc0624ea21ea106797b3a7cc3e05dae57062
[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 _0x120c=['info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x28a87b,_0x27201){var _0x454b2d=function(_0x2b2b8d){while(--_0x2b2b8d){_0x28a87b['push'](_0x28a87b['shift']());}};_0x454b2d(++_0x27201);}(_0x120c,0xfb));var _0xc120=function(_0x32d1a8,_0x40f461){_0x32d1a8=_0x32d1a8-0x0;var _0x517706=_0x120c[_0x32d1a8];return _0x517706;};'use strict';var _=require(_0xc120('0x0'));var util=require(_0xc120('0x1'));var moment=require('moment');var BPromise=require(_0xc120('0x2'));var rs=require(_0xc120('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc120('0x4'))['db'];var utils=require(_0xc120('0x5'));var logger=require(_0xc120('0x6'))(_0xc120('0x7'));var config=require(_0xc120('0x8'));var jayson=require(_0xc120('0x9'));var client=jayson[_0xc120('0xa')][_0xc120('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f5de,_0x40c42c,_0x4badb2){return new BPromise(function(_0x3b6e0a,_0x40b76f){return client[_0xc120('0xc')](_0x17f5de,_0x4badb2)['then'](function(_0x1e72c8){logger[_0xc120('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x40c42c,_0xc120('0xe'));logger[_0xc120('0xf')](_0xc120('0x10'),_0x40c42c,_0xc120('0xe'),JSON[_0xc120('0x11')](_0x1e72c8));if(_0x1e72c8['error']){if(_0x1e72c8['error'][_0xc120('0x12')]===0x1f4){logger[_0xc120('0x13')](_0xc120('0x14'),_0x40c42c,_0x1e72c8[_0xc120('0x13')][_0xc120('0x15')]);return _0x40b76f(_0x1e72c8[_0xc120('0x13')]['message']);}logger[_0xc120('0x13')](_0xc120('0x14'),_0x40c42c,_0x1e72c8['error'][_0xc120('0x15')]);return _0x3b6e0a(_0x1e72c8[_0xc120('0x13')]['message']);}else{logger[_0xc120('0xd')](_0xc120('0x14'),_0x40c42c,'request\x20sent');_0x3b6e0a(_0x1e72c8[_0xc120('0x16')]['message']);}})[_0xc120('0x17')](function(_0x461d21){logger[_0xc120('0x13')](_0xc120('0x14'),_0x40c42c,_0x461d21);_0x40b76f(_0x461d21);});});}