log.log(Level.SEVERE, e.getMessage(), e);
Log.error(e.getMessage(), e);
        public void run() {            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;                }                // try and see if we have a fake call session                // This will be created if there was an originated call                CallSession fakeSession = getCallSessionFactory().destroyPhoneSession(device);                CallSession callSession = getCallSessionFactory()                        .getCallSession(event.getUniqueId(), phoneUser.getUsername());                callSession.setChannel(event.getChannel());                Message message = new Message();                message.setID(event.getUniqueId()); //just put something in here                message.setFrom(asteriskPlugin.getComponentJID());                if (fakeSession != null) {                    callSession.setCallerID(fakeSession.getCallerID());                    callSession.setDialedJID(fakeSession.getDialedJID());                    PhoneEvent dialEvent =                            new PhoneEvent(event.getUniqueId(), Type.DIALED, device);                    dialEvent.addElement("callerID").setText(fakeSession.getCallerID());                    callSession.setCallerID(fakeSession.getCallerID());                    if (fakeSession.getDialedJID() != null) {                        dialEvent.addElement("jid", fakeSession.getDialedJID().toString());                    }                    message.getElement().add(dialEvent);                } else {                    PhoneEvent phoneEvent =                            new PhoneEvent(event.getUniqueId(), Type.RING, device);                    String callerID = StringUtils.stripTags(event.getCallerId());                    phoneEvent.addElement("callerID").setText(callerID);                    callSession.setCallerID(callerID);                    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);                }            }            catch (Exception e) {                log.log(Level.SEVERE, e.getMessage(), e);            }            finally {                close(phoneManager);            }        }