3 Copyright (C) 2010 Belledonne Communications, Grenoble, France
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package org.linphone.core;
21 * Call data records object
24 import java.util.Vector;
28 * Object representing a call log.
32 public interface LinphoneCallLog {
34 * Represents call status
37 static class CallStatus {
39 static private Vector<CallStatus> values = new Vector<CallStatus>();
40 private final int mValue;
41 private final String mStringValue;
45 public final static CallStatus Success = new CallStatus(0,"Sucess");
49 public final static CallStatus Aborted = new CallStatus(1,"Aborted");
51 * missed incoming call.
53 public final static CallStatus Missed = new CallStatus(2,"Missed");
55 * remote call declined.
57 public final static CallStatus Declined = new CallStatus(3,"Declined");
60 private CallStatus(int value,String stringValue) {
62 values.addElement(this);
63 mStringValue=stringValue;
65 public static CallStatus fromInt(int value) {
67 for (int i=0; i<values.size();i++) {
68 CallStatus state = (CallStatus) values.elementAt(i);
69 if (state.mValue == value) return state;
71 throw new RuntimeException("CallStatus not found ["+value+"]");
73 public String toString() {
82 * Originator of the call as a LinphoneAddress object.
83 * @return LinphoneAddress
85 public LinphoneAddress getFrom();
87 * Destination of the call as a LinphoneAddress object.
90 public LinphoneAddress getTo ();
92 * The direction of the call
93 * @return CallDirection
95 public CallDirection getDirection();
97 * get status of this call
100 public CallStatus getStatus();
103 * A human readable String with the start date/time of the call
106 public String getStartDate();
109 * A timestamp of the start date/time of the call in milliseconds since January 1st 1970
112 public long getTimestamp();
115 * The call duration, in seconds
118 public int getCallDuration();
120 * Call id from signaling
123 public int getCallId();