58bb3a6bbe0834b989762c86681fe010d80aa173
[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 _0x3046=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','answertime','endtime','format','ringtime','responsetime','holdtime','talktime','queue','membername','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId'];(function(_0x102fc6,_0x19d7ee){var _0x290711=function(_0x1777bf){while(--_0x1777bf){_0x102fc6['push'](_0x102fc6['shift']());}};_0x290711(++_0x19d7ee);}(_0x3046,0xf0));var _0x6304=function(_0x4bd386,_0x43330e){_0x4bd386=_0x4bd386-0x0;var _0x1ed1c2=_0x3046[_0x4bd386];return _0x1ed1c2;};'use strict';var util=require(_0x6304('0x0'));var _=require(_0x6304('0x1'));var moment=require(_0x6304('0x2'));function getSeconds(_0x43c347,_0x5cc783){var _0x5ebad5=moment(_0x43c347)[_0x6304('0x3')](0x0);var _0xf62114=moment(_0x5cc783)[_0x6304('0x3')](0x0);return _0x5ebad5[_0x6304('0x4')](_0xf62114,_0x6304('0x5'));}function AgentComplete(_0x4b7c33,_0x4eac89){this[_0x6304('0x6')]=0x4;this[_0x6304('0x7')]=_0x6304('0x8');this[_0x6304('0x9')]=_0x4b7c33[_0x6304('0x9')];this[_0x6304('0xa')]=_0x4b7c33[_0x6304('0xa')];this[_0x6304('0xb')]=_0x4b7c33['type']===_0x6304('0xc')?'queue':_0x4b7c33['type'];this['countbusyretry']=_0x4b7c33[_0x6304('0xd')];this[_0x6304('0xe')]=_0x4b7c33['countcongestionretry'];this['countnoanswerretry']=_0x4b7c33[_0x6304('0xf')];this[_0x6304('0x10')]=_0x4b7c33['countbusyretry']+_0x4b7c33[_0x6304('0xe')]+_0x4b7c33[_0x6304('0xf')]+_0x4b7c33[_0x6304('0x11')]+_0x4b7c33[_0x6304('0x12')]+_0x4b7c33[_0x6304('0x13')]+_0x4b7c33['countmachineretry']+_0x4b7c33[_0x6304('0x14')];this['countnosuchnumberretry']=_0x4b7c33[_0x6304('0x11')];this[_0x6304('0x12')]=_0x4b7c33[_0x6304('0x12')];this[_0x6304('0x13')]=_0x4b7c33[_0x6304('0x13')];this[_0x6304('0x15')]=_0x4b7c33[_0x6304('0x15')];this[_0x6304('0x14')]=_0x4b7c33[_0x6304('0x14')];this[_0x6304('0x16')]=_0x4eac89[_0x6304('0x16')];this['calleridname']=_0x4b7c33[_0x6304('0x17')];this[_0x6304('0x18')]=_0x4b7c33[_0x6304('0x19')];this[_0x6304('0x1a')]=_0x4b7c33['starttime'];this['responsetime']=_0x4b7c33['responsetime'];this[_0x6304('0x1b')]=_0x4b7c33[_0x6304('0x1b')];this[_0x6304('0x1c')]=moment()[_0x6304('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6304('0x1e')]=getSeconds(_0x4b7c33[_0x6304('0x1f')],_0x4b7c33[_0x6304('0x1a')]);this[_0x6304('0x20')]=getSeconds(_0x4b7c33['answertime'],_0x4b7c33[_0x6304('0x1f')]);this[_0x6304('0x21')]=getSeconds(this[_0x6304('0x1c')],_0x4b7c33['answertime']);this[_0x6304('0x22')]=_0x4eac89[_0x6304('0x22')];this[_0x6304('0x23')]=_0x4eac89[_0x6304('0x23')];this['reason']=_0x4eac89['reason'];this['callback']=_0x4b7c33[_0x6304('0x24')];this[_0x6304('0x25')]=_0x4b7c33[_0x6304('0x25')];this[_0x6304('0x26')]=_0x4b7c33['callbackat'];this['recallme']=_0x4b7c33['recallme'];this[_0x6304('0x27')]=_0x4b7c33[_0x6304('0x27')];this['ListId']=_0x4b7c33[_0x6304('0x28')];this[_0x6304('0x29')]=_0x4b7c33[_0x6304('0x29')];this[_0x6304('0x2a')]=_0x4b7c33[_0x6304('0x2a')];this['CampaignId']=_0x4b7c33[_0x6304('0x2b')];this[_0x6304('0x2c')]=_0x4b7c33[_0x6304('0x2c')]||'';this[_0x6304('0x2d')]=_0x4b7c33[_0x6304('0x2d')]||'';}module[_0x6304('0x2e')]=AgentComplete;