97a66dd1016de91283d0d209db99c6b86447e161
[motion2.git] / server / api / intDeskConfiguration / intDeskConfiguration.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 _0x2746=['client','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x3dd3bc,_0x32950b){var _0x172373=function(_0x2b0f0d){while(--_0x2b0f0d){_0x3dd3bc['push'](_0x3dd3bc['shift']());}};_0x172373(++_0x32950b);}(_0x2746,0x19c));var _0x6274=function(_0x3af0cd,_0x545b46){_0x3af0cd=_0x3af0cd-0x0;var _0x34a6f5=_0x2746[_0x3af0cd];return _0x34a6f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6274('0x0'));var BPromise=require(_0x6274('0x1'));var rs=require(_0x6274('0x2'));var fs=require('fs');var Redis=require(_0x6274('0x3'));var db=require(_0x6274('0x4'))['db'];var utils=require(_0x6274('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6274('0x6'));var jayson=require(_0x6274('0x7'));var client=jayson[_0x6274('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d22fb,_0x937a27,_0x3a8ec1){return new BPromise(function(_0x3158f6,_0x3efc83){return client['request'](_0x1d22fb,_0x3a8ec1)[_0x6274('0x9')](function(_0x59fee9){logger[_0x6274('0xa')](_0x6274('0xb'),_0x937a27,_0x6274('0xc'));logger[_0x6274('0xd')](_0x6274('0xe'),_0x937a27,_0x6274('0xc'),JSON[_0x6274('0xf')](_0x59fee9));if(_0x59fee9[_0x6274('0x10')]){if(_0x59fee9[_0x6274('0x10')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x937a27,_0x59fee9[_0x6274('0x10')]['message']);return _0x3efc83(_0x59fee9[_0x6274('0x10')][_0x6274('0x11')]);}logger[_0x6274('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x937a27,_0x59fee9[_0x6274('0x10')]['message']);return _0x3158f6(_0x59fee9[_0x6274('0x10')][_0x6274('0x11')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x937a27,_0x6274('0xc'));_0x3158f6(_0x59fee9[_0x6274('0x12')][_0x6274('0x11')]);}})[_0x6274('0x13')](function(_0x3e35fb){logger['error'](_0x6274('0xb'),_0x937a27,_0x3e35fb);_0x3efc83(_0x3e35fb);});});}