1a7825a1a858ca3a075a8346ee179777134797f0
[motion2.git] / server / api / userFaxQueue / userFaxQueue.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 _0x6cff=['../../config/utils','../../config/logger','jayson/promise','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xca7df5,_0x488054){var _0x1000dc=function(_0x19ab04){while(--_0x19ab04){_0xca7df5['push'](_0xca7df5['shift']());}};_0x1000dc(++_0x488054);}(_0x6cff,0x79));var _0xf6cf=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x6cff[_0x179e11];return _0x549f04;};'use strict';var _=require('lodash');var util=require(_0xf6cf('0x0'));var moment=require('moment');var BPromise=require(_0xf6cf('0x1'));var rs=require(_0xf6cf('0x2'));var fs=require('fs');var Redis=require(_0xf6cf('0x3'));var db=require(_0xf6cf('0x4'))['db'];var utils=require(_0xf6cf('0x5'));var logger=require(_0xf6cf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf6cf('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdcfe,_0x52da91,_0x48d86a){return new BPromise(function(_0x25863c,_0x154f88){return client[_0xf6cf('0x8')](_0x4fdcfe,_0x48d86a)['then'](function(_0x58fc8e){logger[_0xf6cf('0x9')](_0xf6cf('0xa'),_0x52da91,_0xf6cf('0xb'));logger[_0xf6cf('0xc')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x52da91,_0xf6cf('0xb'),JSON[_0xf6cf('0xd')](_0x58fc8e));if(_0x58fc8e[_0xf6cf('0xe')]){if(_0x58fc8e[_0xf6cf('0xe')]['code']===0x1f4){logger[_0xf6cf('0xe')](_0xf6cf('0xa'),_0x52da91,_0x58fc8e['error'][_0xf6cf('0xf')]);return _0x154f88(_0x58fc8e[_0xf6cf('0xe')][_0xf6cf('0xf')]);}logger['error'](_0xf6cf('0xa'),_0x52da91,_0x58fc8e[_0xf6cf('0xe')][_0xf6cf('0xf')]);return _0x25863c(_0x58fc8e['error'][_0xf6cf('0xf')]);}else{logger['info'](_0xf6cf('0xa'),_0x52da91,_0xf6cf('0xb'));_0x25863c(_0x58fc8e[_0xf6cf('0x10')][_0xf6cf('0xf')]);}})[_0xf6cf('0x11')](function(_0x30d49a){logger[_0xf6cf('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x52da91,_0x30d49a);_0x154f88(_0x30d49a);});});}