Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / services / routing / server / applications / close.js
index 386191b..7be8300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4d9=['stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify'];(function(_0x51899a,_0x3c6ab5){var _0x484075=function(_0x34c9c1){while(--_0x34c9c1){_0x51899a['push'](_0x51899a['shift']());}};_0x484075(++_0x3c6ab5);}(_0xe4d9,0x141));var _0x9e4d=function(_0x4623dd,_0x346f98){_0x4623dd=_0x4623dd-0x0;var _0x127f2e=_0xe4d9[_0x4623dd];return _0x127f2e;};'use strict';var moment=require(_0x9e4d('0x0'));var logger=require(_0x9e4d('0x1'))(_0x9e4d('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x9e4d('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x9e4d('0x4')),'whatsappInteraction':require(_0x9e4d('0x5'))};exports['consequence']=function(_0x2bf0c2,_0x29f77b,_0x5a4881,_0x493fb5){return function(_0x74b14){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x2bf0c2,_0x29f77b[0x0]);var _0x36ec30={'closed':0x1,'closedAt':moment()['format'](_0x9e4d('0x6')),'closeReason':_0x9e4d('0x7'),'disposition':_0x29f77b[0x0]};if(rpc[_0x493fb5['channel']+_0x9e4d('0x8')]){rpc[_0x493fb5[_0x9e4d('0x9')]+_0x9e4d('0x8')][_0x9e4d('0xa')](_0x493fb5[_0x9e4d('0xb')]['id'],_0x36ec30)[_0x9e4d('0xc')](function(_0x1c72b8){logger[_0x9e4d('0xd')](_0x9e4d('0xe'),_0x2bf0c2,_0x493fb5[_0x9e4d('0xb')]['id']);})[_0x9e4d('0xf')](function(_0x439240){logger[_0x9e4d('0x10')](_0x9e4d('0x11'),_0x2bf0c2,JSON[_0x9e4d('0x12')](_0x439240));})['finally'](function(){_0x74b14[_0x9e4d('0x13')]();});}}catch(_0x34916b){logger[_0x9e4d('0x10')](_0x9e4d('0x11'),_0x2bf0c2,JSON[_0x9e4d('0x12')](_0x34916b));_0x74b14[_0x9e4d('0x13')]();}};};
\ No newline at end of file
+var _0x7f05=['../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','system','Interaction','channel','update','[%s][CLOSE]\x20%s','stringify','finally','stop','moment'];(function(_0x292c26,_0x453998){var _0x4be988=function(_0x48b997){while(--_0x48b997){_0x292c26['push'](_0x292c26['shift']());}};_0x4be988(++_0x453998);}(_0x7f05,0xdc));var _0x57f0=function(_0x506323,_0x5208dc){_0x506323=_0x506323-0x0;var _0x326d48=_0x7f05[_0x506323];return _0x326d48;};'use strict';var moment=require(_0x57f0('0x0'));var logger=require(_0x57f0('0x1'))(_0x57f0('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x57f0('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x57f0('0x4')),'faxInteraction':require(_0x57f0('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x57f0('0x6')]=function(_0x615ad9,_0x4c3a58,_0x27b8f6,_0x295ad5){return function(_0x4975ec){try{logger[_0x57f0('0x7')](_0x57f0('0x8'),_0x615ad9,_0x4c3a58[0x0]);var _0x3f7ebc={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x57f0('0x9'),'disposition':_0x4c3a58[0x0]};if(rpc[_0x295ad5['channel']+_0x57f0('0xa')]){rpc[_0x295ad5[_0x57f0('0xb')]+_0x57f0('0xa')][_0x57f0('0xc')](_0x295ad5['interaction']['id'],_0x3f7ebc)['then'](function(_0x173e14){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x615ad9,_0x295ad5['interaction']['id']);})['catch'](function(_0x5cd266){logger['error'](_0x57f0('0xd'),_0x615ad9,JSON[_0x57f0('0xe')](_0x5cd266));})[_0x57f0('0xf')](function(){_0x4975ec[_0x57f0('0x10')]();});}}catch(_0x599a6b){logger['error'](_0x57f0('0xd'),_0x615ad9,JSON[_0x57f0('0xe')](_0x599a6b));_0x4975ec[_0x57f0('0x10')]();}};};
\ No newline at end of file