Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / services / routing / server / applications / close.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x1fcc=['error','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch'];(function(_0x566147,_0x4f500f){var _0x213c3b=function(_0x2cb922){while(--_0x2cb922){_0x566147['push'](_0x566147['shift']());}};_0x213c3b(++_0x4f500f);}(_0x1fcc,0x125));var _0xc1fc=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x1fcc[_0x32c012];return _0x48562e;};'use strict';var moment=require(_0xc1fc('0x0'));var logger=require(_0xc1fc('0x1'))('routing');var rpc={'chatInteraction':require(_0xc1fc('0x2')),'openchannelInteraction':require(_0xc1fc('0x3')),'smsInteraction':require(_0xc1fc('0x4')),'mailInteraction':require(_0xc1fc('0x5')),'faxInteraction':require(_0xc1fc('0x6')),'whatsappInteraction':require(_0xc1fc('0x7'))};exports[_0xc1fc('0x8')]=function(_0x51605f,_0x205d03,_0x2fe1fc,_0x26899d){return function(_0x4df2ae){try{logger[_0xc1fc('0x9')](_0xc1fc('0xa'),_0x51605f,_0x205d03[0x0]);var _0x5ae7b3={'closed':0x1,'closedAt':moment()[_0xc1fc('0xb')](_0xc1fc('0xc')),'closeReason':'system','disposition':_0x205d03[0x0]};if(rpc[_0x26899d[_0xc1fc('0xd')]+'Interaction']){rpc[_0x26899d[_0xc1fc('0xd')]+_0xc1fc('0xe')]['update'](_0x26899d[_0xc1fc('0xf')]['id'],_0x5ae7b3)[_0xc1fc('0x10')](function(_0x2a1426){logger[_0xc1fc('0x9')](_0xc1fc('0x11'),_0x51605f,_0x26899d['interaction']['id']);})[_0xc1fc('0x12')](function(_0x10d1d3){logger[_0xc1fc('0x13')]('[%s][CLOSE]\x20%s',_0x51605f,JSON[_0xc1fc('0x14')](_0x10d1d3));})[_0xc1fc('0x15')](function(){_0x4df2ae[_0xc1fc('0x16')]();});}}catch(_0x52b0bb){logger[_0xc1fc('0x13')](_0xc1fc('0x17'),_0x51605f,JSON[_0xc1fc('0x14')](_0x52b0bb));_0x4df2ae[_0xc1fc('0x16')]();}};};