Built motion from commit (unavailable).|2.5.15
[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 _0x8afd=['rpc','../../config/environment','http','request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x8afd,0xf1));var _0xd8af=function(_0x53b579,_0x515c1f){_0x53b579=_0x53b579-0x0;var _0x3e18a0=_0x8afd[_0x53b579];return _0x3e18a0;};'use strict';var _=require(_0xd8af('0x0'));var util=require(_0xd8af('0x1'));var moment=require('moment');var BPromise=require(_0xd8af('0x2'));var rs=require(_0xd8af('0x3'));var fs=require('fs');var Redis=require(_0xd8af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8af('0x5'));var logger=require('../../config/logger')(_0xd8af('0x6'));var config=require(_0xd8af('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd8af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ad248,_0x587d2a,_0x322a21){return new BPromise(function(_0x5ec917,_0x420ba2){return client[_0xd8af('0x9')](_0x3ad248,_0x322a21)['then'](function(_0x2e27c6){logger['info'](_0xd8af('0xa'),_0x587d2a,_0xd8af('0xb'));logger[_0xd8af('0xc')](_0xd8af('0xd'),_0x587d2a,_0xd8af('0xb'),JSON[_0xd8af('0xe')](_0x2e27c6));if(_0x2e27c6[_0xd8af('0xf')]){if(_0x2e27c6[_0xd8af('0xf')][_0xd8af('0x10')]===0x1f4){logger[_0xd8af('0xf')](_0xd8af('0xa'),_0x587d2a,_0x2e27c6[_0xd8af('0xf')][_0xd8af('0x11')]);return _0x420ba2(_0x2e27c6[_0xd8af('0xf')][_0xd8af('0x11')]);}logger[_0xd8af('0xf')](_0xd8af('0xa'),_0x587d2a,_0x2e27c6[_0xd8af('0xf')][_0xd8af('0x11')]);return _0x5ec917(_0x2e27c6['error'][_0xd8af('0x11')]);}else{logger['info'](_0xd8af('0xa'),_0x587d2a,'request\x20sent');_0x5ec917(_0x2e27c6['result'][_0xd8af('0x11')]);}})[_0xd8af('0x12')](function(_0x53f387){logger[_0xd8af('0xf')](_0xd8af('0xa'),_0x587d2a,_0x53f387);_0x420ba2(_0x53f387);});});}