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 _0x3290=['error','code','MailServerOut,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x99f838,_0xe376e2){var _0x432cd7=function(_0x2cd5dc){while(--_0x2cd5dc){_0x99f838['push'](_0x99f838['shift']());}};_0x432cd7(++_0xe376e2);}(_0x3290,0x130));var _0x0329=function(_0x25aad1,_0x4dcf28){_0x25aad1=_0x25aad1-0x0;var _0x3e79f1=_0x3290[_0x25aad1];return _0x3e79f1;};'use strict';var _=require(_0x0329('0x0'));var util=require(_0x0329('0x1'));var moment=require('moment');var BPromise=require(_0x0329('0x2'));var rs=require(_0x0329('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0329('0x4'))['db'];var utils=require(_0x0329('0x5'));var logger=require(_0x0329('0x6'))(_0x0329('0x7'));var config=require(_0x0329('0x8'));var jayson=require(_0x0329('0x9'));var client=jayson['client'][_0x0329('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x532082,_0x5b7e8e,_0x48494b){return new BPromise(function(_0x265875,_0x50df82){return client[_0x0329('0xb')](_0x532082,_0x48494b)[_0x0329('0xc')](function(_0x43d923){logger[_0x0329('0xd')]('MailServerOut,\x20%s,\x20%s',_0x5b7e8e,'request\x20sent');logger[_0x0329('0xe')](_0x0329('0xf'),_0x5b7e8e,_0x0329('0x10'),JSON[_0x0329('0x11')](_0x43d923));if(_0x43d923[_0x0329('0x12')]){if(_0x43d923['error'][_0x0329('0x13')]===0x1f4){logger['error'](_0x0329('0x14'),_0x5b7e8e,_0x43d923[_0x0329('0x12')][_0x0329('0x15')]);return _0x50df82(_0x43d923['error'][_0x0329('0x15')]);}logger['error'](_0x0329('0x14'),_0x5b7e8e,_0x43d923[_0x0329('0x12')][_0x0329('0x15')]);return _0x265875(_0x43d923[_0x0329('0x12')][_0x0329('0x15')]);}else{logger['info'](_0x0329('0x14'),_0x5b7e8e,'request\x20sent');_0x265875(_0x43d923[_0x0329('0x16')][_0x0329('0x15')]);}})['catch'](function(_0x53d156){logger[_0x0329('0x12')](_0x0329('0x14'),_0x5b7e8e,_0x53d156);_0x50df82(_0x53d156);});});}