Built motion from commit 67e5df37.|2.0.66
[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 _0x3c8e=['http','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','client'];(function(_0x129bed,_0x529bf2){var _0x286f63=function(_0x247bf1){while(--_0x247bf1){_0x129bed['push'](_0x129bed['shift']());}};_0x286f63(++_0x529bf2);}(_0x3c8e,0x65));var _0xe3c8=function(_0x363392,_0x26e42e){_0x363392=_0x363392-0x0;var _0x407b89=_0x3c8e[_0x363392];return _0x407b89;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var moment=require(_0xe3c8('0x2'));var BPromise=require(_0xe3c8('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xe3c8('0x4'));var logger=require(_0xe3c8('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe3c8('0x6')][_0xe3c8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd7292b,_0x2eca95,_0x3091ce){return new BPromise(function(_0x505744,_0x46cd46){return client[_0xe3c8('0x8')](_0xd7292b,_0x3091ce)['then'](function(_0x32b573){logger[_0xe3c8('0x9')](_0xe3c8('0xa'),_0x2eca95,_0xe3c8('0xb'));logger[_0xe3c8('0xc')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x2eca95,_0xe3c8('0xb'),JSON['stringify'](_0x32b573));if(_0x32b573[_0xe3c8('0xd')]){if(_0x32b573[_0xe3c8('0xd')][_0xe3c8('0xe')]===0x1f4){logger[_0xe3c8('0xd')]('MailServerOut,\x20%s,\x20%s',_0x2eca95,_0x32b573[_0xe3c8('0xd')][_0xe3c8('0xf')]);return _0x46cd46(_0x32b573['error'][_0xe3c8('0xf')]);}logger[_0xe3c8('0xd')](_0xe3c8('0xa'),_0x2eca95,_0x32b573['error'][_0xe3c8('0xf')]);return _0x505744(_0x32b573[_0xe3c8('0xd')][_0xe3c8('0xf')]);}else{logger[_0xe3c8('0x9')]('MailServerOut,\x20%s,\x20%s',_0x2eca95,_0xe3c8('0xb'));_0x505744(_0x32b573[_0xe3c8('0x10')][_0xe3c8('0xf')]);}})[_0xe3c8('0x11')](function(_0xcb938){logger[_0xe3c8('0xd')](_0xe3c8('0xa'),_0x2eca95,_0xcb938);_0x46cd46(_0xcb938);});});}