1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x7b7b=['catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskField,\x20%s,\x20%s','result'];(function(_0x4b68b0,_0x2dd193){var _0xaec79c=function(_0x2acea1){while(--_0x2acea1){_0x4b68b0['push'](_0x4b68b0['shift']());}};_0xaec79c(++_0x2dd193);}(_0x7b7b,0x1a3));var _0xb7b7=function(_0x4fa214,_0x2a20d0){_0x4fa214=_0x4fa214-0x0;var _0x3b9abe=_0x7b7b[_0x4fa214];return _0x3b9abe;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb7b7('0x0'));var rs=require(_0xb7b7('0x1'));var fs=require('fs');var Redis=require(_0xb7b7('0x2'));var db=require(_0xb7b7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7b7('0x4'))(_0xb7b7('0x5'));var config=require(_0xb7b7('0x6'));var jayson=require(_0xb7b7('0x7'));var client=jayson[_0xb7b7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24f1ea,_0x305996,_0x2f13ac){return new BPromise(function(_0x483669,_0x2c5c77){return client['request'](_0x24f1ea,_0x2f13ac)['then'](function(_0x38e56b){logger[_0xb7b7('0x9')]('DeskField,\x20%s,\x20%s',_0x305996,_0xb7b7('0xa'));logger['debug'](_0xb7b7('0xb'),_0x305996,_0xb7b7('0xa'),JSON[_0xb7b7('0xc')](_0x38e56b));if(_0x38e56b[_0xb7b7('0xd')]){if(_0x38e56b[_0xb7b7('0xd')][_0xb7b7('0xe')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x305996,_0x38e56b['error'][_0xb7b7('0xf')]);return _0x2c5c77(_0x38e56b[_0xb7b7('0xd')][_0xb7b7('0xf')]);}logger['error'](_0xb7b7('0x10'),_0x305996,_0x38e56b[_0xb7b7('0xd')][_0xb7b7('0xf')]);return _0x483669(_0x38e56b['error'][_0xb7b7('0xf')]);}else{logger[_0xb7b7('0x9')](_0xb7b7('0x10'),_0x305996,_0xb7b7('0xa'));_0x483669(_0x38e56b[_0xb7b7('0x11')][_0xb7b7('0xf')]);}})[_0xb7b7('0x12')](function(_0x44f937){logger[_0xb7b7('0xd')](_0xb7b7('0x10'),_0x305996,_0x44f937);_0x2c5c77(_0x44f937);});});}