String route = call.getRoute(); if (route.equals("")) { route = "FIXEDLINE"; } if (!filteredSipProviders.contains(route)) { searchFilterPassed = false; }
sipFilterPassed = sipFilter.filterPassed(call);
	public void updateFilter() {		Debug.msg("updating the filter");		boolean filterCallIn = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.callin")); //$NON-NLS-1$		boolean filterCallInFailed = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.callinfailed")); //$NON-NLS-1$		boolean filterCallOut = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.callout")); //$NON-NLS-1$		boolean filterNumber = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.number")); //$NON-NLS-1$		boolean filterFixed = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.fixed")); //$NON-NLS-1$		boolean filterHandy = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.handy")); //$NON-NLS-1$		boolean filterDate = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.date")); //$NON-NLS-1$		boolean filterSip = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.sip")); //$NON-NLS-1$		boolean filterCallByCall = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.callbycall")); //$NON-NLS-1$		boolean filterComment = JFritzUtils.parseBoolean(JFritz				.getProperty("filter.comment")); // fireTableDataChanged();$NON-NLS-1$		String filterSearch = JFritz.getProperty("filter.search", ""); //$NON-NLS-1$,  //$NON-NLS-2$		String filterDateFrom = JFritz.getProperty("filter.date_from", ""); //$NON-NLS-1$,  //$NON-NLS-2$		String filterDateTo = JFritz.getProperty("filter.date_to", ""); //$NON-NLS-1$,  //$NON-NLS-2$		try {			jfritz.getJframe().getCallerTable().getCellEditor()					.cancelCellEditing();		} catch (NullPointerException e) {		}		if ((!filterCallIn) && (!filterCallInFailed) && (!filterCallOut)				&& (!filterNumber) && (!filterDate) && (!filterHandy)				&& (!filterFixed) && (!filterSip) && (!filterCallByCall)				&& (!filterComment) && (filterSearch.length() == 0)) {			// Use unfiltered data			filteredCallerData = (Vector) unfilteredCallerData.clone();			sortAllFilteredRowsBy(sortColumn, sortDirection);		} else { // Data got to be filtered			Vector filteredSipProviders = new Vector();			if (filterSip) {				String providers = JFritz.getProperty("filter.sipProvider", //$NON-NLS-1$						"[]"); //$NON-NLS-1$				if (providers.equals("[]")) { // No entries selected					// //$NON-NLS-1$					filterSip = false;				}				providers = providers.replaceAll("\\[", ""); //$NON-NLS-1$,  //$NON-NLS-2$				providers = providers.replaceAll("\\]", ""); //$NON-NLS-1$,  //$NON-NLS-2$				String[] providerEntries = providers.split(","); //$NON-NLS-1$				for (int i = 0; i < providerEntries.length; i++) {					if (providerEntries[i].length() > 0) {						if (providerEntries[i].charAt(0) == 32) { // delete							// first SPACE							providerEntries[i] = providerEntries[i]									.substring(1);						}					}					filteredSipProviders.add(providerEntries[i]);				}			}			Vector filteredCallByCallProviders = new Vector();			if (filterCallByCall) {				String providers = JFritz.getProperty(						"filter.callbycallProvider", "[]"); //$NON-NLS-1$,  //$NON-NLS-2$				// No entries selected				if (providers.equals("[]")) { //$NON-NLS-1$					filterCallByCall = false;				}				providers = providers.replaceAll("\\[", ""); //$NON-NLS-1$,  //$NON-NLS-2$				providers = providers.replaceAll("\\]", ""); //$NON-NLS-1$,  //$NON-NLS-2$				String[] providerEntries = providers.split(","); //$NON-NLS-1$				for (int i = 0; i < providerEntries.length; i++) {					if (providerEntries[i].length() > 0) {						if (providerEntries[i].charAt(0) == 32) { // delete							// first SPACE							providerEntries[i] = providerEntries[i]									.substring(1);						}					}					filteredCallByCallProviders.add(providerEntries[i]);				}			}			Vector filteredcallerdata;			filteredcallerdata = new Vector();			Enumeration en = unfilteredCallerData.elements();			while (en.hasMoreElements()) {				Call call = (Call) en.nextElement();				boolean dateFilterPassed = true;				boolean searchFilterPassed = true;				boolean handyFilterPassed = true;				boolean fixedFilterPassed = true;				boolean sipFilterPassed = true;				boolean commentFilterPassed = true;				// SearchFilter: Number, Participant, Date				String parts[] = filterSearch.split(" "); //$NON-NLS-1$				for (int i = 0; i < parts.length; i++) {					String part = parts[i];					if (part.length() > 0							&& (call.getPhoneNumber() == null || call									.getPhoneNumber().getAreaNumber().indexOf(											parts[i]) == -1)							&& (call.getPerson() == null || call.getPerson()									.getFullname().toLowerCase().indexOf(											part.toLowerCase()) == -1)) {						searchFilterPassed = false;						break;					}				}				if (filterSip) {					String route = call.getRoute();					if (route.equals("")) { //$NON-NLS-1$						route = "FIXEDLINE"; //$NON-NLS-1$					}					if (!filteredSipProviders.contains(route)) {						searchFilterPassed = false;					}				}				if (filterCallByCall) {					if (call.getPhoneNumber() != null) {						String callbycallprovider = call.getPhoneNumber()								.getCallByCall();						if (callbycallprovider.equals("")) { //$NON-NLS-1$							callbycallprovider = "NONE"; //$NON-NLS-1$						}						if (!filteredCallByCallProviders								.contains(callbycallprovider)) {							searchFilterPassed = false;						}					} else { // Hide calls without number						if (!filteredCallByCallProviders.contains("NONE")) { //$NON-NLS-1$							searchFilterPassed = false;						}					}				}				try {					if (filterDate							&& !(call.getCalldate().after(									new SimpleDateFormat("dd.MM.yy") //$NON-NLS-1$											.parse(filterDateFrom)) && call									.getCalldate().before(											new SimpleDateFormat(													"dd.MM.yy HH:mm") //$NON-NLS-1$													.parse(filterDateTo															+ " 23:59")))) { //$NON-NLS-1$						dateFilterPassed = false;					}				} catch (ParseException e1) {				}				if (filterFixed && call.getPhoneNumber() != null						&& !call.getPhoneNumber().isMobile())					fixedFilterPassed = false;				if (filterHandy && call.getPhoneNumber() != null						&& call.getPhoneNumber().isMobile())					handyFilterPassed = false;				if (filterComment						&& !call.getComment().equals(								JFritz.getProperty("filter.comment.text", ""))) { //$NON-NLS-1$,  //$NON-NLS-2$					commentFilterPassed = false;				}				if (searchFilterPassed && dateFilterPassed && handyFilterPassed						&& fixedFilterPassed && sipFilterPassed						&& commentFilterPassed)					if (!(filterNumber && call.getPhoneNumber() == null)) {						if ((!filterCallIn)								&& (call.getCalltype().toInt() == CallType.CALLIN))							filteredcallerdata.add(call);						else if ((!filterCallInFailed)								&& (call.getCalltype().toInt() == CallType.CALLIN_FAILED))							filteredcallerdata.add(call);						else if ((!filterCallOut)								&& (call.getCalltype().toInt() == CallType.CALLOUT))							filteredcallerdata.add(call);					}			}			filteredCallerData = filteredcallerdata;			sortAllFilteredRowsBy(sortColumn, sortDirection);		}		if (jfritz.getJframe() != null)			jfritz.getJframe().setStatus();	}