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 _0x46dc=['code','message','info','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x46dc,0x1a8));var _0xc46d=function(_0x24977b,_0x2268b7){_0x24977b=_0x24977b-0x0;var _0x5642a9=_0x46dc[_0x24977b];return _0x5642a9;};'use strict';var _=require(_0xc46d('0x0'));var util=require(_0xc46d('0x1'));var moment=require('moment');var BPromise=require(_0xc46d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc46d('0x3'));var db=require(_0xc46d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc46d('0x5'))(_0xc46d('0x6'));var config=require(_0xc46d('0x7'));var jayson=require(_0xc46d('0x8'));var client=jayson['client'][_0xc46d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10f927,_0x52ec32,_0x4caa40){return new BPromise(function(_0x47cfad,_0xeb0bbe){return client[_0xc46d('0xa')](_0x10f927,_0x4caa40)['then'](function(_0x206478){logger['info'](_0xc46d('0xb'),_0x52ec32,_0xc46d('0xc'));logger[_0xc46d('0xd')](_0xc46d('0xe'),_0x52ec32,'request\x20sent',JSON[_0xc46d('0xf')](_0x206478));if(_0x206478[_0xc46d('0x10')]){if(_0x206478['error'][_0xc46d('0x11')]===0x1f4){logger[_0xc46d('0x10')](_0xc46d('0xb'),_0x52ec32,_0x206478['error'][_0xc46d('0x12')]);return _0xeb0bbe(_0x206478[_0xc46d('0x10')][_0xc46d('0x12')]);}logger[_0xc46d('0x10')](_0xc46d('0xb'),_0x52ec32,_0x206478['error'][_0xc46d('0x12')]);return _0x47cfad(_0x206478[_0xc46d('0x10')][_0xc46d('0x12')]);}else{logger[_0xc46d('0x13')](_0xc46d('0xb'),_0x52ec32,_0xc46d('0xc'));_0x47cfad(_0x206478['result']['message']);}})[_0xc46d('0x14')](function(_0x5da7f5){logger[_0xc46d('0x10')](_0xc46d('0xb'),_0x52ec32,_0x5da7f5);_0xeb0bbe(_0x5da7f5);});});}