JID jid = getJID(phoneUser);
        public void run() {            //everything after the hyphen should be skipped            String device = getDevice(event.getChannel());            PhoneManager phoneManager = null;            try {                phoneManager = getPhoneManager();                PhoneUser phoneUser = phoneManager.getByDevice(device);                //If there is no jid for this device don't do anything else                if (phoneUser == null) {                    return;                }                JID jid = getJID(phoneUser);                Message message = new Message();                message.setFrom(asteriskPlugin.getComponentJID());                message.setID(event.getUniqueId());                PhoneEvent phoneEvent =                        new PhoneEvent(event.getUniqueId(), Type.HANG_UP, device);                message.getElement().add(phoneEvent);                // Send the message to each of jids for this user                SessionManager sessionManager = XMPPServer.getInstance().getSessionManager();                Collection<ClientSession> sessions = sessionManager.getSessions(phoneUser.getUsername());                for (ClientSession session : sessions) {                    message.setTo(session.getAddress());                    asteriskPlugin.sendPacket(message);                }                // Set the user's presence back to what it was before the phone call                Collection<Presence> presences = previousPresenceMap.remove(jid);                if (presences != null) {                    for (Presence presence : presences) {                        Element presenceElement = presence.getElement();                        Element phoneStatusElement = presenceElement.element("phone-status");                        // If the phone-status attribute exists check to see if the                        if (phoneStatusElement != null) {                            Attribute statusAtt = phoneStatusElement.attribute("status");                            if (!Status.AVAILABLE.name().equals(statusAtt.getText())) {                                statusAtt.setText(Status.AVAILABLE.name());                            }                        }                        // The attribute doesn't exist add new attribute                        else {                            PhoneStatus status = new PhoneStatus(Status.AVAILABLE);                            presence.getElement().add(status);                        }                        getInstance().getPresenceRouter().route(presence);                    }                }                // finally destroy the session.                getCallSessionFactory().destroyPhoneSession(event.getUniqueId());            }            catch (Exception e) {                log.log(Level.SEVERE, e.getMessage(), e);            }            finally {                close(phoneManager);            }        }