Built motion from commit (unavailable).|2.5.11
[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 _0xb961=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','code','MailServerOut,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xb961,0x1b8));var _0x1b96=function(_0x20363a,_0xe52a02){_0x20363a=_0x20363a-0x0;var _0x422124=_0xb961[_0x20363a];return _0x422124;};'use strict';var _=require(_0x1b96('0x0'));var util=require(_0x1b96('0x1'));var moment=require(_0x1b96('0x2'));var BPromise=require(_0x1b96('0x3'));var rs=require(_0x1b96('0x4'));var fs=require('fs');var Redis=require(_0x1b96('0x5'));var db=require(_0x1b96('0x6'))['db'];var utils=require(_0x1b96('0x7'));var logger=require(_0x1b96('0x8'))(_0x1b96('0x9'));var config=require(_0x1b96('0xa'));var jayson=require(_0x1b96('0xb'));var client=jayson[_0x1b96('0xc')][_0x1b96('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5cc71b,_0x3d05e3,_0x3be1f6){return new BPromise(function(_0x2f5343,_0x41d412){return client['request'](_0x5cc71b,_0x3be1f6)[_0x1b96('0xe')](function(_0x46eaee){logger[_0x1b96('0xf')]('MailServerOut,\x20%s,\x20%s',_0x3d05e3,_0x1b96('0x10'));logger[_0x1b96('0x11')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3d05e3,_0x1b96('0x10'),JSON[_0x1b96('0x12')](_0x46eaee));if(_0x46eaee['error']){if(_0x46eaee['error'][_0x1b96('0x13')]===0x1f4){logger['error'](_0x1b96('0x14'),_0x3d05e3,_0x46eaee['error']['message']);return _0x41d412(_0x46eaee['error']['message']);}logger[_0x1b96('0x15')](_0x1b96('0x14'),_0x3d05e3,_0x46eaee[_0x1b96('0x15')]['message']);return _0x2f5343(_0x46eaee[_0x1b96('0x15')][_0x1b96('0x16')]);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x3d05e3,_0x1b96('0x10'));_0x2f5343(_0x46eaee[_0x1b96('0x17')][_0x1b96('0x16')]);}})[_0x1b96('0x18')](function(_0x421b4d){logger[_0x1b96('0x15')](_0x1b96('0x14'),_0x3d05e3,_0x421b4d);_0x41d412(_0x421b4d);});});}