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 _0xe705=['debug','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent'];(function(_0x32d816,_0x3308b1){var _0x20bd35=function(_0x2a68e2){while(--_0x2a68e2){_0x32d816['push'](_0x32d816['shift']());}};_0x20bd35(++_0x3308b1);}(_0xe705,0xaf));var _0x5e70=function(_0x4bbaba,_0x15097c){_0x4bbaba=_0x4bbaba-0x0;var _0x34ff2b=_0xe705[_0x4bbaba];return _0x34ff2b;};'use strict';var _=require(_0x5e70('0x0'));var util=require(_0x5e70('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5e70('0x2'));var fs=require('fs');var Redis=require(_0x5e70('0x3'));var db=require(_0x5e70('0x4'))['db'];var utils=require(_0x5e70('0x5'));var logger=require(_0x5e70('0x6'))(_0x5e70('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5e70('0x8')][_0x5e70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578ee4,_0x3b277b,_0x457f68){return new BPromise(function(_0x597b0a,_0x488816){return client[_0x5e70('0xa')](_0x578ee4,_0x457f68)[_0x5e70('0xb')](function(_0xe372e){logger['info'](_0x5e70('0xc'),_0x3b277b,_0x5e70('0xd'));logger[_0x5e70('0xe')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3b277b,_0x5e70('0xd'),JSON['stringify'](_0xe372e));if(_0xe372e[_0x5e70('0xf')]){if(_0xe372e[_0x5e70('0xf')][_0x5e70('0x10')]===0x1f4){logger[_0x5e70('0xf')](_0x5e70('0xc'),_0x3b277b,_0xe372e[_0x5e70('0xf')][_0x5e70('0x11')]);return _0x488816(_0xe372e[_0x5e70('0xf')][_0x5e70('0x11')]);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x3b277b,_0xe372e[_0x5e70('0xf')][_0x5e70('0x11')]);return _0x597b0a(_0xe372e['error']['message']);}else{logger[_0x5e70('0x12')](_0x5e70('0xc'),_0x3b277b,_0x5e70('0xd'));_0x597b0a(_0xe372e[_0x5e70('0x13')]['message']);}})[_0x5e70('0x14')](function(_0x90420c){logger[_0x5e70('0xf')](_0x5e70('0xc'),_0x3b277b,_0x90420c);_0x488816(_0x90420c);});});}