Built motion from commit (unavailable).|2.4.19
[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 _0x8b7c=['then','MailServerOut,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x8b7c,0xf1));var _0xc8b7=function(_0x432d38,_0x201399){_0x432d38=_0x432d38-0x0;var _0x39c577=_0x8b7c[_0x432d38];return _0x39c577;};'use strict';var _=require('lodash');var util=require(_0xc8b7('0x0'));var moment=require(_0xc8b7('0x1'));var BPromise=require(_0xc8b7('0x2'));var rs=require(_0xc8b7('0x3'));var fs=require('fs');var Redis=require(_0xc8b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8b7('0x5'));var logger=require('../../config/logger')(_0xc8b7('0x6'));var config=require('../../config/environment');var jayson=require(_0xc8b7('0x7'));var client=jayson[_0xc8b7('0x8')][_0xc8b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48d99d,_0x302a1f,_0x24fc17){return new BPromise(function(_0x9099a4,_0x2dfcf5){return client[_0xc8b7('0xa')](_0x48d99d,_0x24fc17)[_0xc8b7('0xb')](function(_0x4de6a3){logger['info'](_0xc8b7('0xc'),_0x302a1f,'request\x20sent');logger[_0xc8b7('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x302a1f,_0xc8b7('0xe'),JSON['stringify'](_0x4de6a3));if(_0x4de6a3[_0xc8b7('0xf')]){if(_0x4de6a3[_0xc8b7('0xf')][_0xc8b7('0x10')]===0x1f4){logger['error'](_0xc8b7('0xc'),_0x302a1f,_0x4de6a3[_0xc8b7('0xf')]['message']);return _0x2dfcf5(_0x4de6a3[_0xc8b7('0xf')][_0xc8b7('0x11')]);}logger[_0xc8b7('0xf')](_0xc8b7('0xc'),_0x302a1f,_0x4de6a3['error'][_0xc8b7('0x11')]);return _0x9099a4(_0x4de6a3[_0xc8b7('0xf')][_0xc8b7('0x11')]);}else{logger[_0xc8b7('0x12')](_0xc8b7('0xc'),_0x302a1f,_0xc8b7('0xe'));_0x9099a4(_0x4de6a3[_0xc8b7('0x13')]['message']);}})[_0xc8b7('0x14')](function(_0x6a66ff){logger[_0xc8b7('0xf')](_0xc8b7('0xc'),_0x302a1f,_0x6a66ff);_0x2dfcf5(_0x6a66ff);});});}