async function storeContactTraceStream()

in Frontend/main.js [148:161]


async function storeContactTraceStream(contact, agent, eventtype) {
    console.log('Received Event - Contact: ' + JSON.stringify(contact) + ' Agent: ' + JSON.stringify(agent) + ' Event Type: ' + eventtype);
    if (contact) {
        //update contact
        if (contacts[contact.contactId] && eventtype != 'Destroyed' && eventtype != 'Ended') { 
            console.log('>>> Updating existing contact');
            contacts[contact.contactId] = await createContactTraceStream(contacts[contact.contactId], contact, agent);
        } else if (eventtype != 'Destroyed' && eventtype != 'Ended') {
            console.log('>>> Creating new contact');
            contacts[contact.contactId] = await createContactTraceStream(contact, contact, agent);
        }
        bufferWorker.postMessage({type: 'putContact', contact: contacts[contact.contactId], event: eventtype});
    }
}