Built motion from commit 1fd437e9.|2.6.19
[motion2.git] / server / services / routing / server / applications / close.js
index 09e7ba8..020321b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5574=['Interaction','interaction','then','info','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','system','channel'];(function(_0x422162,_0x159c4c){var _0x5af2f8=function(_0x46f5ad){while(--_0x46f5ad){_0x422162['push'](_0x422162['shift']());}};_0x5af2f8(++_0x159c4c);}(_0x5574,0xe6));var _0x4557=function(_0x29fdd7,_0x252b01){_0x29fdd7=_0x29fdd7-0x0;var _0x53357a=_0x5574[_0x29fdd7];return _0x53357a;};'use strict';var moment=require(_0x4557('0x0'));var logger=require('../../../../config/logger')(_0x4557('0x1'));var rpc={'chatInteraction':require(_0x4557('0x2')),'openchannelInteraction':require(_0x4557('0x3')),'smsInteraction':require(_0x4557('0x4')),'mailInteraction':require(_0x4557('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x4557('0x6'))};exports[_0x4557('0x7')]=function(_0x362251,_0xf6383c,_0x42dcc2,_0x2ab204){return function(_0xf347b6){try{logger['info'](_0x4557('0x8'),_0x362251,_0xf6383c[0x0]);var _0x32fb4f={'closed':0x1,'closedAt':moment()[_0x4557('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x4557('0xa'),'disposition':_0xf6383c[0x0]};if(rpc[_0x2ab204[_0x4557('0xb')]+'Interaction']){rpc[_0x2ab204[_0x4557('0xb')]+_0x4557('0xc')]['update'](_0x2ab204[_0x4557('0xd')]['id'],_0x32fb4f)[_0x4557('0xe')](function(_0x419573){logger[_0x4557('0xf')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x362251,_0x2ab204[_0x4557('0xd')]['id']);})[_0x4557('0x10')](function(_0x18888a){logger[_0x4557('0x11')](_0x4557('0x12'),_0x362251,JSON['stringify'](_0x18888a));})[_0x4557('0x13')](function(){_0xf347b6['stop']();});}}catch(_0x57a93a){logger[_0x4557('0x11')](_0x4557('0x12'),_0x362251,JSON[_0x4557('0x14')](_0x57a93a));_0xf347b6[_0x4557('0x15')]();}};};
\ No newline at end of file
+var _0x6895=['../../rpc/whatsappInteraction','consequence','info','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction'];(function(_0x119ef1,_0x14d235){var _0x1e60bb=function(_0x28d0e1){while(--_0x28d0e1){_0x119ef1['push'](_0x119ef1['shift']());}};_0x1e60bb(++_0x14d235);}(_0x6895,0x175));var _0x5689=function(_0x43e61d,_0x27d424){_0x43e61d=_0x43e61d-0x0;var _0x3a9d5b=_0x6895[_0x43e61d];return _0x3a9d5b;};'use strict';var moment=require(_0x5689('0x0'));var logger=require('../../../../config/logger')(_0x5689('0x1'));var rpc={'chatInteraction':require(_0x5689('0x2')),'openchannelInteraction':require(_0x5689('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x5689('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x5689('0x5'))};exports[_0x5689('0x6')]=function(_0xb8ddb5,_0x1907dc,_0x1c99fa,_0x4e3997){return function(_0x109a2a){try{logger[_0x5689('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0xb8ddb5,_0x1907dc[0x0]);var _0x557628={'closed':0x1,'closedAt':moment()['format'](_0x5689('0x8')),'closeReason':'system','disposition':_0x1907dc[0x0]};if(rpc[_0x4e3997[_0x5689('0x9')]+_0x5689('0xa')]){rpc[_0x4e3997['channel']+_0x5689('0xa')][_0x5689('0xb')](_0x4e3997[_0x5689('0xc')]['id'],_0x557628)['then'](function(_0x43bd12){logger[_0x5689('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xb8ddb5,_0x4e3997[_0x5689('0xc')]['id']);})[_0x5689('0xd')](function(_0x478d49){logger['error'](_0x5689('0xe'),_0xb8ddb5,JSON[_0x5689('0xf')](_0x478d49));})[_0x5689('0x10')](function(){_0x109a2a[_0x5689('0x11')]();});}}catch(_0x32be0f){logger['error'](_0x5689('0xe'),_0xb8ddb5,JSON[_0x5689('0xf')](_0x32be0f));_0x109a2a[_0x5689('0x11')]();}};};
\ No newline at end of file