Built motion from commit (unavailable).|2.4.10
[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 _0x2deb=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','format','system','channel','Interaction'];(function(_0x24e299,_0x3e50c9){var _0x39554e=function(_0x4c6217){while(--_0x4c6217){_0x24e299['push'](_0x24e299['shift']());}};_0x39554e(++_0x3e50c9);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xb2de('0x0'));var logger=require(_0xb2de('0x1'))(_0xb2de('0x2'));var rpc={'chatInteraction':require(_0xb2de('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb2de('0x4')),'faxInteraction':require(_0xb2de('0x5'))};exports[_0xb2de('0x6')]=function(_0x27a59b,_0x59f7e9,_0x574a20,_0x201fcc){return function(_0x2ed8ec){try{logger[_0xb2de('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x27a59b,_0x59f7e9[0x0]);var _0x253d0b={'closed':0x1,'closedAt':moment()[_0xb2de('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xb2de('0x9'),'disposition':_0x59f7e9[0x0]};if(rpc[_0x201fcc[_0xb2de('0xa')]+_0xb2de('0xb')]){rpc[_0x201fcc['channel']+_0xb2de('0xb')][_0xb2de('0xc')](_0x201fcc[_0xb2de('0xd')]['id'],_0x253d0b)[_0xb2de('0xe')](function(_0x5dc248){logger['info'](_0xb2de('0xf'),_0x27a59b,_0x201fcc[_0xb2de('0xd')]['id']);})[_0xb2de('0x10')](function(_0x4c8d35){logger[_0xb2de('0x11')](_0xb2de('0x12'),_0x27a59b,JSON[_0xb2de('0x13')](_0x4c8d35));})['finally'](function(){_0x2ed8ec[_0xb2de('0x14')]();});}}catch(_0x48492b){logger[_0xb2de('0x11')]('[%s][CLOSE]\x20%s',_0x27a59b,JSON[_0xb2de('0x13')](_0x48492b));_0x2ed8ec[_0xb2de('0x14')]();}};};