Built motion from commit cb845558.|2.6.34
[motion2.git] / server / services / routing / server / applications / close.js
index 4353b90..d5931fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6058=['../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop'];(function(_0x197c30,_0xbaa2ee){var _0x4ebaaf=function(_0x3d2d80){while(--_0x3d2d80){_0x197c30['push'](_0x197c30['shift']());}};_0x4ebaaf(++_0xbaa2ee);}(_0x6058,0x176));var _0x8605=function(_0x45e647,_0x2c482c){_0x45e647=_0x45e647-0x0;var _0x2deace=_0x6058[_0x45e647];return _0x2deace;};'use strict';var moment=require('moment');var logger=require(_0x8605('0x0'))(_0x8605('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8605('0x2')),'smsInteraction':require(_0x8605('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8605('0x4')),'whatsappInteraction':require(_0x8605('0x5'))};exports[_0x8605('0x6')]=function(_0x157020,_0x359290,_0xaad6be,_0xe0216a){return function(_0x1b508f){try{logger[_0x8605('0x7')](_0x8605('0x8'),_0x157020,_0x359290[0x0]);var _0x368309={'closed':0x1,'closedAt':moment()[_0x8605('0x9')](_0x8605('0xa')),'closeReason':_0x8605('0xb'),'disposition':_0x359290[0x0]};if(rpc[_0xe0216a[_0x8605('0xc')]+_0x8605('0xd')]){rpc[_0xe0216a['channel']+_0x8605('0xd')][_0x8605('0xe')](_0xe0216a[_0x8605('0xf')]['id'],_0x368309)['then'](function(_0x391dc1){logger['info'](_0x8605('0x10'),_0x157020,_0xe0216a[_0x8605('0xf')]['id']);})['catch'](function(_0x591acd){logger[_0x8605('0x11')](_0x8605('0x12'),_0x157020,JSON[_0x8605('0x13')](_0x591acd));})[_0x8605('0x14')](function(){_0x1b508f[_0x8605('0x15')]();});}}catch(_0x4215b4){logger[_0x8605('0x11')](_0x8605('0x12'),_0x157020,JSON[_0x8605('0x13')](_0x4215b4));_0x1b508f[_0x8605('0x15')]();}};};
\ No newline at end of file
+var _0x1253=['catch','stringify','stop','error','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x1253,0x18c));var _0x3125=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1253[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0x3125('0x0'));var logger=require(_0x3125('0x1'))(_0x3125('0x2'));var rpc={'chatInteraction':require(_0x3125('0x3')),'openchannelInteraction':require(_0x3125('0x4')),'smsInteraction':require(_0x3125('0x5')),'mailInteraction':require(_0x3125('0x6')),'faxInteraction':require(_0x3125('0x7')),'whatsappInteraction':require(_0x3125('0x8'))};exports['consequence']=function(_0x23ee61,_0x5b81be,_0x5f5d7a,_0x3b2d71){return function(_0x237a87){try{logger[_0x3125('0x9')](_0x3125('0xa'),_0x23ee61,_0x5b81be[0x0]);var _0x165b6c={'closed':0x1,'closedAt':moment()[_0x3125('0xb')](_0x3125('0xc')),'closeReason':'system','disposition':_0x5b81be[0x0]};if(rpc[_0x3b2d71['channel']+_0x3125('0xd')]){rpc[_0x3b2d71['channel']+'Interaction'][_0x3125('0xe')](_0x3b2d71[_0x3125('0xf')]['id'],_0x165b6c)[_0x3125('0x10')](function(_0x3ed3ee){logger[_0x3125('0x9')](_0x3125('0x11'),_0x23ee61,_0x3b2d71[_0x3125('0xf')]['id']);})[_0x3125('0x12')](function(_0x33ad5d){logger['error']('[%s][CLOSE]\x20%s',_0x23ee61,JSON[_0x3125('0x13')](_0x33ad5d));})['finally'](function(){_0x237a87[_0x3125('0x14')]();});}}catch(_0x492140){logger[_0x3125('0x15')](_0x3125('0x16'),_0x23ee61,JSON[_0x3125('0x13')](_0x492140));_0x237a87['stop']();}};};
\ No newline at end of file