Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / routing / server / applications / close.js
index f1f4c7d..6e691c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf417=['routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','system','Interaction','channel','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stop','stringify','../../../../config/logger'];(function(_0x112036,_0x2a3aa3){var _0x4afc55=function(_0x483a7f){while(--_0x483a7f){_0x112036['push'](_0x112036['shift']());}};_0x4afc55(++_0x2a3aa3);}(_0xf417,0x8f));var _0x7f41=function(_0x5ce34a,_0x57887e){_0x5ce34a=_0x5ce34a-0x0;var _0x309350=_0xf417[_0x5ce34a];return _0x309350;};'use strict';var moment=require('moment');var logger=require(_0x7f41('0x0'))(_0x7f41('0x1'));var rpc={'chatInteraction':require(_0x7f41('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x7f41('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x7f41('0x4'))};exports['consequence']=function(_0x51b0cb,_0x5ad014,_0x5ecdb2,_0x1775d8){return function(_0x4e37b5){try{logger[_0x7f41('0x5')](_0x7f41('0x6'),_0x51b0cb,_0x5ad014[0x0]);var _0x507ac0={'closed':0x1,'closedAt':moment()[_0x7f41('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x7f41('0x8'),'disposition':_0x5ad014[0x0]};if(rpc[_0x1775d8['channel']+_0x7f41('0x9')]){rpc[_0x1775d8[_0x7f41('0xa')]+'Interaction']['update'](_0x1775d8[_0x7f41('0xb')]['id'],_0x507ac0)['then'](function(_0x4bc8ff){logger[_0x7f41('0x5')](_0x7f41('0xc'),_0x51b0cb,_0x1775d8[_0x7f41('0xb')]['id']);})[_0x7f41('0xd')](function(_0x637b2d){logger[_0x7f41('0xe')](_0x7f41('0xf'),_0x51b0cb,JSON['stringify'](_0x637b2d));})['finally'](function(){_0x4e37b5[_0x7f41('0x10')]();});}}catch(_0x4f5b74){logger['error'](_0x7f41('0xf'),_0x51b0cb,JSON[_0x7f41('0x11')](_0x4f5b74));_0x4e37b5[_0x7f41('0x10')]();}};};
\ No newline at end of file
+var _0x31f0=['consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x55bfb9,_0x208357){var _0x13c0f3=function(_0x96c95b){while(--_0x96c95b){_0x55bfb9['push'](_0x55bfb9['shift']());}};_0x13c0f3(++_0x208357);}(_0x31f0,0xb7));var _0x031f=function(_0xcb01d1,_0x5e7471){_0xcb01d1=_0xcb01d1-0x0;var _0x569c54=_0x31f0[_0xcb01d1];return _0x569c54;};'use strict';var moment=require(_0x031f('0x0'));var logger=require('../../../../config/logger')(_0x031f('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x031f('0x2')),'smsInteraction':require(_0x031f('0x3')),'mailInteraction':require(_0x031f('0x4')),'faxInteraction':require(_0x031f('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x031f('0x6')]=function(_0x1a63ba,_0x4f6059,_0x4c0f94,_0x56328c){return function(_0x3dc98e){try{logger['info'](_0x031f('0x7'),_0x1a63ba,_0x4f6059[0x0]);var _0x4300b4={'closed':0x1,'closedAt':moment()[_0x031f('0x8')](_0x031f('0x9')),'closeReason':'system','disposition':_0x4f6059[0x0]};if(rpc[_0x56328c[_0x031f('0xa')]+_0x031f('0xb')]){rpc[_0x56328c[_0x031f('0xa')]+_0x031f('0xb')][_0x031f('0xc')](_0x56328c[_0x031f('0xd')]['id'],_0x4300b4)[_0x031f('0xe')](function(_0x3fd541){logger['info'](_0x031f('0xf'),_0x1a63ba,_0x56328c[_0x031f('0xd')]['id']);})[_0x031f('0x10')](function(_0x351052){logger[_0x031f('0x11')](_0x031f('0x12'),_0x1a63ba,JSON[_0x031f('0x13')](_0x351052));})['finally'](function(){_0x3dc98e[_0x031f('0x14')]();});}}catch(_0x23b40c){logger[_0x031f('0x11')](_0x031f('0x12'),_0x1a63ba,JSON[_0x031f('0x13')](_0x23b40c));_0x3dc98e['stop']();}};};
\ No newline at end of file