Built motion from commit (unavailable).|2.5.13
[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 _0xec75=['request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5d0004,_0x4bcb9a){var _0x4be732=function(_0x30e2f4){while(--_0x30e2f4){_0x5d0004['push'](_0x5d0004['shift']());}};_0x4be732(++_0x4bcb9a);}(_0xec75,0x10f));var _0x5ec7=function(_0x5548b3,_0x20c837){_0x5548b3=_0x5548b3-0x0;var _0x527cc4=_0xec75[_0x5548b3];return _0x527cc4;};'use strict';var _=require('lodash');var util=require(_0x5ec7('0x0'));var moment=require(_0x5ec7('0x1'));var BPromise=require(_0x5ec7('0x2'));var rs=require(_0x5ec7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ec7('0x4'));var logger=require('../../config/logger')(_0x5ec7('0x5'));var config=require(_0x5ec7('0x6'));var jayson=require(_0x5ec7('0x7'));var client=jayson[_0x5ec7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x599b24,_0x517d33,_0x3b28a3){return new BPromise(function(_0x3ca512,_0x248ec2){return client[_0x5ec7('0x9')](_0x599b24,_0x3b28a3)[_0x5ec7('0xa')](function(_0x157231){logger[_0x5ec7('0xb')](_0x5ec7('0xc'),_0x517d33,'request\x20sent');logger['debug'](_0x5ec7('0xd'),_0x517d33,_0x5ec7('0xe'),JSON['stringify'](_0x157231));if(_0x157231[_0x5ec7('0xf')]){if(_0x157231[_0x5ec7('0xf')][_0x5ec7('0x10')]===0x1f4){logger[_0x5ec7('0xf')](_0x5ec7('0xc'),_0x517d33,_0x157231[_0x5ec7('0xf')][_0x5ec7('0x11')]);return _0x248ec2(_0x157231['error'][_0x5ec7('0x11')]);}logger[_0x5ec7('0xf')](_0x5ec7('0xc'),_0x517d33,_0x157231[_0x5ec7('0xf')][_0x5ec7('0x11')]);return _0x3ca512(_0x157231['error'][_0x5ec7('0x11')]);}else{logger[_0x5ec7('0xb')](_0x5ec7('0xc'),_0x517d33,_0x5ec7('0xe'));_0x3ca512(_0x157231[_0x5ec7('0x12')][_0x5ec7('0x11')]);}})[_0x5ec7('0x13')](function(_0x5d3963){logger[_0x5ec7('0xf')](_0x5ec7('0xc'),_0x517d33,_0x5d3963);_0x248ec2(_0x5d3963);});});}