Built motion from commit (unavailable).|2.5.4
[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 _0xd361=['request','then','info','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','MailServerOut,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x261347,_0x3744bd){var _0x47e650=function(_0xd19ed2){while(--_0xd19ed2){_0x261347['push'](_0x261347['shift']());}};_0x47e650(++_0x3744bd);}(_0xd361,0xf3));var _0x1d36=function(_0x2cd1f2,_0x39972b){_0x2cd1f2=_0x2cd1f2-0x0;var _0x5f1267=_0xd361[_0x2cd1f2];return _0x5f1267;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d36('0x0'));var BPromise=require(_0x1d36('0x1'));var rs=require(_0x1d36('0x2'));var fs=require('fs');var Redis=require(_0x1d36('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d36('0x4'));var logger=require(_0x1d36('0x5'))(_0x1d36('0x6'));var config=require(_0x1d36('0x7'));var jayson=require(_0x1d36('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e24ef,_0x2fa114,_0x116f25){return new BPromise(function(_0x1b530c,_0x59371a){return client[_0x1d36('0x9')](_0x1e24ef,_0x116f25)[_0x1d36('0xa')](function(_0x485533){logger[_0x1d36('0xb')]('MailServerOut,\x20%s,\x20%s',_0x2fa114,_0x1d36('0xc'));logger[_0x1d36('0xd')](_0x1d36('0xe'),_0x2fa114,_0x1d36('0xc'),JSON[_0x1d36('0xf')](_0x485533));if(_0x485533[_0x1d36('0x10')]){if(_0x485533[_0x1d36('0x10')]['code']===0x1f4){logger[_0x1d36('0x10')](_0x1d36('0x11'),_0x2fa114,_0x485533[_0x1d36('0x10')][_0x1d36('0x12')]);return _0x59371a(_0x485533[_0x1d36('0x10')][_0x1d36('0x12')]);}logger[_0x1d36('0x10')](_0x1d36('0x11'),_0x2fa114,_0x485533[_0x1d36('0x10')]['message']);return _0x1b530c(_0x485533['error'][_0x1d36('0x12')]);}else{logger[_0x1d36('0xb')](_0x1d36('0x11'),_0x2fa114,'request\x20sent');_0x1b530c(_0x485533[_0x1d36('0x13')][_0x1d36('0x12')]);}})[_0x1d36('0x14')](function(_0xa5696f){logger[_0x1d36('0x10')](_0x1d36('0x11'),_0x2fa114,_0xa5696f);_0x59371a(_0xa5696f);});});}