2e2ae14976d6c4d19312e432802eae1cdce4df55
[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 _0x07ec=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x4fcad5,_0x258deb){var _0x1dec8a=function(_0x3ac9f9){while(--_0x3ac9f9){_0x4fcad5['push'](_0x4fcad5['shift']());}};_0x1dec8a(++_0x258deb);}(_0x07ec,0xb9));var _0xc07e=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x07ec[_0x54c9dd];return _0x855156;};'use strict';var util=require('util');var _=require(_0xc07e('0x0'));var moment=require('moment');function getSeconds(_0x5c3c21,_0x402029){var _0x3e5cd8=moment(_0x5c3c21)[_0xc07e('0x1')](0x0);var _0x409ae6=moment(_0x402029)[_0xc07e('0x1')](0x0);return _0x3e5cd8[_0xc07e('0x2')](_0x409ae6,_0xc07e('0x3'));}function AgentComplete(_0x566e72,_0x1e355d){this[_0xc07e('0x4')]=0x4;this[_0xc07e('0x5')]='Answer';this[_0xc07e('0x6')]=_0x566e72['scheduledat'];this[_0xc07e('0x7')]=_0x566e72['type'];this[_0xc07e('0x8')]=_0x566e72['type']===_0xc07e('0x9')?_0xc07e('0xa'):_0x566e72[_0xc07e('0x7')];this['countbusyretry']=_0x566e72[_0xc07e('0xb')];this[_0xc07e('0xc')]=_0x566e72[_0xc07e('0xc')];this[_0xc07e('0xd')]=_0x566e72[_0xc07e('0xd')];this[_0xc07e('0xe')]=_0x566e72[_0xc07e('0xb')]+_0x566e72['countcongestionretry']+_0x566e72[_0xc07e('0xd')]+_0x566e72[_0xc07e('0xf')]+_0x566e72[_0xc07e('0x10')]+_0x566e72[_0xc07e('0x11')]+_0x566e72[_0xc07e('0x12')]+_0x566e72[_0xc07e('0x13')];this[_0xc07e('0xf')]=_0x566e72[_0xc07e('0xf')];this[_0xc07e('0x10')]=_0x566e72[_0xc07e('0x10')];this['countabandonedretry']=_0x566e72['countabandonedretry'];this[_0xc07e('0x12')]=_0x566e72[_0xc07e('0x12')];this[_0xc07e('0x13')]=_0x566e72[_0xc07e('0x13')];this[_0xc07e('0x14')]=_0x1e355d[_0xc07e('0x14')];this[_0xc07e('0x15')]=_0x566e72[_0xc07e('0x16')];this[_0xc07e('0x17')]=_0x566e72['number'];this[_0xc07e('0x18')]=_0x566e72['starttime'];this[_0xc07e('0x19')]=_0x566e72[_0xc07e('0x19')];this[_0xc07e('0x1a')]=_0x566e72[_0xc07e('0x1a')];this[_0xc07e('0x1b')]=moment()[_0xc07e('0x1c')](_0xc07e('0x1d'));this['ringtime']=getSeconds(_0x566e72[_0xc07e('0x19')],_0x566e72['starttime']);this['holdtime']=getSeconds(_0x566e72[_0xc07e('0x1a')],_0x566e72[_0xc07e('0x19')]);this[_0xc07e('0x1e')]=getSeconds(this[_0xc07e('0x1b')],_0x566e72[_0xc07e('0x1a')]);this['queue']=_0x1e355d[_0xc07e('0xa')];this[_0xc07e('0x1f')]=_0x1e355d[_0xc07e('0x1f')];this[_0xc07e('0x20')]=_0x1e355d[_0xc07e('0x20')];this['callback']=_0x566e72[_0xc07e('0x21')];this['callbackuniqueid']=_0x566e72[_0xc07e('0x22')];this[_0xc07e('0x23')]=_0x566e72[_0xc07e('0x23')];this[_0xc07e('0x24')]=_0x566e72[_0xc07e('0x24')];this[_0xc07e('0x25')]=_0x566e72['ContactId'];this[_0xc07e('0x26')]=_0x566e72['ListId'];this[_0xc07e('0x27')]=_0x566e72[_0xc07e('0x27')];this['VoiceQueueId']=_0x566e72[_0xc07e('0x28')];this['CampaignId']=_0x566e72['CampaignId'];this[_0xc07e('0x29')]=_0x566e72[_0xc07e('0x29')]||'';this[_0xc07e('0x2a')]=_0x566e72[_0xc07e('0x2a')]||'';}module[_0xc07e('0x2b')]=AgentComplete;