3263f3e27396dbab72b8c5a7cd6486fa20ea6a68
[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 _0xb140=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x26811f,_0x363a38){var _0x431890=function(_0x40fc51){while(--_0x40fc51){_0x26811f['push'](_0x26811f['shift']());}};_0x431890(++_0x363a38);}(_0xb140,0x65));var _0x0b14=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0xb140[_0x592e40];return _0x5d4288;};'use strict';var _=require('lodash');var util=require(_0x0b14('0x0'));var moment=require(_0x0b14('0x1'));var BPromise=require(_0x0b14('0x2'));var rs=require(_0x0b14('0x3'));var fs=require('fs');var Redis=require(_0x0b14('0x4'));var db=require(_0x0b14('0x5'))['db'];var utils=require(_0x0b14('0x6'));var logger=require(_0x0b14('0x7'))('rpc');var config=require(_0x0b14('0x8'));var jayson=require(_0x0b14('0x9'));var client=jayson[_0x0b14('0xa')][_0x0b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54cf5a,_0xd4c70f,_0x3961ab){return new BPromise(function(_0x419b27,_0x2ec18b){return client[_0x0b14('0xc')](_0x54cf5a,_0x3961ab)[_0x0b14('0xd')](function(_0x1a76f8){logger[_0x0b14('0xe')](_0x0b14('0xf'),_0xd4c70f,_0x0b14('0x10'));logger[_0x0b14('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xd4c70f,_0x0b14('0x10'),JSON[_0x0b14('0x12')](_0x1a76f8));if(_0x1a76f8[_0x0b14('0x13')]){if(_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x14')]===0x1f4){logger['error'](_0x0b14('0xf'),_0xd4c70f,_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x15')]);return _0x2ec18b(_0x1a76f8[_0x0b14('0x13')]['message']);}logger[_0x0b14('0x13')](_0x0b14('0xf'),_0xd4c70f,_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x15')]);return _0x419b27(_0x1a76f8[_0x0b14('0x13')][_0x0b14('0x15')]);}else{logger['info'](_0x0b14('0xf'),_0xd4c70f,'request\x20sent');_0x419b27(_0x1a76f8[_0x0b14('0x16')][_0x0b14('0x15')]);}})[_0x0b14('0x17')](function(_0x1edc5d){logger[_0x0b14('0x13')](_0x0b14('0xf'),_0xd4c70f,_0x1edc5d);_0x2ec18b(_0x1edc5d);});});}