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 _0x42ce=['bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','then','info','request\x20sent','debug','stringify','error','code','message','MailServerOut,\x20%s,\x20%s','result','catch','moment'];(function(_0x1e592f,_0x2da2bf){var _0x367992=function(_0x1a2921){while(--_0x1a2921){_0x1e592f['push'](_0x1e592f['shift']());}};_0x367992(++_0x2da2bf);}(_0x42ce,0x142));var _0xe42c=function(_0x23ec3d,_0x5dad91){_0x23ec3d=_0x23ec3d-0x0;var _0x5767f4=_0x42ce[_0x23ec3d];return _0x5767f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe42c('0x0'));var BPromise=require(_0xe42c('0x1'));var rs=require(_0xe42c('0x2'));var fs=require('fs');var Redis=require(_0xe42c('0x3'));var db=require(_0xe42c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe42c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe42c('0x6')][_0xe42c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4292c8,_0x4b884c,_0x1ce27a){return new BPromise(function(_0x4b4aab,_0x2382fd){return client['request'](_0x4292c8,_0x1ce27a)[_0xe42c('0x8')](function(_0xb6b3cc){logger[_0xe42c('0x9')]('MailServerOut,\x20%s,\x20%s',_0x4b884c,_0xe42c('0xa'));logger[_0xe42c('0xb')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4b884c,_0xe42c('0xa'),JSON[_0xe42c('0xc')](_0xb6b3cc));if(_0xb6b3cc[_0xe42c('0xd')]){if(_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xe')]===0x1f4){logger[_0xe42c('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4b884c,_0xb6b3cc['error'][_0xe42c('0xf')]);return _0x2382fd(_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xf')]);}logger[_0xe42c('0xd')](_0xe42c('0x10'),_0x4b884c,_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xf')]);return _0x4b4aab(_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xf')]);}else{logger[_0xe42c('0x9')](_0xe42c('0x10'),_0x4b884c,_0xe42c('0xa'));_0x4b4aab(_0xb6b3cc[_0xe42c('0x11')]['message']);}})[_0xe42c('0x12')](function(_0x427147){logger['error'](_0xe42c('0x10'),_0x4b884c,_0x427147);_0x2382fd(_0x427147);});});}