Browse Source

Ergänzung, Kommentar was bei SIP noch fehlt

RTP
Jan 5 years ago
parent
commit
057148f77f

+ 3
- 3
src/controller/CommandController.java View File

@@ -15,7 +15,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Logger;
import logger.OhmLogger;
import model.VoIP;
import model.SIPmodel;

/**
*
@@ -25,10 +25,10 @@ import model.VoIP;
public class CommandController implements ActionListener
{
private static final Logger lc = OhmLogger.getLogger();
private VoIP model;
private SIPmodel model;
private Hauptfenster view;
private CommandInvoker invoker;
public CommandController(VoIP model, Hauptfenster view)
public CommandController(SIPmodel model, Hauptfenster view)
{
this.model = model;
this.view = view;

+ 2
- 1
src/controller/CommandInterface.java View File

@@ -8,7 +8,8 @@ package controller;
/**
*
* @author Jan
* wird an sich noch nicht gebraucht aber später noch nützlich
* momentan wird nur execute gebraucht, undo später sinnvoll bzw. vielleicht
* bei cancel von Invite oder Anruf statt Anruf beenden.
*/
public interface CommandInterface
{

+ 3
- 3
src/controller/commands/CommandAnnehmen.java View File

@@ -10,7 +10,7 @@ import controller.CommandInterface;
import gui.Hauptfenster;
import java.util.logging.Logger;
import logger.OhmLogger;
import model.VoIP;
import model.SIPmodel;

/**
*
@@ -22,9 +22,9 @@ import model.VoIP;
public class CommandAnnehmen implements CommandInterface
{
private static final Logger lginvite = OhmLogger.getLogger();
private VoIP model;
private SIPmodel model;
private Hauptfenster view;
public CommandAnnehmen(VoIP model, Hauptfenster view)
public CommandAnnehmen(SIPmodel model, Hauptfenster view)
{
this.model = model;
this.view = view;

+ 5
- 3
src/controller/commands/CommandBeenden.java View File

@@ -10,19 +10,21 @@ import controller.CommandInterface;
import gui.Hauptfenster;
import java.util.logging.Logger;
import logger.OhmLogger;
import model.VoIP;
import model.SIPmodel;

/**
*
* @author Jan
* Muss noch komplett implementiert werden
* -> Bye bei laufendem Gespräch
* -> Cancel bei laufender Anfrage
*/
public class CommandBeenden implements CommandInterface
{
private static final Logger lginvite = OhmLogger.getLogger();
private VoIP model;
private SIPmodel model;
private Hauptfenster view;
public CommandBeenden(VoIP model, Hauptfenster view)
public CommandBeenden(SIPmodel model, Hauptfenster view)
{
this.model = model;
this.view = view;

+ 3
- 3
src/controller/commands/CommandInvite.java View File

@@ -15,7 +15,7 @@ import javax.sdp.SdpException;
import javax.sip.InvalidArgumentException;
import javax.sip.SipException;
import logger.OhmLogger;
import model.VoIP;
import model.SIPmodel;

/**
*
@@ -25,9 +25,9 @@ import model.VoIP;
public class CommandInvite implements CommandInterface
{
private static final Logger lginvite = OhmLogger.getLogger();
private VoIP model;
private SIPmodel model;
private Hauptfenster view;
public CommandInvite(VoIP model, Hauptfenster view)
public CommandInvite(SIPmodel model, Hauptfenster view)
{
this.model = model;
this.view = view;

+ 3
- 3
src/controller/commands/CommandRegister.java View File

@@ -14,7 +14,7 @@ import java.util.logging.Logger;
import javax.sip.InvalidArgumentException;
import javax.sip.SipException;
import logger.OhmLogger;
import model.VoIP;
import model.SIPmodel;

/**
*
@@ -24,9 +24,9 @@ import model.VoIP;
public class CommandRegister implements CommandInterface
{
private static final Logger lgregister = OhmLogger.getLogger();
private VoIP model;
private SIPmodel model;
private Hauptfenster view;
public CommandRegister(VoIP model, Hauptfenster view)
public CommandRegister(SIPmodel model, Hauptfenster view)
{
this.model = model;
this.view = view;

+ 1
- 1
src/logger/OhmLogger.java View File

@@ -14,7 +14,7 @@ import java.util.logging.Logger;
import logger.myformatter.MyFormatter;

/**
*
* nobody
*
*/
public class OhmLogger

src/model/VoIP.java → src/model/SIPmodel.java View File

@@ -36,9 +36,9 @@ import logger.OhmLogger;
/**
*
* @author Jan
* komplettes Model für VoIP
komplettes Model für SIPmodel
*/
public class VoIP implements SipListenerExt
public class SIPmodel implements SipListenerExt
{
Hauptfenster view; //später entfernen wegen Zugriff
private static final Logger lg = OhmLogger.getLogger();
@@ -72,7 +72,7 @@ public class VoIP implements SipListenerExt
Address contactAddress;
private ContactHeader contactHeader;

public VoIP(Hauptfenster view) //Konstruktor für eigene Daten
public SIPmodel(Hauptfenster view) //Konstruktor für eigene Daten
{
this.view = view;
invite = true;
@@ -209,7 +209,7 @@ public class VoIP implements SipListenerExt
}
catch (ParseException | SipException ex)
{
lg.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
lg.getLogger(SIPmodel.class.getName()).log(Level.SEVERE, null, ex);
}
}
//Aktive Kommunikation
@@ -293,7 +293,7 @@ public class VoIP implements SipListenerExt
}
catch (ParseException | SipException | InvalidArgumentException ex)
{
lg.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
lg.getLogger(SIPmodel.class.getName()).log(Level.SEVERE, null, ex);
}

}
@@ -335,7 +335,7 @@ public class VoIP implements SipListenerExt
mediavec.add(sdpFactory.createAttribute("rtpmap", "18 G729/8000"));
mediavec.add(sdpFactory.createAttribute("ptime", "20"));
}
else
else//Vergleich von eigenen Codecs mit Codecs der anruft und Rückgabe entsprechend wählen
{

}
@@ -354,7 +354,6 @@ public class VoIP implements SipListenerExt
try
{
//Trying Message to Server (Response Trying)
Response responsetry = this.messageFactory.createResponse(100, requestEvent.getRequest());
responsetry.addHeader((ViaHeader) requestEvent.getRequest().getHeader("Via"));
responsetry.addHeader((FromHeader) requestEvent.getRequest().getHeader("From"));
@@ -416,7 +415,7 @@ public class VoIP implements SipListenerExt
}
catch (ParseException | SipException | SdpException ex)
{
Logger.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(SIPmodel.class.getName()).log(Level.SEVERE, null, ex);

}
}
@@ -449,26 +448,26 @@ public class VoIP implements SipListenerExt
@Override
public void processTimeout(TimeoutEvent timeoutEvent)
{
view.getTxtArea().append("processTimeout\n");
//view.getTxtArea().append("processTimeout\n");
}

@Override
public void processIOException(IOExceptionEvent exceptionEvent)
{
view.getTxtArea().append("processIOException\n");
//view.getTxtArea().append("processIOException\n");
}

@Override
public void processTransactionTerminated(
TransactionTerminatedEvent transactionTerminatedEvent)
{
view.getTxtArea().append("processTransactionTerminated\n");
//view.getTxtArea().append("processTransactionTerminated\n");
}

@Override
public void processDialogTerminated(
DialogTerminatedEvent dialogTerminatedEvent)
{
view.getTxtArea().append("processDialogTerminated\n");
//view.getTxtArea().append("processDialogTerminated\n");
}
}

+ 2
- 2
src/phone/Start.java View File

@@ -11,7 +11,7 @@ import gui.Hauptfenster;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.ParseException;
import model.VoIP;
import model.SIPmodel;
/**
* Builder Class / Start Klasse des Programmes
* @author Jan
@@ -21,7 +21,7 @@ public class Start
public Start() throws ParseException, UnknownHostException
{
Hauptfenster view = new Hauptfenster();
VoIP model = new VoIP(view);
SIPmodel model = new SIPmodel(view);
CommandController controller = new CommandController(model, view);
controller.registerEvents();

Loading…
Cancel
Save