Built motion from commit (unavailable).|2.5.1
[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 _0x2ca5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment'];(function(_0x58e1d8,_0x376aa8){var _0x566728=function(_0x436e43){while(--_0x436e43){_0x58e1d8['push'](_0x58e1d8['shift']());}};_0x566728(++_0x376aa8);}(_0x2ca5,0x139));var _0x52ca=function(_0x451ef3,_0x4331d7){_0x451ef3=_0x451ef3-0x0;var _0x257295=_0x2ca5[_0x451ef3];return _0x257295;};'use strict';var _=require('lodash');var util=require(_0x52ca('0x0'));var moment=require(_0x52ca('0x1'));var BPromise=require('bluebird');var rs=require(_0x52ca('0x2'));var fs=require('fs');var Redis=require(_0x52ca('0x3'));var db=require(_0x52ca('0x4'))['db'];var utils=require(_0x52ca('0x5'));var logger=require(_0x52ca('0x6'))(_0x52ca('0x7'));var config=require(_0x52ca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x52ca('0x9')][_0x52ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4287d0,_0x285391,_0x1d0445){return new BPromise(function(_0x4eb3dd,_0x1ec885){return client['request'](_0x4287d0,_0x1d0445)['then'](function(_0x5e05c1){logger['info'](_0x52ca('0xb'),_0x285391,_0x52ca('0xc'));logger[_0x52ca('0xd')](_0x52ca('0xe'),_0x285391,_0x52ca('0xc'),JSON[_0x52ca('0xf')](_0x5e05c1));if(_0x5e05c1['error']){if(_0x5e05c1[_0x52ca('0x10')][_0x52ca('0x11')]===0x1f4){logger[_0x52ca('0x10')](_0x52ca('0xb'),_0x285391,_0x5e05c1[_0x52ca('0x10')][_0x52ca('0x12')]);return _0x1ec885(_0x5e05c1[_0x52ca('0x10')][_0x52ca('0x12')]);}logger['error'](_0x52ca('0xb'),_0x285391,_0x5e05c1[_0x52ca('0x10')]['message']);return _0x4eb3dd(_0x5e05c1[_0x52ca('0x10')]['message']);}else{logger[_0x52ca('0x13')](_0x52ca('0xb'),_0x285391,_0x52ca('0xc'));_0x4eb3dd(_0x5e05c1['result'][_0x52ca('0x12')]);}})[_0x52ca('0x14')](function(_0x3cb48d){logger[_0x52ca('0x10')](_0x52ca('0xb'),_0x285391,_0x3cb48d);_0x1ec885(_0x3cb48d);});});}