6b8c5c6d1062599f9bd767a7d8782d6a4ec7879c
[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 _0x52cb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3d48f2,_0x6c54b7){var _0x3fcda9=function(_0x5d9b4e){while(--_0x5d9b4e){_0x3d48f2['push'](_0x3d48f2['shift']());}};_0x3fcda9(++_0x6c54b7);}(_0x52cb,0x1ba));var _0xb52c=function(_0xcc4673,_0x1de536){_0xcc4673=_0xcc4673-0x0;var _0x2f86aa=_0x52cb[_0xcc4673];return _0x2f86aa;};'use strict';var _=require(_0xb52c('0x0'));var util=require(_0xb52c('0x1'));var moment=require(_0xb52c('0x2'));var BPromise=require(_0xb52c('0x3'));var rs=require(_0xb52c('0x4'));var fs=require('fs');var Redis=require(_0xb52c('0x5'));var db=require(_0xb52c('0x6'))['db'];var utils=require(_0xb52c('0x7'));var logger=require(_0xb52c('0x8'))(_0xb52c('0x9'));var config=require(_0xb52c('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e00cd,_0x2463bb,_0x4ce45f){return new BPromise(function(_0x329c57,_0x38b922){return client[_0xb52c('0xb')](_0x1e00cd,_0x4ce45f)['then'](function(_0x58262d){logger[_0xb52c('0xc')](_0xb52c('0xd'),_0x2463bb,_0xb52c('0xe'));logger[_0xb52c('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2463bb,_0xb52c('0xe'),JSON[_0xb52c('0x10')](_0x58262d));if(_0x58262d[_0xb52c('0x11')]){if(_0x58262d['error'][_0xb52c('0x12')]===0x1f4){logger[_0xb52c('0x11')](_0xb52c('0xd'),_0x2463bb,_0x58262d[_0xb52c('0x11')][_0xb52c('0x13')]);return _0x38b922(_0x58262d[_0xb52c('0x11')][_0xb52c('0x13')]);}logger[_0xb52c('0x11')](_0xb52c('0xd'),_0x2463bb,_0x58262d[_0xb52c('0x11')]['message']);return _0x329c57(_0x58262d[_0xb52c('0x11')]['message']);}else{logger[_0xb52c('0xc')](_0xb52c('0xd'),_0x2463bb,_0xb52c('0xe'));_0x329c57(_0x58262d[_0xb52c('0x14')][_0xb52c('0x13')]);}})[_0xb52c('0x15')](function(_0x346a43){logger[_0xb52c('0x11')](_0xb52c('0xd'),_0x2463bb,_0x346a43);_0x38b922(_0x346a43);});});}