Built motion from commit 838c2833.|2.6.24
[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 _0x4b2f=['Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','error','[%s][CLOSE]\x20%s','stringify','finally','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel'];(function(_0x238a77,_0x30091f){var _0x18af68=function(_0x2aeec5){while(--_0x2aeec5){_0x238a77['push'](_0x238a77['shift']());}};_0x18af68(++_0x30091f);}(_0x4b2f,0x111));var _0xf4b2=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x4b2f[_0x223461];return _0x4dbe0a;};'use strict';var moment=require(_0xf4b2('0x0'));var logger=require(_0xf4b2('0x1'))(_0xf4b2('0x2'));var rpc={'chatInteraction':require(_0xf4b2('0x3')),'openchannelInteraction':require(_0xf4b2('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xf4b2('0x5')),'faxInteraction':require(_0xf4b2('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xf4b2('0x7')]=function(_0x504784,_0x4f8075,_0x38cf09,_0x1ef9a9){return function(_0x12ee90){try{logger[_0xf4b2('0x8')](_0xf4b2('0x9'),_0x504784,_0x4f8075[0x0]);var _0x36c0f3={'closed':0x1,'closedAt':moment()[_0xf4b2('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xf4b2('0xb'),'disposition':_0x4f8075[0x0]};if(rpc[_0x1ef9a9[_0xf4b2('0xc')]+_0xf4b2('0xd')]){rpc[_0x1ef9a9['channel']+_0xf4b2('0xd')][_0xf4b2('0xe')](_0x1ef9a9['interaction']['id'],_0x36c0f3)[_0xf4b2('0xf')](function(_0x10e54f){logger[_0xf4b2('0x8')](_0xf4b2('0x10'),_0x504784,_0x1ef9a9[_0xf4b2('0x11')]['id']);})['catch'](function(_0x2d3c17){logger[_0xf4b2('0x12')](_0xf4b2('0x13'),_0x504784,JSON[_0xf4b2('0x14')](_0x2d3c17));})[_0xf4b2('0x15')](function(){_0x12ee90['stop']();});}}catch(_0x4fff34){logger[_0xf4b2('0x12')](_0xf4b2('0x13'),_0x504784,JSON[_0xf4b2('0x14')](_0x4fff34));_0x12ee90['stop']();}};};