1a20b6d565d4631bc4f9144dac87e227fb1d0a10
[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 _0x9e56=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x209f9c,_0x4ea385){var _0x13c1ef=function(_0x455599){while(--_0x455599){_0x209f9c['push'](_0x209f9c['shift']());}};_0x13c1ef(++_0x4ea385);}(_0x9e56,0x1dc));var _0x69e5=function(_0x1e7944,_0x5a1ee7){_0x1e7944=_0x1e7944-0x0;var _0x4be825=_0x9e56[_0x1e7944];return _0x4be825;};'use strict';var _=require(_0x69e5('0x0'));var util=require('util');var moment=require(_0x69e5('0x1'));var BPromise=require('bluebird');var rs=require(_0x69e5('0x2'));var fs=require('fs');var Redis=require(_0x69e5('0x3'));var db=require(_0x69e5('0x4'))['db'];var utils=require(_0x69e5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x69e5('0x6'));var jayson=require(_0x69e5('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ef995,_0x19fd4e,_0x35342a){return new BPromise(function(_0x402b3a,_0x3fd128){return client[_0x69e5('0x8')](_0x3ef995,_0x35342a)['then'](function(_0x444975){logger[_0x69e5('0x9')](_0x69e5('0xa'),_0x19fd4e,_0x69e5('0xb'));logger[_0x69e5('0xc')](_0x69e5('0xd'),_0x19fd4e,_0x69e5('0xb'),JSON['stringify'](_0x444975));if(_0x444975[_0x69e5('0xe')]){if(_0x444975[_0x69e5('0xe')][_0x69e5('0xf')]===0x1f4){logger[_0x69e5('0xe')](_0x69e5('0xa'),_0x19fd4e,_0x444975[_0x69e5('0xe')][_0x69e5('0x10')]);return _0x3fd128(_0x444975[_0x69e5('0xe')][_0x69e5('0x10')]);}logger[_0x69e5('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x19fd4e,_0x444975[_0x69e5('0xe')][_0x69e5('0x10')]);return _0x402b3a(_0x444975['error']['message']);}else{logger[_0x69e5('0x9')]('UserVoiceQueue,\x20%s,\x20%s',_0x19fd4e,'request\x20sent');_0x402b3a(_0x444975[_0x69e5('0x11')][_0x69e5('0x10')]);}})[_0x69e5('0x12')](function(_0x5cfa3a){logger[_0x69e5('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x19fd4e,_0x5cfa3a);_0x3fd128(_0x5cfa3a);});});}