1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x18ce=['info','[%s][CLOSE]\x20reason\x20%s','format','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence'];(function(_0x1c60b8,_0x6057d7){var _0x353e96=function(_0x192263){while(--_0x192263){_0x1c60b8['push'](_0x1c60b8['shift']());}};_0x353e96(++_0x6057d7);}(_0x18ce,0x173));var _0xe18c=function(_0x1acd8b,_0x8364af){_0x1acd8b=_0x1acd8b-0x0;var _0xbb8118=_0x18ce[_0x1acd8b];return _0xbb8118;};'use strict';var moment=require(_0xe18c('0x0'));var logger=require(_0xe18c('0x1'))('routing');var rpc={'chatInteraction':require(_0xe18c('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xe18c('0x3')),'mailInteraction':require(_0xe18c('0x4')),'faxInteraction':require(_0xe18c('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xe18c('0x6')]=function(_0x499375,_0x35eb9c,_0x1a1bed,_0x5628aa){return function(_0x3b9cfb){try{logger[_0xe18c('0x7')](_0xe18c('0x8'),_0x499375,_0x35eb9c[0x0]);var _0x37cdc7={'closed':0x1,'closedAt':moment()[_0xe18c('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x35eb9c[0x0]};if(rpc[_0x5628aa[_0xe18c('0xa')]+_0xe18c('0xb')]){rpc[_0x5628aa[_0xe18c('0xa')]+_0xe18c('0xb')][_0xe18c('0xc')](_0x5628aa['interaction']['id'],_0x37cdc7)[_0xe18c('0xd')](function(_0x256f84){logger[_0xe18c('0x7')](_0xe18c('0xe'),_0x499375,_0x5628aa[_0xe18c('0xf')]['id']);})[_0xe18c('0x10')](function(_0x34e750){logger[_0xe18c('0x11')](_0xe18c('0x12'),_0x499375,JSON[_0xe18c('0x13')](_0x34e750));})[_0xe18c('0x14')](function(){_0x3b9cfb['stop']();});}}catch(_0x3d23d6){logger['error'](_0xe18c('0x12'),_0x499375,JSON[_0xe18c('0x13')](_0x3d23d6));_0x3b9cfb['stop']();}};};