use of de.janrufmonitor.framework.ICip in project janrufmonitor by tbrandt77.
the class MailNotification method sendTestMail.
public void sendTestMail() {
ICaller caller = getRuntime().getCallerFactory().createCaller(getRuntime().getCallerFactory().createName("Max", "Mustermann"), getRuntime().getCallerFactory().createPhonenumber("49", "30", "1234567890"));
IMsn msn = getRuntime().getMsnManager().createMsn("12345");
ICip cip = getRuntime().getCipManager().createCip("999");
ICall call = getRuntime().getCallFactory().createCall(caller, msn, cip);
if (this.m_configuration == null) {
PropagationFactory.getInstance().fire(new de.janrufmonitor.exception.Message(de.janrufmonitor.exception.Message.ERROR, NAMESPACE, "notstarted", new String[] {}, new Exception()), "Tray");
return;
}
if (this.m_task == null) {
this.m_task = new MailTask();
this.m_logger.info("Created new MailTask instance");
}
PropagationFactory.getInstance().fire(new de.janrufmonitor.exception.Message(de.janrufmonitor.exception.Message.INFO, NAMESPACE, "testmail", new String[] {}, new Exception()), "Tray");
this.m_task.setConfiguration(this.m_configuration);
this.m_task.addMail(call);
this.m_task.run();
}
use of de.janrufmonitor.framework.ICip in project janrufmonitor by tbrandt77.
the class FilterWizard method performFinish.
public boolean performFinish() {
if (this.m_pages[0].isPageComplete() && this.m_pages[1].isPageComplete() && this.m_pages[2].isPageComplete() && this.m_pages[3].isPageComplete() && this.m_pages[4].isPageComplete() && this.m_pages[5].isPageComplete() && this.m_pages[6].isPageComplete()) {
List filterList = new ArrayList();
IPhonenumber[] phones = ((FilterPhonesPage) this.m_pages[3]).getResult();
if (phones != null) {
filterList.addAll(this.getCallerFilters(phones));
}
Date[] dates = ((FilterDatePage) this.m_pages[2]).getResult();
if (dates != null && dates.length > 0) {
filterList.add(this.getDateFilter(dates));
}
IMsn msn = ((FilterMsnPage) this.m_pages[0]).getResult();
if (msn != null) {
if (!msn.getMSN().equalsIgnoreCase("*"))
filterList.add(new MsnFilter(new IMsn[] { msn }));
}
int limit = ((FilterItemCountPage) this.m_pages[4]).getResult();
if (limit > 0) {
filterList.add(new ItemCountFilter(limit));
}
IAttributeMap m = ((FilterCallTypePage) this.m_pages[5]).getResult();
if (m != null && m.size() > 0) {
filterList.add(new AttributeFilter(m));
}
ICip cip = ((FilterCipPage) this.m_pages[1]).getResult();
if (cip != null)
if (!cip.getCIP().equalsIgnoreCase("*"))
filterList.add(new CipFilter(cip));
this.m_filters = new IFilter[filterList.size()];
for (int i = 0; i < filterList.size(); i++) {
this.m_filters[i] = (IFilter) filterList.get(i);
}
String name = ((FilterNamePage) this.m_pages[6]).getResult();
IFilterManager fm = new JournalFilterManager();
if (name != null && name.trim().length() > 0) {
this.getRuntime().getConfigManagerFactory().getConfigManager().setProperty(Journal.NAMESPACE, "filtername_" + fm.getFiltersToString(getResult()), name);
this.getRuntime().getConfigManagerFactory().getConfigManager().saveConfiguration();
} else {
this.getRuntime().getConfigManagerFactory().getConfigManager().removeProperty(Journal.NAMESPACE, "filtername_" + fm.getFiltersToString(getResult()));
this.getRuntime().getConfigManagerFactory().getConfigManager().saveConfiguration();
}
return true;
}
this.m_filters = null;
return false;
}
use of de.janrufmonitor.framework.ICip in project janrufmonitor by tbrandt77.
the class CallSimulator method sendEvent.
protected void sendEvent(String number, String msn, String cip) {
if (number != null && number.length() > 0)
number = PhonenumberAnalyzer.getInstance(this.getRuntime()).toCallable(number);
if (!number.startsWith("0") && isRaw) {
number = "0" + number;
}
IEventBroker evtBroker = this.getRuntime().getEventBroker();
evtBroker.register(this);
evtBroker.register(this, evtBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
IPhonenumber phone = PhonenumberAnalyzer.getInstance(this.getRuntime()).toClirPhonenumber(number);
if (phone == null)
phone = PhonenumberAnalyzer.getInstance(this.getRuntime()).toInternalPhonenumber(number, msn);
if (phone == null)
phone = PhonenumberAnalyzer.getInstance(this.getRuntime()).toPhonenumber(number, msn);
IName name = PIMRuntime.getInstance().getCallerFactory().createName("", "");
ICaller aCaller = PIMRuntime.getInstance().getCallerFactory().createCaller(name, phone);
ICip ocip = PIMRuntime.getInstance().getCallFactory().createCip(cip, "");
IMsn omsn = PIMRuntime.getInstance().getCallFactory().createMsn(msn, "");
ICall currentCall = PIMRuntime.getInstance().getCallFactory().createCall(aCaller, omsn, ocip);
currentCall.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS, IJAMConst.ATTRIBUTE_VALUE_MISSED));
IEvent ev = evtBroker.createEvent(IEventConst.EVENT_TYPE_INCOMINGCALL, currentCall);
evtBroker.send(this, ev);
evtBroker.unregister(this);
}
use of de.janrufmonitor.framework.ICip in project janrufmonitor by tbrandt77.
the class PIMCapiData method createCallObject.
private ICall createCallObject(String number, String msn, int cip) {
IPhonenumber phone = PhonenumberAnalyzer.getInstance(getRuntime()).toClirPhonenumber(number);
if (phone == null)
phone = PhonenumberAnalyzer.getInstance(getRuntime()).toInternalPhonenumber(number, msn);
if (phone == null)
phone = PhonenumberAnalyzer.getInstance(getRuntime()).toPhonenumber("0" + number, msn);
IName name = this.getRuntime().getCallerFactory().createName("", "");
ICaller aCaller = this.getRuntime().getCallerFactory().createCaller(name, phone);
ICip cipObj = this.getRuntime().getCallFactory().createCip(Integer.toString(cip), "");
IMsn msnObj = this.getRuntime().getCallFactory().createMsn(msn, "");
ICall c = this.getRuntime().getCallFactory().createCall(aCaller, msnObj, cipObj);
c.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_BCHANNEL, this.m_plci.toString()));
c.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_RAW_NUMBER, number));
c.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS, IJAMConst.ATTRIBUTE_VALUE_MISSED));
return c;
}
use of de.janrufmonitor.framework.ICip in project janrufmonitor by tbrandt77.
the class XMLCallHandler method startElement.
public void startElement(String uri, String name, String qname, Attributes attributes) throws SAXException {
if (this.m_multi && qname.equalsIgnoreCase(TAG_CALLLIST)) {
this.m_calllist = this.getRuntime().getCallFactory().createCallList();
}
if (qname.equalsIgnoreCase(TAG_CALL)) {
this.m_call = this.getRuntime().getCallFactory().createCall(null, this.getRuntime().getCallFactory().createMsn("", ""), this.getRuntime().getCallFactory().createCip("", ""));
}
if (qname.equalsIgnoreCase(TAG_CALLER)) {
this.m_iscaller = true;
}
if (this.m_iscaller) {
super.startElement(uri, name, qname, attributes);
return;
}
if (qname.equalsIgnoreCase(TAG_UUID)) {
this.m_call.setUUID(attributes.getValue(ATTRIBUTE_VALUE));
}
if (qname.equalsIgnoreCase(TAG_DATE)) {
this.m_call.setDate(new Date(Long.parseLong(attributes.getValue(ATTRIBUTE_VALUE))));
}
if (qname.equalsIgnoreCase(TAG_CIP)) {
ICip cip = this.m_call.getCIP();
cip.setCIP(attributes.getValue(ATTRIBUTE_VALUE));
cip.setAdditional(this.getRuntime().getCipManager().getCipLabel(cip, this.getLanguage()));
this.m_call.setCIP(cip);
}
if (qname.equalsIgnoreCase(TAG_MSN)) {
IMsn msn = this.m_call.getMSN();
msn.setMSN(attributes.getValue(ATTRIBUTE_VALUE));
msn.setAdditional(decode(attributes.getValue(ATTRIBUTE_ADDITIONAL)));
this.m_call.setMSN(msn);
}
if (qname.equalsIgnoreCase(TAG_ATTRIBUTE)) {
IAttribute att = this.getRuntime().getCallerFactory().createAttribute(attributes.getValue(ATTRIBUTE_NAME), decode(attributes.getValue(ATTRIBUTE_VALUE)));
this.m_call.setAttribute(att);
}
}
Aggregations