Built motion from commit (unavailable).|2.5.11
[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 _0x7e1a=['ioredis','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e1a,0x1b7));var _0xa7e1=function(_0x1d400e,_0xfac218){_0x1d400e=_0x1d400e-0x0;var _0x2068b2=_0x7e1a[_0x1d400e];return _0x2068b2;};'use strict';var _=require(_0xa7e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa7e1('0x1'));var rs=require(_0xa7e1('0x2'));var fs=require('fs');var Redis=require(_0xa7e1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa7e1('0x4'));var client=jayson[_0xa7e1('0x5')][_0xa7e1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1027f0,_0x1243b5,_0x1e50a9){return new BPromise(function(_0x54c9f9,_0x40c9c0){return client[_0xa7e1('0x7')](_0x1027f0,_0x1e50a9)[_0xa7e1('0x8')](function(_0x754236){logger[_0xa7e1('0x9')](_0xa7e1('0xa'),_0x1243b5,_0xa7e1('0xb'));logger['debug'](_0xa7e1('0xc'),_0x1243b5,_0xa7e1('0xb'),JSON['stringify'](_0x754236));if(_0x754236['error']){if(_0x754236['error'][_0xa7e1('0xd')]===0x1f4){logger[_0xa7e1('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x1243b5,_0x754236['error']['message']);return _0x40c9c0(_0x754236[_0xa7e1('0xe')][_0xa7e1('0xf')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x1243b5,_0x754236[_0xa7e1('0xe')]['message']);return _0x54c9f9(_0x754236['error'][_0xa7e1('0xf')]);}else{logger[_0xa7e1('0x9')](_0xa7e1('0xa'),_0x1243b5,_0xa7e1('0xb'));_0x54c9f9(_0x754236[_0xa7e1('0x10')][_0xa7e1('0xf')]);}})['catch'](function(_0x4fcad1){logger[_0xa7e1('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x1243b5,_0x4fcad1);_0x40c9c0(_0x4fcad1);});});}