Built motion from commit b5413ace.|2.6.9
[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 _0x86ef=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x580bcd,_0x2bfa24){var _0x2b8c47=function(_0xa2695e){while(--_0xa2695e){_0x580bcd['push'](_0x580bcd['shift']());}};_0x2b8c47(++_0x2bfa24);}(_0x86ef,0x78));var _0xf86e=function(_0x22b1fe,_0x5834dc){_0x22b1fe=_0x22b1fe-0x0;var _0x1416d2=_0x86ef[_0x22b1fe];return _0x1416d2;};'use strict';var util=require(_0xf86e('0x0'));var _=require(_0xf86e('0x1'));var moment=require('moment');function getSeconds(_0x43d9c6,_0x4fa1d3){var _0x1257de=moment(_0x43d9c6)[_0xf86e('0x2')](0x0);var _0x493cba=moment(_0x4fa1d3)[_0xf86e('0x2')](0x0);return _0x1257de[_0xf86e('0x3')](_0x493cba,'seconds');}function AgentComplete(_0x2fe1ec,_0x236e32){this[_0xf86e('0x4')]=0x4;this[_0xf86e('0x5')]=_0xf86e('0x6');this[_0xf86e('0x7')]=_0x2fe1ec[_0xf86e('0x7')];this[_0xf86e('0x8')]=_0x2fe1ec[_0xf86e('0x8')];this[_0xf86e('0x9')]=_0x2fe1ec[_0xf86e('0x8')]==='outbound'?_0xf86e('0xa'):_0x2fe1ec[_0xf86e('0x8')];this['countbusyretry']=_0x2fe1ec[_0xf86e('0xb')];this['countcongestionretry']=_0x2fe1ec[_0xf86e('0xc')];this[_0xf86e('0xd')]=_0x2fe1ec[_0xf86e('0xd')];this[_0xf86e('0xe')]=_0x2fe1ec['countbusyretry']+_0x2fe1ec['countcongestionretry']+_0x2fe1ec['countnoanswerretry']+_0x2fe1ec['countnosuchnumberretry']+_0x2fe1ec['countdropretry']+_0x2fe1ec[_0xf86e('0xf')]+_0x2fe1ec[_0xf86e('0x10')]+_0x2fe1ec[_0xf86e('0x11')];this['countnosuchnumberretry']=_0x2fe1ec[_0xf86e('0x12')];this[_0xf86e('0x13')]=_0x2fe1ec[_0xf86e('0x13')];this[_0xf86e('0xf')]=_0x2fe1ec[_0xf86e('0xf')];this[_0xf86e('0x10')]=_0x2fe1ec[_0xf86e('0x10')];this['countagentrejectretry']=_0x2fe1ec[_0xf86e('0x11')];this[_0xf86e('0x14')]=_0x236e32[_0xf86e('0x14')];this[_0xf86e('0x15')]=_0x2fe1ec[_0xf86e('0x16')];this[_0xf86e('0x17')]=_0x2fe1ec[_0xf86e('0x18')];this[_0xf86e('0x19')]=_0x2fe1ec[_0xf86e('0x19')];this[_0xf86e('0x1a')]=_0x2fe1ec[_0xf86e('0x1a')];this[_0xf86e('0x1b')]=_0x2fe1ec['answertime'];this[_0xf86e('0x1c')]=moment()[_0xf86e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf86e('0x1e')]=getSeconds(_0x2fe1ec['responsetime'],_0x2fe1ec[_0xf86e('0x19')]);this['holdtime']=getSeconds(_0x2fe1ec['answertime'],_0x2fe1ec[_0xf86e('0x1a')]);this['talktime']=getSeconds(this['endtime'],_0x2fe1ec[_0xf86e('0x1b')]);this[_0xf86e('0xa')]=_0x236e32['queue'];this[_0xf86e('0x1f')]=_0x236e32['membername'];this['reason']=_0x236e32[_0xf86e('0x20')];this[_0xf86e('0x21')]=_0x2fe1ec[_0xf86e('0x21')];this[_0xf86e('0x22')]=_0x2fe1ec[_0xf86e('0x22')];this['callbackat']=_0x2fe1ec[_0xf86e('0x23')];this['recallme']=_0x2fe1ec[_0xf86e('0x24')];this[_0xf86e('0x25')]=_0x2fe1ec[_0xf86e('0x25')];this[_0xf86e('0x26')]=_0x2fe1ec[_0xf86e('0x26')];this[_0xf86e('0x27')]=_0x2fe1ec[_0xf86e('0x27')];this['VoiceQueueId']=_0x2fe1ec[_0xf86e('0x28')];this[_0xf86e('0x29')]=_0x2fe1ec['CampaignId'];this[_0xf86e('0x2a')]=_0x2fe1ec[_0xf86e('0x2a')]||'';this[_0xf86e('0x2b')]=_0x2fe1ec[_0xf86e('0x2b')]||'';}module[_0xf86e('0x2c')]=AgentComplete;