Built motion from commit (unavailable).|2.5.9
[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 _0x4610=['Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x42c65c,_0x7b5c8b){var _0x46116a=function(_0x3e3f5f){while(--_0x3e3f5f){_0x42c65c['push'](_0x42c65c['shift']());}};_0x46116a(++_0x7b5c8b);}(_0x4610,0x1a0));var _0x0461=function(_0x4c9316,_0x5c7f6f){_0x4c9316=_0x4c9316-0x0;var _0x146aad=_0x4610[_0x4c9316];return _0x146aad;};'use strict';var _=require(_0x0461('0x0'));var util=require(_0x0461('0x1'));var moment=require(_0x0461('0x2'));var BPromise=require(_0x0461('0x3'));var rs=require(_0x0461('0x4'));var fs=require('fs');var Redis=require(_0x0461('0x5'));var db=require(_0x0461('0x6'))['db'];var utils=require(_0x0461('0x7'));var logger=require(_0x0461('0x8'))(_0x0461('0x9'));var config=require(_0x0461('0xa'));var jayson=require(_0x0461('0xb'));var client=jayson[_0x0461('0xc')][_0x0461('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e5c45,_0x593a96,_0x4db394){return new BPromise(function(_0x5b6a41,_0x12e269){return client[_0x0461('0xe')](_0x4e5c45,_0x4db394)['then'](function(_0x2a6b2d){logger[_0x0461('0xf')](_0x0461('0x10'),_0x593a96,_0x0461('0x11'));logger['debug'](_0x0461('0x12'),_0x593a96,_0x0461('0x11'),JSON['stringify'](_0x2a6b2d));if(_0x2a6b2d[_0x0461('0x13')]){if(_0x2a6b2d['error'][_0x0461('0x14')]===0x1f4){logger[_0x0461('0x13')](_0x0461('0x10'),_0x593a96,_0x2a6b2d['error'][_0x0461('0x15')]);return _0x12e269(_0x2a6b2d[_0x0461('0x13')][_0x0461('0x15')]);}logger[_0x0461('0x13')](_0x0461('0x10'),_0x593a96,_0x2a6b2d[_0x0461('0x13')]['message']);return _0x5b6a41(_0x2a6b2d[_0x0461('0x13')][_0x0461('0x15')]);}else{logger[_0x0461('0xf')](_0x0461('0x10'),_0x593a96,_0x0461('0x11'));_0x5b6a41(_0x2a6b2d[_0x0461('0x16')][_0x0461('0x15')]);}})[_0x0461('0x17')](function(_0x3c657d){logger[_0x0461('0x13')](_0x0461('0x10'),_0x593a96,_0x3c657d);_0x12e269(_0x3c657d);});});}