Built motion from commit (unavailable).|2.5.22
[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 _0x3e36=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x32be62,_0x22e6fd){var _0x1a37e9=function(_0x35a9c1){while(--_0x35a9c1){_0x32be62['push'](_0x32be62['shift']());}};_0x1a37e9(++_0x22e6fd);}(_0x3e36,0x18e));var _0x63e3=function(_0x1632d3,_0x10c3f3){_0x1632d3=_0x1632d3-0x0;var _0x193525=_0x3e36[_0x1632d3];return _0x193525;};'use strict';var _=require(_0x63e3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63e3('0x1'));var db=require(_0x63e3('0x2'))['db'];var utils=require(_0x63e3('0x3'));var logger=require('../../config/logger')(_0x63e3('0x4'));var config=require(_0x63e3('0x5'));var jayson=require(_0x63e3('0x6'));var client=jayson[_0x63e3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6e93e6,_0x1a8433,_0x979029){return new BPromise(function(_0x183243,_0x2b8269){return client[_0x63e3('0x8')](_0x6e93e6,_0x979029)[_0x63e3('0x9')](function(_0x5f56dd){logger[_0x63e3('0xa')](_0x63e3('0xb'),_0x1a8433,_0x63e3('0xc'));logger[_0x63e3('0xd')](_0x63e3('0xe'),_0x1a8433,'request\x20sent',JSON[_0x63e3('0xf')](_0x5f56dd));if(_0x5f56dd['error']){if(_0x5f56dd[_0x63e3('0x10')][_0x63e3('0x11')]===0x1f4){logger[_0x63e3('0x10')](_0x63e3('0xb'),_0x1a8433,_0x5f56dd[_0x63e3('0x10')][_0x63e3('0x12')]);return _0x2b8269(_0x5f56dd[_0x63e3('0x10')][_0x63e3('0x12')]);}logger[_0x63e3('0x10')]('MailServerOut,\x20%s,\x20%s',_0x1a8433,_0x5f56dd[_0x63e3('0x10')]['message']);return _0x183243(_0x5f56dd['error']['message']);}else{logger['info'](_0x63e3('0xb'),_0x1a8433,_0x63e3('0xc'));_0x183243(_0x5f56dd['result'][_0x63e3('0x12')]);}})['catch'](function(_0x3eee34){logger[_0x63e3('0x10')]('MailServerOut,\x20%s,\x20%s',_0x1a8433,_0x3eee34);_0x2b8269(_0x3eee34);});});}