Built motion from commit (unavailable).|2.5.19
[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 _0xe195=['jayson/promise','client','request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xd50b7f,_0x53c16c){var _0x380972=function(_0x4865d8){while(--_0x4865d8){_0xd50b7f['push'](_0xd50b7f['shift']());}};_0x380972(++_0x53c16c);}(_0xe195,0x1c6));var _0x5e19=function(_0x36aba8,_0x4b3db5){_0x36aba8=_0x36aba8-0x0;var _0x356ab2=_0xe195[_0x36aba8];return _0x356ab2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5e19('0x0'));var BPromise=require(_0x5e19('0x1'));var rs=require(_0x5e19('0x2'));var fs=require('fs');var Redis=require(_0x5e19('0x3'));var db=require(_0x5e19('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e19('0x5'))(_0x5e19('0x6'));var config=require(_0x5e19('0x7'));var jayson=require(_0x5e19('0x8'));var client=jayson[_0x5e19('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ca278,_0x50b913,_0x1e40c4){return new BPromise(function(_0x21e440,_0x377428){return client[_0x5e19('0xa')](_0x2ca278,_0x1e40c4)['then'](function(_0x3a1974){logger['info'](_0x5e19('0xb'),_0x50b913,_0x5e19('0xc'));logger[_0x5e19('0xd')](_0x5e19('0xe'),_0x50b913,_0x5e19('0xc'),JSON[_0x5e19('0xf')](_0x3a1974));if(_0x3a1974[_0x5e19('0x10')]){if(_0x3a1974['error'][_0x5e19('0x11')]===0x1f4){logger[_0x5e19('0x10')](_0x5e19('0xb'),_0x50b913,_0x3a1974[_0x5e19('0x10')][_0x5e19('0x12')]);return _0x377428(_0x3a1974['error'][_0x5e19('0x12')]);}logger[_0x5e19('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x50b913,_0x3a1974[_0x5e19('0x10')][_0x5e19('0x12')]);return _0x21e440(_0x3a1974[_0x5e19('0x10')]['message']);}else{logger['info'](_0x5e19('0xb'),_0x50b913,'request\x20sent');_0x21e440(_0x3a1974[_0x5e19('0x13')][_0x5e19('0x12')]);}})[_0x5e19('0x14')](function(_0x5e72a3){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x50b913,_0x5e72a3);_0x377428(_0x5e72a3);});});}