Log.debug(e);
    public void handleDial(IQ iq) {        JID jid = iq.getFrom();        Element phoneElement = iq.getChildElement();        PhoneManager phoneManager = null;        try {            phoneManager = PhoneManagerFactory.getPhoneManager();            String extension = phoneElement.elementText("extension");            if(extension != null) {                phoneManager.dial(jid.getNode(), extension);            }            // try dialing by jid            else {                String targetJID = phoneElement.elementText("jid");                if(targetJID == null) {                    throw new PhoneException("No extension or jid was specified");                }                phoneManager.dial(jid.getNode(), new JID(targetJID));            }            //send reply            IQ reply = IQ.createResultIQ(iq);            reply.setType(IQ.Type.result);            PhoneAction phoneAction = new PhoneAction(PhoneAction.Type.DIAL);            reply.setChildElement(phoneAction);            send(reply);                    }        catch (PhoneException e) {            IQ reply = IQ.createResultIQ(iq);            reply.setType(IQ.Type.error);            PacketError error = new PacketError(PacketError.Condition.unexpected_condition,                    PacketError.Type.cancel,                    e.getMessage());            reply.setError(error);            send(reply);        }        finally {            PhoneManagerFactory.close(phoneManager);        }    }