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 _0x9513=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment'];(function(_0x59bdf7,_0x20da28){var _0x472728=function(_0x50595a){while(--_0x50595a){_0x59bdf7['push'](_0x59bdf7['shift']());}};_0x472728(++_0x20da28);}(_0x9513,0x1b3));var _0x3951=function(_0x35fa58,_0x3c47b2){_0x35fa58=_0x35fa58-0x0;var _0x22a46c=_0x9513[_0x35fa58];return _0x22a46c;};'use strict';var _=require(_0x3951('0x0'));var util=require('util');var moment=require(_0x3951('0x1'));var BPromise=require(_0x3951('0x2'));var rs=require(_0x3951('0x3'));var fs=require('fs');var Redis=require(_0x3951('0x4'));var db=require(_0x3951('0x5'))['db'];var utils=require(_0x3951('0x6'));var logger=require(_0x3951('0x7'))(_0x3951('0x8'));var config=require('../../config/environment');var jayson=require(_0x3951('0x9'));var client=jayson[_0x3951('0xa')][_0x3951('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4856d5,_0x404fcf,_0x608e1a){return new BPromise(function(_0x50baea,_0x369310){return client[_0x3951('0xc')](_0x4856d5,_0x608e1a)[_0x3951('0xd')](function(_0x31342d){logger[_0x3951('0xe')](_0x3951('0xf'),_0x404fcf,_0x3951('0x10'));logger[_0x3951('0x11')](_0x3951('0x12'),_0x404fcf,_0x3951('0x10'),JSON['stringify'](_0x31342d));if(_0x31342d[_0x3951('0x13')]){if(_0x31342d[_0x3951('0x13')][_0x3951('0x14')]===0x1f4){logger[_0x3951('0x13')](_0x3951('0xf'),_0x404fcf,_0x31342d[_0x3951('0x13')]['message']);return _0x369310(_0x31342d['error'][_0x3951('0x15')]);}logger[_0x3951('0x13')](_0x3951('0xf'),_0x404fcf,_0x31342d[_0x3951('0x13')][_0x3951('0x15')]);return _0x50baea(_0x31342d[_0x3951('0x13')]['message']);}else{logger[_0x3951('0xe')](_0x3951('0xf'),_0x404fcf,'request\x20sent');_0x50baea(_0x31342d['result'][_0x3951('0x15')]);}})[_0x3951('0x16')](function(_0xbc70c2){logger[_0x3951('0x13')](_0x3951('0xf'),_0x404fcf,_0xbc70c2);_0x369310(_0xbc70c2);});});}