call = new Call(calltype, calldate, number, field[3], field[4], Integer.parseInt(time[0]) * 3600 + Integer.parseInt(time[1]) * 60);
if (field[3].equals("FON 1")) { field[3] = "0"; } else if (field[3].equals("FON 2")) { field[3] = "1"; } else if (field[3].equals("FON 3")) { field[3] = "2"; } else if (field[3].equals("Durchwahl")) { field[3] = "3"; } else if (field[3].equals("FON S0")) { field[3] = "4"; } else if (field[3].equals("DATA S0")) { field[3] = "36"; }
	public Call parseCallFritzboxCSV(String line, boolean isPushFile) {		String[] field = line.split(PATTERN_CSV);		Call call;		CallType calltype;		Date calldate;		PhoneNumber number;		// check if line has correct amount of entries		if (field.length != 6) {			if (field.length != 1)		    		Debug.err("Invalid CSV format, incorrect number of fields!");		//if you find an error here, its not because			return null; // jfritz is broken, the fritz box exports things		} // with an extra empty line for whatever reason		// Call type		// Why would they change the cvs format in the Push service???		if ((field[0].equals("1") && !isPushFile) //$NON-NLS-1$				|| (field[0].equals("2") && isPushFile)) { //$NON-NLS-1$			calltype = new CallType("call_in"); //$NON-NLS-1$		} else if ((field[0].equals("2") && !isPushFile) //$NON-NLS-1$				|| (field[0].equals("3") && isPushFile)) { //$NON-NLS-1$			calltype = new CallType("call_in_failed"); //$NON-NLS-1$		} else if ((field[0].equals("3") && !isPushFile) //$NON-NLS-1$				|| (field[0].equals("1") && isPushFile)) { //$NON-NLS-1$			calltype = new CallType("call_out"); //$NON-NLS-1$		} else {			Debug.err("Invalid Call type in CSV entry!"); //$NON-NLS-1$			return null;		}		// Call date and time		if (field[1] != null) {			try {				calldate = new SimpleDateFormat("dd.MM.yy HH:mm").parse(field[1]); //$NON-NLS-1$			} catch (ParseException e) {				Debug.err("Invalid date format in csv entry!"); //$NON-NLS-1$				return null;			}		} else {			Debug.err("Invalid date format in csv entry!"); //$NON-NLS-1$			return null;		}		// Phone number		if (!field[2].equals(""))			number = new PhoneNumber(field[2],					JFritz.getProperty("option.activateDialPrefix").toLowerCase().equals("true")					&& (calltype.toInt() == CallType.CALLOUT)					&& !field[4].startsWith("Internet"));		else			number = null;				// split the duration into two stings, hours:minutes		String[] time = field[5].split(":");		// change the port to fit the jfritz naming convention		if (field[3].equals("FON 1")) {			field[3] = "0";		} else if (field[3].equals("FON 2")) {			field[3] = "1";		} else if (field[3].equals("FON 3")) {			field[3] = "2";		} else if (field[3].equals("Durchwahl")) {			field[3] = "3";		} else if (field[3].equals("FON S0")) {			field[3] = "4";		} else if (field[3].equals("DATA S0")) {			field[3] = "36";		}		// make the call object and exit		call = new Call(calltype, calldate, number, field[3], field[4],				Integer.parseInt(time[0]) * 3600 + Integer.parseInt(time[1])						* 60);		return call;	}