Built motion from commit (unavailable).|2.5.14
[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 _0xb79e=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','MailServerOut,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x40de64,_0x1472d4){var _0x491fdc=function(_0x3ee721){while(--_0x3ee721){_0x40de64['push'](_0x40de64['shift']());}};_0x491fdc(++_0x1472d4);}(_0xb79e,0xb7));var _0xeb79=function(_0x1d99b8,_0x154ea9){_0x1d99b8=_0x1d99b8-0x0;var _0xbb06d0=_0xb79e[_0x1d99b8];return _0xbb06d0;};'use strict';var _=require(_0xeb79('0x0'));var util=require(_0xeb79('0x1'));var moment=require(_0xeb79('0x2'));var BPromise=require(_0xeb79('0x3'));var rs=require(_0xeb79('0x4'));var fs=require('fs');var Redis=require(_0xeb79('0x5'));var db=require(_0xeb79('0x6'))['db'];var utils=require(_0xeb79('0x7'));var logger=require(_0xeb79('0x8'))(_0xeb79('0x9'));var config=require('../../config/environment');var jayson=require(_0xeb79('0xa'));var client=jayson[_0xeb79('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcee2f3,_0x4a455e,_0x585cfc){return new BPromise(function(_0x2b5eea,_0x2d1a6f){return client[_0xeb79('0xc')](_0xcee2f3,_0x585cfc)['then'](function(_0x4b85d5){logger['info']('MailServerOut,\x20%s,\x20%s',_0x4a455e,'request\x20sent');logger['debug'](_0xeb79('0xd'),_0x4a455e,_0xeb79('0xe'),JSON['stringify'](_0x4b85d5));if(_0x4b85d5['error']){if(_0x4b85d5['error'][_0xeb79('0xf')]===0x1f4){logger[_0xeb79('0x10')]('MailServerOut,\x20%s,\x20%s',_0x4a455e,_0x4b85d5[_0xeb79('0x10')][_0xeb79('0x11')]);return _0x2d1a6f(_0x4b85d5[_0xeb79('0x10')][_0xeb79('0x11')]);}logger['error'](_0xeb79('0x12'),_0x4a455e,_0x4b85d5['error']['message']);return _0x2b5eea(_0x4b85d5['error'][_0xeb79('0x11')]);}else{logger[_0xeb79('0x13')](_0xeb79('0x12'),_0x4a455e,_0xeb79('0xe'));_0x2b5eea(_0x4b85d5['result'][_0xeb79('0x11')]);}})[_0xeb79('0x14')](function(_0x213e5f){logger['error'](_0xeb79('0x12'),_0x4a455e,_0x213e5f);_0x2d1a6f(_0x213e5f);});});}