355d53df4ea280a64b63ea26d90cc360a85b4ba2
[motion2.git] / server / services / ami / dialer / agentComplete.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 _0x991a=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','scheduledat','type','campaigntype','countbusyretry'];(function(_0x378752,_0x158b32){var _0xd5a262=function(_0x3c6f94){while(--_0x3c6f94){_0x378752['push'](_0x378752['shift']());}};_0xd5a262(++_0x158b32);}(_0x991a,0x1c1));var _0xa991=function(_0x2a341e,_0x515d38){_0x2a341e=_0x2a341e-0x0;var _0x211412=_0x991a[_0x2a341e];return _0x211412;};'use strict';var util=require(_0xa991('0x0'));var _=require(_0xa991('0x1'));var moment=require(_0xa991('0x2'));function getSeconds(_0x4ee072,_0xee3a50){var _0x59cd57=moment(_0x4ee072)[_0xa991('0x3')](0x0);var _0x48052f=moment(_0xee3a50)[_0xa991('0x3')](0x0);return _0x59cd57[_0xa991('0x4')](_0x48052f,_0xa991('0x5'));}function AgentComplete(_0x15029e,_0x5ca732){this[_0xa991('0x6')]=0x4;this['statedesc']='Answer';this[_0xa991('0x7')]=_0x15029e['scheduledat'];this[_0xa991('0x8')]=_0x15029e['type'];this[_0xa991('0x9')]=_0x15029e[_0xa991('0x8')]==='outbound'?'queue':_0x15029e[_0xa991('0x8')];this[_0xa991('0xa')]=_0x15029e[_0xa991('0xa')];this[_0xa991('0xb')]=_0x15029e['countcongestionretry'];this[_0xa991('0xc')]=_0x15029e[_0xa991('0xc')];this[_0xa991('0xd')]=_0x15029e[_0xa991('0xa')]+_0x15029e[_0xa991('0xb')]+_0x15029e[_0xa991('0xc')]+_0x15029e[_0xa991('0xe')]+_0x15029e['countdropretry']+_0x15029e[_0xa991('0xf')]+_0x15029e[_0xa991('0x10')]+_0x15029e[_0xa991('0x11')];this[_0xa991('0xe')]=_0x15029e[_0xa991('0xe')];this[_0xa991('0x12')]=_0x15029e[_0xa991('0x12')];this[_0xa991('0xf')]=_0x15029e[_0xa991('0xf')];this[_0xa991('0x10')]=_0x15029e[_0xa991('0x10')];this[_0xa991('0x11')]=_0x15029e[_0xa991('0x11')];this['uniqueid']=_0x5ca732[_0xa991('0x13')];this[_0xa991('0x14')]=_0x15029e[_0xa991('0x15')];this[_0xa991('0x16')]=_0x15029e[_0xa991('0x17')];this[_0xa991('0x18')]=_0x15029e[_0xa991('0x18')];this[_0xa991('0x19')]=_0x15029e[_0xa991('0x19')];this[_0xa991('0x1a')]=_0x15029e['answertime'];this['endtime']=moment()[_0xa991('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa991('0x1c')]=getSeconds(_0x15029e['responsetime'],_0x15029e['starttime']);this[_0xa991('0x1d')]=getSeconds(_0x15029e['answertime'],_0x15029e['responsetime']);this[_0xa991('0x1e')]=getSeconds(this['endtime'],_0x15029e[_0xa991('0x1a')]);this[_0xa991('0x1f')]=_0x5ca732['queue'];this[_0xa991('0x20')]=_0x5ca732[_0xa991('0x20')];this['reason']=_0x5ca732[_0xa991('0x21')];this['callback']=_0x15029e[_0xa991('0x22')];this[_0xa991('0x23')]=_0x15029e[_0xa991('0x23')];this[_0xa991('0x24')]=_0x15029e[_0xa991('0x24')];this[_0xa991('0x25')]=_0x15029e[_0xa991('0x25')];this[_0xa991('0x26')]=_0x15029e[_0xa991('0x26')];this[_0xa991('0x27')]=_0x15029e[_0xa991('0x27')];this[_0xa991('0x28')]=_0x15029e[_0xa991('0x28')];this[_0xa991('0x29')]=_0x15029e['VoiceQueueId'];this[_0xa991('0x2a')]=_0x15029e[_0xa991('0x2a')];this[_0xa991('0x2b')]=_0x15029e[_0xa991('0x2b')]||'';this[_0xa991('0x2c')]=_0x15029e[_0xa991('0x2c')]||'';}module[_0xa991('0x2d')]=AgentComplete;