80763b9d6698915b8aad582a795f42ba4fec8b52
[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 _0x945b=['request','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xe3d8ab,_0x90e717){var _0x2e4dfb=function(_0x310fb5){while(--_0x310fb5){_0xe3d8ab['push'](_0xe3d8ab['shift']());}};_0x2e4dfb(++_0x90e717);}(_0x945b,0x125));var _0xb945=function(_0x11ff14,_0x5cdd41){_0x11ff14=_0x11ff14-0x0;var _0x1d32e3=_0x945b[_0x11ff14];return _0x1d32e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb945('0x0'));var BPromise=require(_0xb945('0x1'));var rs=require(_0xb945('0x2'));var fs=require('fs');var Redis=require(_0xb945('0x3'));var db=require(_0xb945('0x4'))['db'];var utils=require(_0xb945('0x5'));var logger=require(_0xb945('0x6'))('rpc');var config=require(_0xb945('0x7'));var jayson=require(_0xb945('0x8'));var client=jayson[_0xb945('0x9')][_0xb945('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42c1bd,_0x37ad4c,_0x3c0fad){return new BPromise(function(_0x5268ad,_0x190ec4){return client[_0xb945('0xb')](_0x42c1bd,_0x3c0fad)['then'](function(_0xdac716){logger[_0xb945('0xc')](_0xb945('0xd'),_0x37ad4c,'request\x20sent');logger['debug'](_0xb945('0xe'),_0x37ad4c,'request\x20sent',JSON['stringify'](_0xdac716));if(_0xdac716['error']){if(_0xdac716[_0xb945('0xf')][_0xb945('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x37ad4c,_0xdac716['error'][_0xb945('0x11')]);return _0x190ec4(_0xdac716[_0xb945('0xf')][_0xb945('0x11')]);}logger[_0xb945('0xf')](_0xb945('0xd'),_0x37ad4c,_0xdac716[_0xb945('0xf')][_0xb945('0x11')]);return _0x5268ad(_0xdac716['error']['message']);}else{logger[_0xb945('0xc')](_0xb945('0xd'),_0x37ad4c,'request\x20sent');_0x5268ad(_0xdac716[_0xb945('0x12')][_0xb945('0x11')]);}})['catch'](function(_0x7bd1d4){logger[_0xb945('0xf')](_0xb945('0xd'),_0x37ad4c,_0x7bd1d4);_0x190ec4(_0x7bd1d4);});});}