41e46e0753705933303c9298e92a50321ffa7764
[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 _0xc24d=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x1bc4de,_0x8487a8){var _0x41dd13=function(_0x365a8b){while(--_0x365a8b){_0x1bc4de['push'](_0x1bc4de['shift']());}};_0x41dd13(++_0x8487a8);}(_0xc24d,0x110));var _0xdc24=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0xc24d[_0x1b02bb];return _0x131245;};'use strict';var _=require(_0xdc24('0x0'));var util=require(_0xdc24('0x1'));var moment=require(_0xdc24('0x2'));var BPromise=require(_0xdc24('0x3'));var rs=require(_0xdc24('0x4'));var fs=require('fs');var Redis=require(_0xdc24('0x5'));var db=require(_0xdc24('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdc24('0x7'));var config=require(_0xdc24('0x8'));var jayson=require(_0xdc24('0x9'));var client=jayson[_0xdc24('0xa')][_0xdc24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f1960,_0xf1d19,_0x325bff){return new BPromise(function(_0x4d267d,_0x563f68){return client[_0xdc24('0xc')](_0x2f1960,_0x325bff)[_0xdc24('0xd')](function(_0x1c1374){logger[_0xdc24('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0xf1d19,_0xdc24('0xf'));logger[_0xdc24('0x10')](_0xdc24('0x11'),_0xf1d19,'request\x20sent',JSON['stringify'](_0x1c1374));if(_0x1c1374['error']){if(_0x1c1374[_0xdc24('0x12')][_0xdc24('0x13')]===0x1f4){logger[_0xdc24('0x12')](_0xdc24('0x14'),_0xf1d19,_0x1c1374[_0xdc24('0x12')][_0xdc24('0x15')]);return _0x563f68(_0x1c1374[_0xdc24('0x12')][_0xdc24('0x15')]);}logger[_0xdc24('0x12')](_0xdc24('0x14'),_0xf1d19,_0x1c1374['error'][_0xdc24('0x15')]);return _0x4d267d(_0x1c1374['error'][_0xdc24('0x15')]);}else{logger[_0xdc24('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0xf1d19,_0xdc24('0xf'));_0x4d267d(_0x1c1374[_0xdc24('0x16')]['message']);}})[_0xdc24('0x17')](function(_0x296cfc){logger['error'](_0xdc24('0x14'),_0xf1d19,_0x296cfc);_0x563f68(_0x296cfc);});});}