93e19a3758a412da27efe8185e21fcc12d18df8a
[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 _0x4fcb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserFaxQueue,\x20%s,\x20%s'];(function(_0x1b0dc7,_0x58b8c2){var _0x324d9b=function(_0x4a2f0e){while(--_0x4a2f0e){_0x1b0dc7['push'](_0x1b0dc7['shift']());}};_0x324d9b(++_0x58b8c2);}(_0x4fcb,0xa3));var _0xb4fc=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x4fcb[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require(_0xb4fc('0x0'));var util=require(_0xb4fc('0x1'));var moment=require(_0xb4fc('0x2'));var BPromise=require(_0xb4fc('0x3'));var rs=require(_0xb4fc('0x4'));var fs=require('fs');var Redis=require(_0xb4fc('0x5'));var db=require(_0xb4fc('0x6'))['db'];var utils=require(_0xb4fc('0x7'));var logger=require(_0xb4fc('0x8'))(_0xb4fc('0x9'));var config=require(_0xb4fc('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb4fc('0xb')][_0xb4fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd9d9e0,_0x3c4c69,_0x2a4911){return new BPromise(function(_0x5727c9,_0x1bc700){return client['request'](_0xd9d9e0,_0x2a4911)['then'](function(_0x550e2b){logger[_0xb4fc('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x3c4c69,_0xb4fc('0xe'));logger[_0xb4fc('0xf')](_0xb4fc('0x10'),_0x3c4c69,_0xb4fc('0xe'),JSON['stringify'](_0x550e2b));if(_0x550e2b[_0xb4fc('0x11')]){if(_0x550e2b[_0xb4fc('0x11')][_0xb4fc('0x12')]===0x1f4){logger[_0xb4fc('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3c4c69,_0x550e2b[_0xb4fc('0x11')][_0xb4fc('0x13')]);return _0x1bc700(_0x550e2b[_0xb4fc('0x11')]['message']);}logger[_0xb4fc('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3c4c69,_0x550e2b[_0xb4fc('0x11')]['message']);return _0x5727c9(_0x550e2b['error']['message']);}else{logger[_0xb4fc('0xd')](_0xb4fc('0x14'),_0x3c4c69,'request\x20sent');_0x5727c9(_0x550e2b[_0xb4fc('0x15')][_0xb4fc('0x13')]);}})[_0xb4fc('0x16')](function(_0x579598){logger[_0xb4fc('0x11')](_0xb4fc('0x14'),_0x3c4c69,_0x579598);_0x1bc700(_0x579598);});});}