Built motion from commit (unavailable).|2.4.17
[motion2.git] / server / api / intDeskField / intDeskField.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 _0x1883=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s'];(function(_0xf2d5ec,_0x4fe549){var _0x4f07ae=function(_0x367e7d){while(--_0x367e7d){_0xf2d5ec['push'](_0xf2d5ec['shift']());}};_0x4f07ae(++_0x4fe549);}(_0x1883,0xf8));var _0x3188=function(_0x2d73d7,_0x29e178){_0x2d73d7=_0x2d73d7-0x0;var _0x9fc822=_0x1883[_0x2d73d7];return _0x9fc822;};'use strict';var _=require('lodash');var util=require(_0x3188('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3188('0x1'));var fs=require('fs');var Redis=require(_0x3188('0x2'));var db=require(_0x3188('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3188('0x4'));var config=require(_0x3188('0x5'));var jayson=require(_0x3188('0x6'));var client=jayson[_0x3188('0x7')][_0x3188('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c3ba9,_0x51a533,_0x11b2a1){return new BPromise(function(_0x1db072,_0x5daec5){return client['request'](_0x5c3ba9,_0x11b2a1)[_0x3188('0x9')](function(_0x210f43){logger[_0x3188('0xa')](_0x3188('0xb'),_0x51a533,_0x3188('0xc'));logger[_0x3188('0xd')](_0x3188('0xe'),_0x51a533,'request\x20sent',JSON['stringify'](_0x210f43));if(_0x210f43[_0x3188('0xf')]){if(_0x210f43[_0x3188('0xf')][_0x3188('0x10')]===0x1f4){logger['error'](_0x3188('0xb'),_0x51a533,_0x210f43[_0x3188('0xf')][_0x3188('0x11')]);return _0x5daec5(_0x210f43[_0x3188('0xf')][_0x3188('0x11')]);}logger[_0x3188('0xf')](_0x3188('0xb'),_0x51a533,_0x210f43[_0x3188('0xf')][_0x3188('0x11')]);return _0x1db072(_0x210f43['error']['message']);}else{logger['info'](_0x3188('0xb'),_0x51a533,_0x3188('0xc'));_0x1db072(_0x210f43[_0x3188('0x12')][_0x3188('0x11')]);}})[_0x3188('0x13')](function(_0xb44b85){logger[_0x3188('0xf')](_0x3188('0xb'),_0x51a533,_0xb44b85);_0x5daec5(_0xb44b85);});});}