Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / network / network.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 _0x5fe4=['request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x58d719,_0x44d73d){var _0x206009=function(_0xe4116f){while(--_0xe4116f){_0x58d719['push'](_0x58d719['shift']());}};_0x206009(++_0x44d73d);}(_0x5fe4,0x80));var _0x45fe=function(_0x5618ac,_0x31705b){_0x5618ac=_0x5618ac-0x0;var _0x969bd3=_0x5fe4[_0x5618ac];return _0x969bd3;};'use strict';var _=require(_0x45fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x45fe('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45fe('0x2'));var db=require(_0x45fe('0x3'))['db'];var utils=require(_0x45fe('0x4'));var logger=require(_0x45fe('0x5'))(_0x45fe('0x6'));var config=require(_0x45fe('0x7'));var jayson=require(_0x45fe('0x8'));var client=jayson['client'][_0x45fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cf8dc,_0x1e314d,_0x331e20){return new BPromise(function(_0x8afb28,_0x1f2d6b){return client[_0x45fe('0xa')](_0x2cf8dc,_0x331e20)[_0x45fe('0xb')](function(_0xb41ca8){logger['info'](_0x45fe('0xc'),_0x1e314d,_0x45fe('0xd'));logger[_0x45fe('0xe')](_0x45fe('0xf'),_0x1e314d,_0x45fe('0xd'),JSON[_0x45fe('0x10')](_0xb41ca8));if(_0xb41ca8[_0x45fe('0x11')]){if(_0xb41ca8[_0x45fe('0x11')][_0x45fe('0x12')]===0x1f4){logger['error'](_0x45fe('0xc'),_0x1e314d,_0xb41ca8[_0x45fe('0x11')][_0x45fe('0x13')]);return _0x1f2d6b(_0xb41ca8[_0x45fe('0x11')][_0x45fe('0x13')]);}logger[_0x45fe('0x11')]('Network,\x20%s,\x20%s',_0x1e314d,_0xb41ca8[_0x45fe('0x11')]['message']);return _0x8afb28(_0xb41ca8['error']['message']);}else{logger[_0x45fe('0x14')]('Network,\x20%s,\x20%s',_0x1e314d,_0x45fe('0xd'));_0x8afb28(_0xb41ca8[_0x45fe('0x15')][_0x45fe('0x13')]);}})[_0x45fe('0x16')](function(_0x472c6d){logger[_0x45fe('0x11')](_0x45fe('0xc'),_0x1e314d,_0x472c6d);_0x1f2d6b(_0x472c6d);});});}