Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / services / routing / server / applications / close.js
index b5e8e8e..b3e2977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x699f=['then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction'];(function(_0x31ffd9,_0x489004){var _0x58e3b6=function(_0x8255a8){while(--_0x8255a8){_0x31ffd9['push'](_0x31ffd9['shift']());}};_0x58e3b6(++_0x489004);}(_0x699f,0x6c));var _0xf699=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x699f[_0x37d3f3];return _0x185c9c;};'use strict';var moment=require(_0xf699('0x0'));var logger=require('../../../../config/logger')(_0xf699('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf699('0x2')),'smsInteraction':require(_0xf699('0x3')),'mailInteraction':require(_0xf699('0x4')),'faxInteraction':require(_0xf699('0x5')),'whatsappInteraction':require(_0xf699('0x6'))};exports[_0xf699('0x7')]=function(_0x1dcafe,_0x1d7c29,_0x2a4682,_0x1f99f7){return function(_0xa58e4){try{logger[_0xf699('0x8')](_0xf699('0x9'),_0x1dcafe,_0x1d7c29[0x0]);var _0x4a713e={'closed':0x1,'closedAt':moment()[_0xf699('0xa')](_0xf699('0xb')),'closeReason':_0xf699('0xc'),'disposition':_0x1d7c29[0x0]};if(rpc[_0x1f99f7[_0xf699('0xd')]+_0xf699('0xe')]){rpc[_0x1f99f7[_0xf699('0xd')]+_0xf699('0xe')][_0xf699('0xf')](_0x1f99f7[_0xf699('0x10')]['id'],_0x4a713e)[_0xf699('0x11')](function(_0xd76d9){logger[_0xf699('0x8')](_0xf699('0x12'),_0x1dcafe,_0x1f99f7['interaction']['id']);})[_0xf699('0x13')](function(_0x503d0b){logger[_0xf699('0x14')](_0xf699('0x15'),_0x1dcafe,JSON[_0xf699('0x16')](_0x503d0b));})[_0xf699('0x17')](function(){_0xa58e4[_0xf699('0x18')]();});}}catch(_0x3db2d0){logger[_0xf699('0x14')](_0xf699('0x15'),_0x1dcafe,JSON[_0xf699('0x16')](_0x3db2d0));_0xa58e4['stop']();}};};
\ No newline at end of file
+var _0x9e0f=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','format','system','channel','Interaction'];(function(_0x298b4e,_0x44a36f){var _0xfba485=function(_0x591ae2){while(--_0x591ae2){_0x298b4e['push'](_0x298b4e['shift']());}};_0xfba485(++_0x44a36f);}(_0x9e0f,0xbd));var _0xf9e0=function(_0x1d6317,_0x3ddfcb){_0x1d6317=_0x1d6317-0x0;var _0x244707=_0x9e0f[_0x1d6317];return _0x244707;};'use strict';var moment=require(_0xf9e0('0x0'));var logger=require(_0xf9e0('0x1'))(_0xf9e0('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf9e0('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xf9e0('0x4')),'faxInteraction':require(_0xf9e0('0x5')),'whatsappInteraction':require(_0xf9e0('0x6'))};exports['consequence']=function(_0x146f73,_0x5f2b56,_0x5f2c99,_0x2ce44a){return function(_0x666c4){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x146f73,_0x5f2b56[0x0]);var _0x4efb45={'closed':0x1,'closedAt':moment()[_0xf9e0('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xf9e0('0x8'),'disposition':_0x5f2b56[0x0]};if(rpc[_0x2ce44a[_0xf9e0('0x9')]+_0xf9e0('0xa')]){rpc[_0x2ce44a[_0xf9e0('0x9')]+_0xf9e0('0xa')][_0xf9e0('0xb')](_0x2ce44a[_0xf9e0('0xc')]['id'],_0x4efb45)[_0xf9e0('0xd')](function(_0x45bc23){logger['info'](_0xf9e0('0xe'),_0x146f73,_0x2ce44a[_0xf9e0('0xc')]['id']);})['catch'](function(_0x1e3e08){logger[_0xf9e0('0xf')](_0xf9e0('0x10'),_0x146f73,JSON['stringify'](_0x1e3e08));})[_0xf9e0('0x11')](function(){_0x666c4[_0xf9e0('0x12')]();});}}catch(_0x1b9547){logger['error'](_0xf9e0('0x10'),_0x146f73,JSON[_0xf9e0('0x13')](_0x1b9547));_0x666c4[_0xf9e0('0x12')]();}};};
\ No newline at end of file