6166280cc1ae23bed1d476fcff8e299d7b2e2b31
[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 _0x1ba8=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x1ba8,0xeb));var _0x81ba=function(_0x82d3ed,_0x469b57){_0x82d3ed=_0x82d3ed-0x0;var _0x2f3dde=_0x1ba8[_0x82d3ed];return _0x2f3dde;};'use strict';var _=require(_0x81ba('0x0'));var util=require(_0x81ba('0x1'));var moment=require(_0x81ba('0x2'));var BPromise=require(_0x81ba('0x3'));var rs=require(_0x81ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81ba('0x5'))['db'];var utils=require(_0x81ba('0x6'));var logger=require(_0x81ba('0x7'))(_0x81ba('0x8'));var config=require(_0x81ba('0x9'));var jayson=require(_0x81ba('0xa'));var client=jayson[_0x81ba('0xb')][_0x81ba('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x815366,_0x1b333a,_0x5866be){return new BPromise(function(_0x593681,_0x2b9986){return client[_0x81ba('0xd')](_0x815366,_0x5866be)[_0x81ba('0xe')](function(_0x4f68c4){logger['info'](_0x81ba('0xf'),_0x1b333a,'request\x20sent');logger[_0x81ba('0x10')](_0x81ba('0x11'),_0x1b333a,_0x81ba('0x12'),JSON[_0x81ba('0x13')](_0x4f68c4));if(_0x4f68c4[_0x81ba('0x14')]){if(_0x4f68c4[_0x81ba('0x14')][_0x81ba('0x15')]===0x1f4){logger['error'](_0x81ba('0xf'),_0x1b333a,_0x4f68c4[_0x81ba('0x14')][_0x81ba('0x16')]);return _0x2b9986(_0x4f68c4['error']['message']);}logger['error'](_0x81ba('0xf'),_0x1b333a,_0x4f68c4[_0x81ba('0x14')][_0x81ba('0x16')]);return _0x593681(_0x4f68c4['error']['message']);}else{logger['info'](_0x81ba('0xf'),_0x1b333a,_0x81ba('0x12'));_0x593681(_0x4f68c4['result'][_0x81ba('0x16')]);}})['catch'](function(_0x5bdddc){logger[_0x81ba('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x1b333a,_0x5bdddc);_0x2b9986(_0x5bdddc);});});}