Built motion from commit 932cf0d0.|2.5.42
[motion2.git] / server / services / routing / server / applications / close.js
index 37b73b6..9ab368f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeeb3=['[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info'];(function(_0x3b4137,_0x46c8b5){var _0x578ed4=function(_0x24511c){while(--_0x24511c){_0x3b4137['push'](_0x3b4137['shift']());}};_0x578ed4(++_0x46c8b5);}(_0xeeb3,0x1aa));var _0x3eeb=function(_0x4439f1,_0x57d122){_0x4439f1=_0x4439f1-0x0;var _0x24d0a6=_0xeeb3[_0x4439f1];return _0x24d0a6;};'use strict';var moment=require('moment');var logger=require(_0x3eeb('0x0'))('routing');var rpc={'chatInteraction':require(_0x3eeb('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x3eeb('0x2')),'mailInteraction':require(_0x3eeb('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x3eeb('0x4'))};exports['consequence']=function(_0x45c939,_0x1a97d4,_0x1a3357,_0x3bb9a1){return function(_0x2b3389){try{logger[_0x3eeb('0x5')](_0x3eeb('0x6'),_0x45c939,_0x1a97d4[0x0]);var _0x25864a={'closed':0x1,'closedAt':moment()[_0x3eeb('0x7')](_0x3eeb('0x8')),'closeReason':'system','disposition':_0x1a97d4[0x0]};if(rpc[_0x3bb9a1[_0x3eeb('0x9')]+_0x3eeb('0xa')]){rpc[_0x3bb9a1[_0x3eeb('0x9')]+'Interaction'][_0x3eeb('0xb')](_0x3bb9a1[_0x3eeb('0xc')]['id'],_0x25864a)['then'](function(_0x43b01c){logger['info'](_0x3eeb('0xd'),_0x45c939,_0x3bb9a1['interaction']['id']);})[_0x3eeb('0xe')](function(_0x314ac3){logger['error'](_0x3eeb('0xf'),_0x45c939,JSON[_0x3eeb('0x10')](_0x314ac3));})['finally'](function(){_0x2b3389[_0x3eeb('0x11')]();});}}catch(_0x46638a){logger['error'](_0x3eeb('0xf'),_0x45c939,JSON[_0x3eeb('0x10')](_0x46638a));_0x2b3389[_0x3eeb('0x11')]();}};};
\ No newline at end of file
+var _0x8f76=['routing','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger'];(function(_0x5d81fc,_0x2df17e){var _0xd507d7=function(_0x1152f9){while(--_0x1152f9){_0x5d81fc['push'](_0x5d81fc['shift']());}};_0xd507d7(++_0x2df17e);}(_0x8f76,0x136));var _0x68f7=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x8f76[_0x4dbaad];return _0x226c72;};'use strict';var moment=require(_0x68f7('0x0'));var logger=require(_0x68f7('0x1'))(_0x68f7('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x68f7('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x68f7('0x4')),'faxInteraction':require(_0x68f7('0x5')),'whatsappInteraction':require(_0x68f7('0x6'))};exports[_0x68f7('0x7')]=function(_0x197ea7,_0x2bd715,_0xef380c,_0x1ad3b9){return function(_0x4b6437){try{logger[_0x68f7('0x8')](_0x68f7('0x9'),_0x197ea7,_0x2bd715[0x0]);var _0x5da380={'closed':0x1,'closedAt':moment()[_0x68f7('0xa')](_0x68f7('0xb')),'closeReason':_0x68f7('0xc'),'disposition':_0x2bd715[0x0]};if(rpc[_0x1ad3b9[_0x68f7('0xd')]+'Interaction']){rpc[_0x1ad3b9['channel']+_0x68f7('0xe')][_0x68f7('0xf')](_0x1ad3b9['interaction']['id'],_0x5da380)['then'](function(_0x43d9eb){logger['info'](_0x68f7('0x10'),_0x197ea7,_0x1ad3b9[_0x68f7('0x11')]['id']);})[_0x68f7('0x12')](function(_0x11330a){logger['error'](_0x68f7('0x13'),_0x197ea7,JSON[_0x68f7('0x14')](_0x11330a));})[_0x68f7('0x15')](function(){_0x4b6437[_0x68f7('0x16')]();});}}catch(_0x482f36){logger[_0x68f7('0x17')]('[%s][CLOSE]\x20%s',_0x197ea7,JSON['stringify'](_0x482f36));_0x4b6437[_0x68f7('0x16')]();}};};
\ No newline at end of file