Built motion from commit (unavailable).|2.5.14
[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 _0x8f9b=['request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x5c7c2f,_0x58786b){var _0x2b4ad0=function(_0x5c5e69){while(--_0x5c5e69){_0x5c7c2f['push'](_0x5c7c2f['shift']());}};_0x2b4ad0(++_0x58786b);}(_0x8f9b,0x89));var _0xb8f9=function(_0x507d30,_0xad22e2){_0x507d30=_0x507d30-0x0;var _0x483d4f=_0x8f9b[_0x507d30];return _0x483d4f;};'use strict';var _=require(_0xb8f9('0x0'));var util=require(_0xb8f9('0x1'));var moment=require('moment');var BPromise=require(_0xb8f9('0x2'));var rs=require(_0xb8f9('0x3'));var fs=require('fs');var Redis=require(_0xb8f9('0x4'));var db=require(_0xb8f9('0x5'))['db'];var utils=require(_0xb8f9('0x6'));var logger=require('../../config/logger')(_0xb8f9('0x7'));var config=require('../../config/environment');var jayson=require(_0xb8f9('0x8'));var client=jayson[_0xb8f9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeb2e4c,_0x30d569,_0x3eeb67){return new BPromise(function(_0x4c3bf2,_0x3a6d09){return client[_0xb8f9('0xa')](_0xeb2e4c,_0x3eeb67)[_0xb8f9('0xb')](function(_0x387d75){logger[_0xb8f9('0xc')](_0xb8f9('0xd'),_0x30d569,_0xb8f9('0xe'));logger['debug'](_0xb8f9('0xf'),_0x30d569,'request\x20sent',JSON[_0xb8f9('0x10')](_0x387d75));if(_0x387d75[_0xb8f9('0x11')]){if(_0x387d75[_0xb8f9('0x11')][_0xb8f9('0x12')]===0x1f4){logger[_0xb8f9('0x11')]('MailServerOut,\x20%s,\x20%s',_0x30d569,_0x387d75[_0xb8f9('0x11')][_0xb8f9('0x13')]);return _0x3a6d09(_0x387d75[_0xb8f9('0x11')][_0xb8f9('0x13')]);}logger[_0xb8f9('0x11')](_0xb8f9('0xd'),_0x30d569,_0x387d75[_0xb8f9('0x11')][_0xb8f9('0x13')]);return _0x4c3bf2(_0x387d75[_0xb8f9('0x11')]['message']);}else{logger[_0xb8f9('0xc')](_0xb8f9('0xd'),_0x30d569,_0xb8f9('0xe'));_0x4c3bf2(_0x387d75[_0xb8f9('0x14')][_0xb8f9('0x13')]);}})['catch'](function(_0x3261da){logger[_0xb8f9('0x11')](_0xb8f9('0xd'),_0x30d569,_0x3261da);_0x3a6d09(_0x3261da);});});}