CallSession callSession = getCallSessionFactory().getPhoneSession(event.getUniqueId());
CallSession callSession = getCallSessionFactory().getCallSession(event.getUniqueId(), phoneUser.getUsername());
        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) {                    log.finer("AnswerTask: Could not find device/jid mapping for device " +                            device + " returning");                    return;                }                CallSession callSession = getCallSessionFactory().getPhoneSession(event.getUniqueId());                JID jid = getJID(phoneUser);                XMPPServer server = getInstance();                // Notify the client that they have answered the phone                Message message = new Message();                message.setFrom(asteriskPlugin.getComponentJID());                message.setID(event.getUniqueId());                PhoneEvent phoneEvent =                        new PhoneEvent(callSession.getId(), Type.ON_PHONE, device);                phoneEvent.addElement("callerID").setText(callSession.getCallerID());                message.getElement().add(phoneEvent);                //Acquire the xmpp sessions for the user                SessionManager sessionManager = server.getSessionManager();                Collection<ClientSession> sessions = sessionManager.getSessions(jid.getNode());                // We don't care about people without a session                if (sessions.size() == 0) {                    return;                }                log.finer("AnswerTask: setting presence to away for " + jid);                // Iterate through all of the sessions sending out new presences for each                Presence presence = new Presence();                presence.setShow(Presence.Show.away);                presence.setStatus("On the phone");                PhoneStatus phoneStatus = new PhoneStatus(Status.ON_PHONE);                presence.getElement().add(phoneStatus);                Collection<Presence> prevPresences = new ArrayList<Presence>();                for (ClientSession session : sessions) {                    message.setTo(session.getAddress());                    asteriskPlugin.sendPacket(message);                    Presence prevPresence = session.getPresence();                    prevPresences.add(prevPresence);                    JID fullJID = session.getAddress();                    presence.setFrom(fullJID);                    server.getPresenceRouter().route(presence);                }                previousPresenceMap.put(jid, prevPresences);            }            catch (Exception e) {                log.log(Level.SEVERE, e.getMessage(), e);            }            finally {                close(phoneManager);            }        }