Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / services / routing / server / applications / close.js
index 9a1ebc6..f1b0ef3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c46=['interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction'];(function(_0x5055f1,_0x3cbb87){var _0x28a9f0=function(_0x31433d){while(--_0x31433d){_0x5055f1['push'](_0x5055f1['shift']());}};_0x28a9f0(++_0x3cbb87);}(_0x8c46,0x171));var _0x68c4=function(_0x3dcc9d,_0x38ceb9){_0x3dcc9d=_0x3dcc9d-0x0;var _0x3b0d59=_0x8c46[_0x3dcc9d];return _0x3b0d59;};'use strict';var moment=require(_0x68c4('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0x68c4('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x68c4('0x2')),'faxInteraction':require(_0x68c4('0x3')),'whatsappInteraction':require(_0x68c4('0x4'))};exports[_0x68c4('0x5')]=function(_0x287adb,_0x1243c6,_0x40ce21,_0x1516cf){return function(_0x3da9c3){try{logger[_0x68c4('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x287adb,_0x1243c6[0x0]);var _0x1754d7={'closed':0x1,'closedAt':moment()[_0x68c4('0x7')](_0x68c4('0x8')),'closeReason':'system','disposition':_0x1243c6[0x0]};if(rpc[_0x1516cf[_0x68c4('0x9')]+_0x68c4('0xa')]){rpc[_0x1516cf[_0x68c4('0x9')]+'Interaction']['update'](_0x1516cf[_0x68c4('0xb')]['id'],_0x1754d7)[_0x68c4('0xc')](function(_0x50b161){logger['info'](_0x68c4('0xd'),_0x287adb,_0x1516cf[_0x68c4('0xb')]['id']);})[_0x68c4('0xe')](function(_0x48783b){logger[_0x68c4('0xf')](_0x68c4('0x10'),_0x287adb,JSON[_0x68c4('0x11')](_0x48783b));})['finally'](function(){_0x3da9c3[_0x68c4('0x12')]();});}}catch(_0x14919c){logger[_0x68c4('0xf')]('[%s][CLOSE]\x20%s',_0x287adb,JSON[_0x68c4('0x11')](_0x14919c));_0x3da9c3[_0x68c4('0x12')]();}};};
\ No newline at end of file
+var _0x0f9f=['info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','catch','error','stringify','finally','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence'];(function(_0x4f1a11,_0x225dfb){var _0x38bfe4=function(_0x4892f0){while(--_0x4892f0){_0x4f1a11['push'](_0x4f1a11['shift']());}};_0x38bfe4(++_0x225dfb);}(_0x0f9f,0xae));var _0xf0f9=function(_0x5ec25b,_0x1ff58e){_0x5ec25b=_0x5ec25b-0x0;var _0x4fe26f=_0x0f9f[_0x5ec25b];return _0x4fe26f;};'use strict';var moment=require(_0xf0f9('0x0'));var logger=require(_0xf0f9('0x1'))(_0xf0f9('0x2'));var rpc={'chatInteraction':require(_0xf0f9('0x3')),'openchannelInteraction':require(_0xf0f9('0x4')),'smsInteraction':require(_0xf0f9('0x5')),'mailInteraction':require(_0xf0f9('0x6')),'faxInteraction':require(_0xf0f9('0x7')),'whatsappInteraction':require(_0xf0f9('0x8'))};exports[_0xf0f9('0x9')]=function(_0x4ed571,_0x524fbd,_0xcc39d6,_0x4540a2){return function(_0x53d1e7){try{logger[_0xf0f9('0xa')](_0xf0f9('0xb'),_0x4ed571,_0x524fbd[0x0]);var _0x2ce622={'closed':0x1,'closedAt':moment()['format'](_0xf0f9('0xc')),'closeReason':_0xf0f9('0xd'),'disposition':_0x524fbd[0x0]};if(rpc[_0x4540a2['channel']+_0xf0f9('0xe')]){rpc[_0x4540a2[_0xf0f9('0xf')]+_0xf0f9('0xe')][_0xf0f9('0x10')](_0x4540a2[_0xf0f9('0x11')]['id'],_0x2ce622)[_0xf0f9('0x12')](function(_0x3ff1a9){logger[_0xf0f9('0xa')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4ed571,_0x4540a2[_0xf0f9('0x11')]['id']);})[_0xf0f9('0x13')](function(_0xc23039){logger[_0xf0f9('0x14')]('[%s][CLOSE]\x20%s',_0x4ed571,JSON[_0xf0f9('0x15')](_0xc23039));})[_0xf0f9('0x16')](function(){_0x53d1e7['stop']();});}}catch(_0x334c39){logger['error']('[%s][CLOSE]\x20%s',_0x4ed571,JSON[_0xf0f9('0x15')](_0x334c39));_0x53d1e7['stop']();}};};
\ No newline at end of file