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 _0x4be5=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x43433c,_0x5dd0b2){var _0x3c7a36=function(_0x462442){while(--_0x462442){_0x43433c['push'](_0x43433c['shift']());}};_0x3c7a36(++_0x5dd0b2);}(_0x4be5,0xca));var _0x54be=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x4be5[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x54be('0x0'));var util=require(_0x54be('0x1'));var moment=require(_0x54be('0x2'));var BPromise=require(_0x54be('0x3'));var rs=require(_0x54be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54be('0x5'))['db'];var utils=require(_0x54be('0x6'));var logger=require(_0x54be('0x7'))('rpc');var config=require(_0x54be('0x8'));var jayson=require(_0x54be('0x9'));var client=jayson[_0x54be('0xa')][_0x54be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b77a6,_0x1d4f08,_0x28b2b5){return new BPromise(function(_0x51ca15,_0x36fc93){return client[_0x54be('0xc')](_0x4b77a6,_0x28b2b5)[_0x54be('0xd')](function(_0x1a5ea9){logger['info'](_0x54be('0xe'),_0x1d4f08,_0x54be('0xf'));logger[_0x54be('0x10')](_0x54be('0x11'),_0x1d4f08,_0x54be('0xf'),JSON['stringify'](_0x1a5ea9));if(_0x1a5ea9['error']){if(_0x1a5ea9[_0x54be('0x12')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x1d4f08,_0x1a5ea9[_0x54be('0x12')]['message']);return _0x36fc93(_0x1a5ea9[_0x54be('0x12')][_0x54be('0x13')]);}logger['error'](_0x54be('0xe'),_0x1d4f08,_0x1a5ea9[_0x54be('0x12')]['message']);return _0x51ca15(_0x1a5ea9['error'][_0x54be('0x13')]);}else{logger[_0x54be('0x14')](_0x54be('0xe'),_0x1d4f08,'request\x20sent');_0x51ca15(_0x1a5ea9[_0x54be('0x15')][_0x54be('0x13')]);}})[_0x54be('0x16')](function(_0x4e9dca){logger[_0x54be('0x12')](_0x54be('0xe'),_0x1d4f08,_0x4e9dca);_0x36fc93(_0x4e9dca);});});}