Built motion from commit (unavailable).|2.2.3
[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 _0x29be=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x29be,0x70));var _0xe29b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x29be[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xe29b('0x0'));var util=require(_0xe29b('0x1'));var moment=require(_0xe29b('0x2'));var BPromise=require(_0xe29b('0x3'));var rs=require(_0xe29b('0x4'));var fs=require('fs');var Redis=require(_0xe29b('0x5'));var db=require(_0xe29b('0x6'))['db'];var utils=require(_0xe29b('0x7'));var logger=require(_0xe29b('0x8'))('rpc');var config=require(_0xe29b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe29b('0xa')][_0xe29b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27b88f,_0x15edc7,_0x28390b){return new BPromise(function(_0x13c431,_0x1bc4f7){return client[_0xe29b('0xc')](_0x27b88f,_0x28390b)[_0xe29b('0xd')](function(_0xd69b6b){logger[_0xe29b('0xe')](_0xe29b('0xf'),_0x15edc7,_0xe29b('0x10'));logger[_0xe29b('0x11')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x15edc7,_0xe29b('0x10'),JSON[_0xe29b('0x12')](_0xd69b6b));if(_0xd69b6b[_0xe29b('0x13')]){if(_0xd69b6b[_0xe29b('0x13')]['code']===0x1f4){logger[_0xe29b('0x13')](_0xe29b('0xf'),_0x15edc7,_0xd69b6b[_0xe29b('0x13')]['message']);return _0x1bc4f7(_0xd69b6b[_0xe29b('0x13')][_0xe29b('0x14')]);}logger[_0xe29b('0x13')](_0xe29b('0xf'),_0x15edc7,_0xd69b6b[_0xe29b('0x13')][_0xe29b('0x14')]);return _0x13c431(_0xd69b6b[_0xe29b('0x13')][_0xe29b('0x14')]);}else{logger[_0xe29b('0xe')](_0xe29b('0xf'),_0x15edc7,_0xe29b('0x10'));_0x13c431(_0xd69b6b['result']['message']);}})[_0xe29b('0x15')](function(_0x2dcfba){logger[_0xe29b('0x13')](_0xe29b('0xf'),_0x15edc7,_0x2dcfba);_0x1bc4f7(_0x2dcfba);});});}