4e4cd616d2849175ff6b1ca472f9e5381562dc5b
[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 _0x0fd4=['Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc'];(function(_0x4d4223,_0x325b3b){var _0x2f5cd7=function(_0x1c7ec2){while(--_0x1c7ec2){_0x4d4223['push'](_0x4d4223['shift']());}};_0x2f5cd7(++_0x325b3b);}(_0x0fd4,0x148));var _0x40fd=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0x0fd4[_0x416cdc];return _0x1931ce;};'use strict';var util=require(_0x40fd('0x0'));var _=require(_0x40fd('0x1'));var moment=require(_0x40fd('0x2'));function getSeconds(_0x1387aa,_0x4184db){var _0x3e0e84=moment(_0x1387aa)[_0x40fd('0x3')](0x0);var _0x4801a9=moment(_0x4184db)[_0x40fd('0x3')](0x0);return _0x3e0e84[_0x40fd('0x4')](_0x4801a9,_0x40fd('0x5'));}function AgentComplete(_0x2f0309,_0x137ff8){this[_0x40fd('0x6')]=0x4;this[_0x40fd('0x7')]=_0x40fd('0x8');this[_0x40fd('0x9')]=_0x2f0309[_0x40fd('0x9')];this['type']=_0x2f0309[_0x40fd('0xa')];this[_0x40fd('0xb')]=_0x2f0309[_0x40fd('0xa')]===_0x40fd('0xc')?_0x40fd('0xd'):_0x2f0309['type'];this[_0x40fd('0xe')]=_0x2f0309[_0x40fd('0xe')];this['countcongestionretry']=_0x2f0309[_0x40fd('0xf')];this[_0x40fd('0x10')]=_0x2f0309['countnoanswerretry'];this[_0x40fd('0x11')]=_0x2f0309[_0x40fd('0xe')]+_0x2f0309[_0x40fd('0xf')]+_0x2f0309[_0x40fd('0x10')]+_0x2f0309[_0x40fd('0x12')]+_0x2f0309[_0x40fd('0x13')]+_0x2f0309[_0x40fd('0x14')]+_0x2f0309[_0x40fd('0x15')]+_0x2f0309[_0x40fd('0x16')];this[_0x40fd('0x12')]=_0x2f0309[_0x40fd('0x12')];this[_0x40fd('0x13')]=_0x2f0309[_0x40fd('0x13')];this[_0x40fd('0x14')]=_0x2f0309[_0x40fd('0x14')];this[_0x40fd('0x15')]=_0x2f0309[_0x40fd('0x15')];this['countagentrejectretry']=_0x2f0309[_0x40fd('0x16')];this[_0x40fd('0x17')]=_0x137ff8[_0x40fd('0x17')];this[_0x40fd('0x18')]=_0x2f0309[_0x40fd('0x19')];this[_0x40fd('0x1a')]=_0x2f0309[_0x40fd('0x1b')];this['starttime']=_0x2f0309['starttime'];this['responsetime']=_0x2f0309[_0x40fd('0x1c')];this['answertime']=_0x2f0309[_0x40fd('0x1d')];this['endtime']=moment()['format'](_0x40fd('0x1e'));this[_0x40fd('0x1f')]=getSeconds(_0x2f0309[_0x40fd('0x1c')],_0x2f0309[_0x40fd('0x20')]);this[_0x40fd('0x21')]=getSeconds(_0x2f0309[_0x40fd('0x1d')],_0x2f0309[_0x40fd('0x1c')]);this['talktime']=getSeconds(this['endtime'],_0x2f0309[_0x40fd('0x1d')]);this[_0x40fd('0xd')]=_0x137ff8[_0x40fd('0xd')];this['membername']=_0x137ff8[_0x40fd('0x22')];this[_0x40fd('0x23')]=_0x137ff8[_0x40fd('0x23')];this[_0x40fd('0x24')]=_0x2f0309[_0x40fd('0x24')];this[_0x40fd('0x25')]=_0x2f0309[_0x40fd('0x25')];this[_0x40fd('0x26')]=_0x2f0309[_0x40fd('0x26')];this[_0x40fd('0x27')]=_0x2f0309['recallme'];this['ContactId']=_0x2f0309[_0x40fd('0x28')];this[_0x40fd('0x29')]=_0x2f0309[_0x40fd('0x29')];this[_0x40fd('0x2a')]=_0x2f0309['UserId'];this['VoiceQueueId']=_0x2f0309[_0x40fd('0x2b')];this[_0x40fd('0x2c')]=_0x2f0309['CampaignId'];this['originatecalleridnum']=_0x2f0309[_0x40fd('0x2d')]||'';this[_0x40fd('0x2e')]=_0x2f0309['originatecalleridname']||'';}module[_0x40fd('0x2f')]=AgentComplete;