Built motion from commit (unavailable).|2.5.10
[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 _0xd275=['error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x24d4ea,_0x379db6){var _0x4f7c7f=function(_0x5312cd){while(--_0x5312cd){_0x24d4ea['push'](_0x24d4ea['shift']());}};_0x4f7c7f(++_0x379db6);}(_0xd275,0x14e));var _0x5d27=function(_0x58dfe4,_0xd3296a){_0x58dfe4=_0x58dfe4-0x0;var _0x1723a0=_0xd275[_0x58dfe4];return _0x1723a0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d27('0x0'));var BPromise=require('bluebird');var rs=require(_0x5d27('0x1'));var fs=require('fs');var Redis=require(_0x5d27('0x2'));var db=require(_0x5d27('0x3'))['db'];var utils=require(_0x5d27('0x4'));var logger=require(_0x5d27('0x5'))(_0x5d27('0x6'));var config=require(_0x5d27('0x7'));var jayson=require(_0x5d27('0x8'));var client=jayson[_0x5d27('0x9')][_0x5d27('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f869e,_0x3dccae,_0x1e7efa){return new BPromise(function(_0x1b4c72,_0x47bbdb){return client[_0x5d27('0xb')](_0x1f869e,_0x1e7efa)[_0x5d27('0xc')](function(_0x49dc1e){logger['info'](_0x5d27('0xd'),_0x3dccae,'request\x20sent');logger[_0x5d27('0xe')](_0x5d27('0xf'),_0x3dccae,_0x5d27('0x10'),JSON[_0x5d27('0x11')](_0x49dc1e));if(_0x49dc1e[_0x5d27('0x12')]){if(_0x49dc1e[_0x5d27('0x12')]['code']===0x1f4){logger['error'](_0x5d27('0xd'),_0x3dccae,_0x49dc1e['error']['message']);return _0x47bbdb(_0x49dc1e['error'][_0x5d27('0x13')]);}logger[_0x5d27('0x12')](_0x5d27('0xd'),_0x3dccae,_0x49dc1e['error'][_0x5d27('0x13')]);return _0x1b4c72(_0x49dc1e[_0x5d27('0x12')][_0x5d27('0x13')]);}else{logger['info'](_0x5d27('0xd'),_0x3dccae,_0x5d27('0x10'));_0x1b4c72(_0x49dc1e[_0x5d27('0x14')][_0x5d27('0x13')]);}})[_0x5d27('0x15')](function(_0x39a17f){logger[_0x5d27('0x12')]('MailServerOut,\x20%s,\x20%s',_0x3dccae,_0x39a17f);_0x47bbdb(_0x39a17f);});});}