Built motion from commit bfc7a72f7045b27461c9a5d1f71c1a658cfd0b8b. Version 3.0.0...
[motion-next.git] / server / services / routing / server / applications / close.js
1 const a1203_0x35ac=['update','../../rpc/smsInteraction','catch','interaction','error','[%s][CLOSE]\x20%s','stop','YYYY-MM-DD\x20HH:mm:ss','[%s][CLOSE]\x20reason\x20%s','../../rpc/openchannelInteraction','then','stringify','Interaction','../../rpc/whatsappInteraction','routing','../../../../config/logger','../../rpc/mailInteraction','info','../../rpc/faxInteraction','moment','channel','../../rpc/chatInteraction'];(function(_0x26469e,_0x35ac99){const _0x5f3555=function(_0x56ee12){while(--_0x56ee12){_0x26469e['push'](_0x26469e['shift']());}};_0x5f3555(++_0x35ac99);}(a1203_0x35ac,0x169));const a1203_0x5f35=function(_0x26469e,_0x35ac99){_0x26469e=_0x26469e-0x0;let _0x5f3555=a1203_0x35ac[_0x26469e];return _0x5f3555;};const _0x3a179c=a1203_0x5f35;'use strict';const moment=require(_0x3a179c('0xa')),logger=require(_0x3a179c('0x6'))(_0x3a179c('0x5')),rpc={'chatInteraction':require(_0x3a179c('0xc')),'openchannelInteraction':require(_0x3a179c('0x0')),'smsInteraction':require(_0x3a179c('0xe')),'mailInteraction':require(_0x3a179c('0x7')),'faxInteraction':require(_0x3a179c('0x9')),'whatsappInteraction':require(_0x3a179c('0x4'))};exports['consequence']=function(_0x56ee12,_0x16ff3d,_0x33e025,_0x1934f8){return function(_0x5546c6){const _0x1c9481=a1203_0x5f35;try{logger[_0x1c9481('0x8')](_0x1c9481('0x15'),_0x56ee12,_0x16ff3d[0x0]);const _0xc0dda4={'closed':0x1,'closedAt':moment()['format'](_0x1c9481('0x14')),'closeReason':'system','disposition':_0x16ff3d[0x0]};rpc[_0x1934f8[_0x1c9481('0xb')]+_0x1c9481('0x3')]&&rpc[_0x1934f8['channel']+_0x1c9481('0x3')][_0x1c9481('0xd')](_0x1934f8['interaction']['id'],_0xc0dda4)[_0x1c9481('0x1')](function(){const _0x5adb37=_0x1c9481;logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x56ee12,_0x1934f8[_0x5adb37('0x10')]['id']);})[_0x1c9481('0xf')](function(_0x4a1d48){const _0x34b60a=_0x1c9481;logger[_0x34b60a('0x11')](_0x34b60a('0x12'),_0x56ee12,JSON[_0x34b60a('0x2')](_0x4a1d48));})['finally'](function(){const _0x2371d8=_0x1c9481;_0x5546c6[_0x2371d8('0x13')]();});}catch(_0x2d3296){logger[_0x1c9481('0x11')](_0x1c9481('0x12'),_0x56ee12,JSON[_0x1c9481('0x2')](_0x2d3296)),_0x5546c6[_0x1c9481('0x13')]();}};};