Built motion from commit 67e5df37.|2.0.66
[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 _0x7a80=['../../rpc/smsInteraction','../../rpc/mailInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','../../../../config/logger','routing','../../rpc/chatInteraction'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x7a80,0x179));var _0x07a8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7a80[_0x4a9fb1];return _0x348672;};'use strict';var moment=require('moment');var logger=require(_0x07a8('0x0'))(_0x07a8('0x1'));var rpc={'chatInteraction':require(_0x07a8('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x07a8('0x3')),'mailInteraction':require(_0x07a8('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};exports['consequence']=function(_0x435809,_0x33e348,_0x4782f1,_0x120e3c){return function(_0x21ad43){try{logger[_0x07a8('0x5')](_0x07a8('0x6'),_0x435809,_0x33e348[0x0]);var _0x5bc8f2={'closed':0x1,'closedAt':moment()[_0x07a8('0x7')](_0x07a8('0x8')),'disposition':_0x33e348[0x0]};if(rpc[_0x120e3c[_0x07a8('0x9')]+_0x07a8('0xa')]){rpc[_0x120e3c[_0x07a8('0x9')]+_0x07a8('0xa')][_0x07a8('0xb')](_0x120e3c['interaction']['id'],_0x5bc8f2)[_0x07a8('0xc')](function(_0x1f6095){logger['info'](_0x07a8('0xd'),_0x435809,_0x120e3c[_0x07a8('0xe')]['id']);})[_0x07a8('0xf')](function(_0xd24ffb){logger[_0x07a8('0x10')](_0x07a8('0x11'),_0x435809,JSON[_0x07a8('0x12')](_0xd24ffb));})[_0x07a8('0x13')](function(){_0x21ad43['stop']();});}}catch(_0x1dc59c){logger[_0x07a8('0x10')](_0x07a8('0x11'),_0x435809,JSON[_0x07a8('0x12')](_0x1dc59c));_0x21ad43['stop']();}};};