Built motion from commit ff78e754.|2.6.29
[motion2.git] / server / services / routing / server / applications / close.js
index bce8414..903dbac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ad=['interaction','catch','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','then','info'];(function(_0x3b9028,_0x57ac10){var _0x4106bd=function(_0x431d03){while(--_0x431d03){_0x3b9028['push'](_0x3b9028['shift']());}};_0x4106bd(++_0x57ac10);}(_0x32ad,0xba));var _0xd32a=function(_0x3c5797,_0x3b59e2){_0x3c5797=_0x3c5797-0x0;var _0x49798d=_0x32ad[_0x3c5797];return _0x49798d;};'use strict';var moment=require(_0xd32a('0x0'));var logger=require(_0xd32a('0x1'))('routing');var rpc={'chatInteraction':require(_0xd32a('0x2')),'openchannelInteraction':require(_0xd32a('0x3')),'smsInteraction':require(_0xd32a('0x4')),'mailInteraction':require(_0xd32a('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xd32a('0x6'))};exports[_0xd32a('0x7')]=function(_0x427ef2,_0x598a42,_0x3cd3fc,_0x585a35){return function(_0x4d9d4a){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x427ef2,_0x598a42[0x0]);var _0x4e417a={'closed':0x1,'closedAt':moment()['format'](_0xd32a('0x8')),'closeReason':_0xd32a('0x9'),'disposition':_0x598a42[0x0]};if(rpc[_0x585a35[_0xd32a('0xa')]+'Interaction']){rpc[_0x585a35[_0xd32a('0xa')]+_0xd32a('0xb')]['update'](_0x585a35['interaction']['id'],_0x4e417a)[_0xd32a('0xc')](function(_0x11712b){logger[_0xd32a('0xd')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x427ef2,_0x585a35[_0xd32a('0xe')]['id']);})[_0xd32a('0xf')](function(_0x2e50c2){logger['error']('[%s][CLOSE]\x20%s',_0x427ef2,JSON[_0xd32a('0x10')](_0x2e50c2));})[_0xd32a('0x11')](function(){_0x4d9d4a[_0xd32a('0x12')]();});}}catch(_0x1b4b01){logger['error'](_0xd32a('0x13'),_0x427ef2,JSON[_0xd32a('0x10')](_0x1b4b01));_0x4d9d4a[_0xd32a('0x12')]();}};};
\ No newline at end of file
+var _0x7b87=['interaction','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','YYYY-MM-DD\x20HH:mm:ss','system','channel','update','then','info'];(function(_0x2eda69,_0x17a570){var _0x1df0d9=function(_0x39e509){while(--_0x39e509){_0x2eda69['push'](_0x2eda69['shift']());}};_0x1df0d9(++_0x17a570);}(_0x7b87,0x9a));var _0x77b8=function(_0x223f38,_0x4ece37){_0x223f38=_0x223f38-0x0;var _0x4f18b7=_0x7b87[_0x223f38];return _0x4f18b7;};'use strict';var moment=require(_0x77b8('0x0'));var logger=require(_0x77b8('0x1'))(_0x77b8('0x2'));var rpc={'chatInteraction':require(_0x77b8('0x3')),'openchannelInteraction':require(_0x77b8('0x4')),'smsInteraction':require(_0x77b8('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x77b8('0x6'))};exports[_0x77b8('0x7')]=function(_0xa58adb,_0x560d49,_0x3a9321,_0x94e962){return function(_0x486a59){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0xa58adb,_0x560d49[0x0]);var _0x12b6dc={'closed':0x1,'closedAt':moment()['format'](_0x77b8('0x8')),'closeReason':_0x77b8('0x9'),'disposition':_0x560d49[0x0]};if(rpc[_0x94e962[_0x77b8('0xa')]+'Interaction']){rpc[_0x94e962[_0x77b8('0xa')]+'Interaction'][_0x77b8('0xb')](_0x94e962['interaction']['id'],_0x12b6dc)[_0x77b8('0xc')](function(_0x404069){logger[_0x77b8('0xd')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xa58adb,_0x94e962[_0x77b8('0xe')]['id']);})[_0x77b8('0xf')](function(_0x366cee){logger[_0x77b8('0x10')](_0x77b8('0x11'),_0xa58adb,JSON['stringify'](_0x366cee));})[_0x77b8('0x12')](function(){_0x486a59[_0x77b8('0x13')]();});}}catch(_0x24a761){logger['error']('[%s][CLOSE]\x20%s',_0xa58adb,JSON[_0x77b8('0x14')](_0x24a761));_0x486a59[_0x77b8('0x13')]();}};};
\ No newline at end of file