Search in sources :

Example 1 with IncomingCallHandler

use of de.janrufmonitor.service.server.request.handler.IncomingCallHandler in project janrufmonitor by tbrandt77.

the class Server method received.

public void received(IEvent event) {
    if (event.getType() == IEventConst.EVENT_TYPE_INCOMINGCALL) {
        this.m_logger.info("Sending INCOMING_CALL event to clients.");
        IHttpRequest request = new IncomingCallHandler((ICall) event.getData());
        this.sendRequest(event, request);
    }
    if (event.getType() == IEventConst.EVENT_TYPE_OUTGOINGCALL) {
        this.m_logger.info("Sending OUTGOING_CALL event to clients.");
        IHttpRequest request = new OutgoingCallHandler((ICall) event.getData());
        this.sendRequest(event, request);
    }
    if (event.getType() == IEventConst.EVENT_TYPE_APPLICATION_READY) {
        this.m_logger.info("Sending APPLICATION_READY event to clients.");
        IHttpRequest request = new ApplicationReadyHandler();
        this.sendRequest(event, request);
    }
    if (event.getType() == IEventConst.EVENT_TYPE_CALLACCEPTED) {
        this.m_logger.info("Sending CALLACCEPTED event to clients.");
        IHttpRequest request = new AcceptHandler((ICall) event.getData());
        this.sendRequest(event, request);
    }
    // added: 19/06/2004: Reject flag on client was not set
    if (event.getType() == IEventConst.EVENT_TYPE_CALLREJECTED) {
        this.m_logger.info("Sending CALLREJECTED event to clients.");
        IHttpRequest request = new RejectedHandler((ICall) event.getData());
        this.sendRequest(event, request);
    }
    if (event.getType() == IEventConst.EVENT_TYPE_CALLCLEARED) {
        this.m_logger.info("Sending CALLCLEARED event to clients.");
        IHttpRequest request = new ClearHandler((ICall) event.getData());
        this.sendRequest(event, request);
    }
    if (event.getType() == IEventConst.EVENT_TYPE_IDENTIFIED_CALL) {
        this.m_logger.info("Sending IDENTIFIED_CALL event to clients.");
        IHttpRequest request = new IdentifiedCallHandler((ICall) event.getData());
        this.sendRequest(event, request);
    }
    if (event.getType() == IEventConst.EVENT_TYPE_IDENTIFIED_OUTGOING_CALL) {
        this.m_logger.info("Sending IDENTIFIED_OUTGOING_CALL event to clients.");
        IHttpRequest request = new IdentifiedOutgoingCallHandler((ICall) event.getData());
        this.sendRequest(event, request);
    }
}
Also used : IHttpRequest(de.janrufmonitor.service.commons.http.IHttpRequest) ApplicationReadyHandler(de.janrufmonitor.service.server.request.handler.ApplicationReadyHandler) IdentifiedCallHandler(de.janrufmonitor.service.server.request.handler.IdentifiedCallHandler) ClearHandler(de.janrufmonitor.service.server.request.handler.ClearHandler) IncomingCallHandler(de.janrufmonitor.service.server.request.handler.IncomingCallHandler) OutgoingCallHandler(de.janrufmonitor.service.server.request.handler.OutgoingCallHandler) IdentifiedOutgoingCallHandler(de.janrufmonitor.service.server.request.handler.IdentifiedOutgoingCallHandler) AcceptHandler(de.janrufmonitor.service.server.request.handler.AcceptHandler) RejectedHandler(de.janrufmonitor.service.server.request.handler.RejectedHandler) IdentifiedOutgoingCallHandler(de.janrufmonitor.service.server.request.handler.IdentifiedOutgoingCallHandler)

Aggregations

IHttpRequest (de.janrufmonitor.service.commons.http.IHttpRequest)1 AcceptHandler (de.janrufmonitor.service.server.request.handler.AcceptHandler)1 ApplicationReadyHandler (de.janrufmonitor.service.server.request.handler.ApplicationReadyHandler)1 ClearHandler (de.janrufmonitor.service.server.request.handler.ClearHandler)1 IdentifiedCallHandler (de.janrufmonitor.service.server.request.handler.IdentifiedCallHandler)1 IdentifiedOutgoingCallHandler (de.janrufmonitor.service.server.request.handler.IdentifiedOutgoingCallHandler)1 IncomingCallHandler (de.janrufmonitor.service.server.request.handler.IncomingCallHandler)1 OutgoingCallHandler (de.janrufmonitor.service.server.request.handler.OutgoingCallHandler)1 RejectedHandler (de.janrufmonitor.service.server.request.handler.RejectedHandler)1