Built motion from commit 1ea47bf4.|2.6.34
[motion2.git] / server / services / routing / server / applications / close.js
index 9967e5a..019d469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f4=['stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x571d83,_0x4cb677){var _0x36e67f=function(_0x39022b){while(--_0x39022b){_0x571d83['push'](_0x571d83['shift']());}};_0x36e67f(++_0x4cb677);}(_0xe9f4,0x13c));var _0x4e9f=function(_0xe4b024,_0x8deaf5){_0xe4b024=_0xe4b024-0x0;var _0x443a04=_0xe9f4[_0xe4b024];return _0x443a04;};'use strict';var moment=require(_0x4e9f('0x0'));var logger=require(_0x4e9f('0x1'))(_0x4e9f('0x2'));var rpc={'chatInteraction':require(_0x4e9f('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4e9f('0x4')),'mailInteraction':require(_0x4e9f('0x5')),'faxInteraction':require(_0x4e9f('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x4e9f('0x7')]=function(_0x39a1d0,_0x2821d3,_0x26d163,_0x3968c8){return function(_0x2d9d95){try{logger[_0x4e9f('0x8')](_0x4e9f('0x9'),_0x39a1d0,_0x2821d3[0x0]);var _0x2fa88f={'closed':0x1,'closedAt':moment()[_0x4e9f('0xa')](_0x4e9f('0xb')),'closeReason':'system','disposition':_0x2821d3[0x0]};if(rpc[_0x3968c8['channel']+'Interaction']){rpc[_0x3968c8[_0x4e9f('0xc')]+'Interaction'][_0x4e9f('0xd')](_0x3968c8['interaction']['id'],_0x2fa88f)['then'](function(_0x4d161d){logger[_0x4e9f('0x8')](_0x4e9f('0xe'),_0x39a1d0,_0x3968c8[_0x4e9f('0xf')]['id']);})['catch'](function(_0x14f276){logger[_0x4e9f('0x10')](_0x4e9f('0x11'),_0x39a1d0,JSON[_0x4e9f('0x12')](_0x14f276));})[_0x4e9f('0x13')](function(){_0x2d9d95[_0x4e9f('0x14')]();});}}catch(_0x90a07e){logger[_0x4e9f('0x10')](_0x4e9f('0x11'),_0x39a1d0,JSON[_0x4e9f('0x12')](_0x90a07e));_0x2d9d95[_0x4e9f('0x14')]();}};};
\ No newline at end of file
+var _0x15bf=['error','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','[%s][CLOSE]\x20reason\x20%s','format','Interaction','channel','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15bf,0x18e));var _0xf15b=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x15bf[_0x71e493];return _0x3d40ab;};'use strict';var moment=require(_0xf15b('0x0'));var logger=require(_0xf15b('0x1'))('routing');var rpc={'chatInteraction':require(_0xf15b('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xf15b('0x3')),'faxInteraction':require(_0xf15b('0x4')),'whatsappInteraction':require(_0xf15b('0x5'))};exports['consequence']=function(_0x325f6d,_0x51aaec,_0xffdfb2,_0x446bb9){return function(_0x2ed90e){try{logger['info'](_0xf15b('0x6'),_0x325f6d,_0x51aaec[0x0]);var _0x155bdc={'closed':0x1,'closedAt':moment()[_0xf15b('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x51aaec[0x0]};if(rpc[_0x446bb9['channel']+_0xf15b('0x8')]){rpc[_0x446bb9[_0xf15b('0x9')]+_0xf15b('0x8')]['update'](_0x446bb9[_0xf15b('0xa')]['id'],_0x155bdc)['then'](function(_0x4735ea){logger[_0xf15b('0xb')](_0xf15b('0xc'),_0x325f6d,_0x446bb9[_0xf15b('0xa')]['id']);})[_0xf15b('0xd')](function(_0x3de16e){logger['error']('[%s][CLOSE]\x20%s',_0x325f6d,JSON[_0xf15b('0xe')](_0x3de16e));})[_0xf15b('0xf')](function(){_0x2ed90e['stop']();});}}catch(_0x1bc1d5){logger[_0xf15b('0x10')](_0xf15b('0x11'),_0x325f6d,JSON[_0xf15b('0xe')](_0x1bc1d5));_0x2ed90e['stop']();}};};
\ No newline at end of file