8f18b3cfa1e91f7a79501d8d6bfe61d9fa3b4bc3
[motion2.git] / server / api / mailServerOut / mailServerOut.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 _0x39ca=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailServerOut,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x39ca,0x11d));var _0xa39c=function(_0x3c3313,_0x1ea90d){_0x3c3313=_0x3c3313-0x0;var _0xb947aa=_0x39ca[_0x3c3313];return _0xb947aa;};'use strict';var _=require(_0xa39c('0x0'));var util=require(_0xa39c('0x1'));var moment=require(_0xa39c('0x2'));var BPromise=require(_0xa39c('0x3'));var rs=require(_0xa39c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa39c('0x5'))['db'];var utils=require(_0xa39c('0x6'));var logger=require(_0xa39c('0x7'))('rpc');var config=require(_0xa39c('0x8'));var jayson=require(_0xa39c('0x9'));var client=jayson[_0xa39c('0xa')][_0xa39c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cb022,_0x2d992f,_0x2f69f6){return new BPromise(function(_0x1c6c54,_0x33d393){return client[_0xa39c('0xc')](_0x5cb022,_0x2f69f6)['then'](function(_0x4b1e85){logger['info']('MailServerOut,\x20%s,\x20%s',_0x2d992f,'request\x20sent');logger[_0xa39c('0xd')](_0xa39c('0xe'),_0x2d992f,_0xa39c('0xf'),JSON[_0xa39c('0x10')](_0x4b1e85));if(_0x4b1e85[_0xa39c('0x11')]){if(_0x4b1e85[_0xa39c('0x11')][_0xa39c('0x12')]===0x1f4){logger[_0xa39c('0x11')](_0xa39c('0x13'),_0x2d992f,_0x4b1e85[_0xa39c('0x11')][_0xa39c('0x14')]);return _0x33d393(_0x4b1e85[_0xa39c('0x11')][_0xa39c('0x14')]);}logger[_0xa39c('0x11')](_0xa39c('0x13'),_0x2d992f,_0x4b1e85[_0xa39c('0x11')][_0xa39c('0x14')]);return _0x1c6c54(_0x4b1e85[_0xa39c('0x11')][_0xa39c('0x14')]);}else{logger['info'](_0xa39c('0x13'),_0x2d992f,_0xa39c('0xf'));_0x1c6c54(_0x4b1e85['result'][_0xa39c('0x14')]);}})[_0xa39c('0x15')](function(_0x1a6e72){logger[_0xa39c('0x11')]('MailServerOut,\x20%s,\x20%s',_0x2d992f,_0x1a6e72);_0x33d393(_0x1a6e72);});});}