Built motion from commit ddca4d0d.|2.5.47
[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 _0x998b=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','name','number','answertime','endtime','format','ringtime','starttime','holdtime','responsetime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x13a330,_0x26b966){var _0x3927ec=function(_0x3a6eec){while(--_0x3a6eec){_0x13a330['push'](_0x13a330['shift']());}};_0x3927ec(++_0x26b966);}(_0x998b,0xa5));var _0xb998=function(_0x2111c8,_0x2b959c){_0x2111c8=_0x2111c8-0x0;var _0x4465e2=_0x998b[_0x2111c8];return _0x4465e2;};'use strict';var util=require(_0xb998('0x0'));var _=require(_0xb998('0x1'));var moment=require(_0xb998('0x2'));function getSeconds(_0x568c9e,_0x588f3e){var _0x2546f6=moment(_0x568c9e)['milliseconds'](0x0);var _0x30adab=moment(_0x588f3e)[_0xb998('0x3')](0x0);return _0x2546f6[_0xb998('0x4')](_0x30adab,_0xb998('0x5'));}function AgentComplete(_0x1b9c66,_0x51d3bd){this[_0xb998('0x6')]=0x4;this[_0xb998('0x7')]=_0xb998('0x8');this[_0xb998('0x9')]=_0x1b9c66['scheduledat'];this['type']=_0x1b9c66[_0xb998('0xa')];this[_0xb998('0xb')]=_0x1b9c66['type']===_0xb998('0xc')?_0xb998('0xd'):_0x1b9c66['type'];this[_0xb998('0xe')]=_0x1b9c66[_0xb998('0xe')];this['countcongestionretry']=_0x1b9c66[_0xb998('0xf')];this[_0xb998('0x10')]=_0x1b9c66[_0xb998('0x10')];this['countglobal']=_0x1b9c66[_0xb998('0xe')]+_0x1b9c66['countcongestionretry']+_0x1b9c66[_0xb998('0x10')]+_0x1b9c66[_0xb998('0x11')]+_0x1b9c66[_0xb998('0x12')]+_0x1b9c66['countabandonedretry']+_0x1b9c66[_0xb998('0x13')]+_0x1b9c66['countagentrejectretry'];this[_0xb998('0x11')]=_0x1b9c66['countnosuchnumberretry'];this[_0xb998('0x12')]=_0x1b9c66[_0xb998('0x12')];this[_0xb998('0x14')]=_0x1b9c66['countabandonedretry'];this[_0xb998('0x13')]=_0x1b9c66['countmachineretry'];this[_0xb998('0x15')]=_0x1b9c66[_0xb998('0x15')];this[_0xb998('0x16')]=_0x51d3bd[_0xb998('0x16')];this['calleridname']=_0x1b9c66[_0xb998('0x17')];this['calleridnum']=_0x1b9c66[_0xb998('0x18')];this['starttime']=_0x1b9c66['starttime'];this['responsetime']=_0x1b9c66['responsetime'];this[_0xb998('0x19')]=_0x1b9c66['answertime'];this[_0xb998('0x1a')]=moment()[_0xb998('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb998('0x1c')]=getSeconds(_0x1b9c66['responsetime'],_0x1b9c66[_0xb998('0x1d')]);this[_0xb998('0x1e')]=getSeconds(_0x1b9c66[_0xb998('0x19')],_0x1b9c66[_0xb998('0x1f')]);this['talktime']=getSeconds(this[_0xb998('0x1a')],_0x1b9c66[_0xb998('0x19')]);this[_0xb998('0xd')]=_0x51d3bd[_0xb998('0xd')];this[_0xb998('0x20')]=_0x51d3bd[_0xb998('0x20')];this['reason']=_0x51d3bd['reason'];this[_0xb998('0x21')]=_0x1b9c66['callback'];this['callbackuniqueid']=_0x1b9c66[_0xb998('0x22')];this[_0xb998('0x23')]=_0x1b9c66[_0xb998('0x23')];this[_0xb998('0x24')]=_0x1b9c66[_0xb998('0x24')];this[_0xb998('0x25')]=_0x1b9c66[_0xb998('0x25')];this[_0xb998('0x26')]=_0x1b9c66[_0xb998('0x26')];this['UserId']=_0x1b9c66[_0xb998('0x27')];this[_0xb998('0x28')]=_0x1b9c66[_0xb998('0x28')];this[_0xb998('0x29')]=_0x1b9c66[_0xb998('0x29')];this[_0xb998('0x2a')]=_0x1b9c66[_0xb998('0x2a')]||'';this[_0xb998('0x2b')]=_0x1b9c66[_0xb998('0x2b')]||'';}module[_0xb998('0x2c')]=AgentComplete;