Package org.jivesoftware.openfire.sip.calllog

Examples of org.jivesoftware.openfire.sip.calllog.CallLog


        String username = iq.getTo().toBareJID().split("@")[0];

        if (username != null) {

            CallLog callLog = new CallLog(username);
            Element pe = iq.getChildElement().element("callLog");

            if (pe != null) {

                Element numA = pe.element("numA");
                Element numB = pe.element("numB");
                Element duration = pe.element("duration");
                Element type = pe.element("type");

                callLog.setNumA((numA != null) ? numA.getTextTrim() : "");
                callLog.setNumB((numB != null) ? numB.getTextTrim() : "");
                callLog.setDateTime(new Date().getTime());
                callLog.setDuration((duration != null) ? Integer.parseInt(duration.getText()) : 0);
                if (type != null && "loss".equals(type.getTextTrim())) {
                    // Backwards compatibility change
                    type.setText("missed");
                }
                callLog.setType((type != null) ? CallLog.Type.valueOf(type.getTextTrim()) : CallLog.Type.dialed);

                try {
                    CallLogDAO.insert(callLog);
                } catch (SQLException e) {
                    Log.error(e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.jivesoftware.openfire.sip.calllog.CallLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.