Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / services / routing / server / applications / close.js
index 0e1d2f3..665949d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4cb=['[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0xb4cb,0x174));var _0xbb4c=function(_0x1d244d,_0xd816e0){_0x1d244d=_0x1d244d-0x0;var _0x31d301=_0xb4cb[_0x1d244d];return _0x31d301;};'use strict';var moment=require(_0xbb4c('0x0'));var logger=require(_0xbb4c('0x1'))(_0xbb4c('0x2'));var rpc={'chatInteraction':require(_0xbb4c('0x3')),'openchannelInteraction':require(_0xbb4c('0x4')),'smsInteraction':require(_0xbb4c('0x5')),'mailInteraction':require(_0xbb4c('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xbb4c('0x7'))};exports[_0xbb4c('0x8')]=function(_0x286812,_0x5911fd,_0x625220,_0x461779){return function(_0x530ea6){try{logger['info'](_0xbb4c('0x9'),_0x286812,_0x5911fd[0x0]);var _0x264296={'closed':0x1,'closedAt':moment()[_0xbb4c('0xa')](_0xbb4c('0xb')),'closeReason':'system','disposition':_0x5911fd[0x0]};if(rpc[_0x461779[_0xbb4c('0xc')]+_0xbb4c('0xd')]){rpc[_0x461779['channel']+_0xbb4c('0xd')][_0xbb4c('0xe')](_0x461779['interaction']['id'],_0x264296)[_0xbb4c('0xf')](function(_0x18ce2e){logger['info'](_0xbb4c('0x10'),_0x286812,_0x461779['interaction']['id']);})[_0xbb4c('0x11')](function(_0x3f29d6){logger[_0xbb4c('0x12')](_0xbb4c('0x13'),_0x286812,JSON['stringify'](_0x3f29d6));})[_0xbb4c('0x14')](function(){_0x530ea6[_0xbb4c('0x15')]();});}}catch(_0x20701a){logger[_0xbb4c('0x12')](_0xbb4c('0x13'),_0x286812,JSON[_0xbb4c('0x16')](_0x20701a));_0x530ea6[_0xbb4c('0x15')]();}};};
\ No newline at end of file
+var _0x4b52=['stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0xd7e7b3,_0x3b3b7b){var _0x3e166b=function(_0x5caecf){while(--_0x5caecf){_0xd7e7b3['push'](_0xd7e7b3['shift']());}};_0x3e166b(++_0x3b3b7b);}(_0x4b52,0x8b));var _0x24b5=function(_0x14895b,_0x45351f){_0x14895b=_0x14895b-0x0;var _0x10fd2e=_0x4b52[_0x14895b];return _0x10fd2e;};'use strict';var moment=require('moment');var logger=require(_0x24b5('0x0'))(_0x24b5('0x1'));var rpc={'chatInteraction':require(_0x24b5('0x2')),'openchannelInteraction':require(_0x24b5('0x3')),'smsInteraction':require(_0x24b5('0x4')),'mailInteraction':require(_0x24b5('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x24b5('0x6'))};exports[_0x24b5('0x7')]=function(_0x4d2681,_0x27a1bb,_0x284d2c,_0x4e24d6){return function(_0x58740e){try{logger[_0x24b5('0x8')](_0x24b5('0x9'),_0x4d2681,_0x27a1bb[0x0]);var _0x40e1fd={'closed':0x1,'closedAt':moment()[_0x24b5('0xa')](_0x24b5('0xb')),'closeReason':_0x24b5('0xc'),'disposition':_0x27a1bb[0x0]};if(rpc[_0x4e24d6['channel']+_0x24b5('0xd')]){rpc[_0x4e24d6[_0x24b5('0xe')]+_0x24b5('0xd')]['update'](_0x4e24d6[_0x24b5('0xf')]['id'],_0x40e1fd)['then'](function(_0x2d9637){logger[_0x24b5('0x8')](_0x24b5('0x10'),_0x4d2681,_0x4e24d6['interaction']['id']);})[_0x24b5('0x11')](function(_0x3d952e){logger[_0x24b5('0x12')](_0x24b5('0x13'),_0x4d2681,JSON[_0x24b5('0x14')](_0x3d952e));})[_0x24b5('0x15')](function(){_0x58740e[_0x24b5('0x16')]();});}}catch(_0x495a65){logger[_0x24b5('0x12')]('[%s][CLOSE]\x20%s',_0x4d2681,JSON[_0x24b5('0x14')](_0x495a65));_0x58740e[_0x24b5('0x16')]();}};};
\ No newline at end of file