Oberfläche angepasst

This commit is contained in:
Normal
2019-06-09 00:02:20 +02:00
parent df6c26245d
commit 45600d2365
9 changed files with 383 additions and 52 deletions
+22 -3
View File
@@ -7,6 +7,7 @@ package model;
import gov.nist.javax.sip.DialogTimeoutEvent;
import gov.nist.javax.sip.SipListenerExt;
import gui.Hauptfenster;
import java.net.InetAddress;
import java.text.ParseException;
import java.util.*;
@@ -38,6 +39,7 @@ import logger.OhmLogger;
*/
public class VoIP implements SipListenerExt
{
Hauptfenster view; //später entfernen wegen Zugriff
private static final Logger lg = OhmLogger.getLogger();
SipFactory sipFactory; // Used to access the SIP API.
SipStack sipStack; // The SIP stack.
@@ -61,9 +63,9 @@ public class VoIP implements SipListenerExt
public VoIP() //Konstruktor für eigene Daten
public VoIP(Hauptfenster view) //Konstruktor für eigene Daten
{
this.view = view;
try
{
//wird an sich erstmal nicht gebraucht aber später sinnvoll um eigene Daten zu initialisieren
@@ -76,7 +78,7 @@ public class VoIP implements SipListenerExt
this.properties = new Properties();
this.properties.setProperty("javax.sip.STACK_NAME", "stack");
this.sipStack = this.sipFactory.createSipStack(this.properties);
this.messageFactory = this.sipFactory.createMessageFactory();
this.messageFactory = this.sipFactory.createMessageFactory();
this.headerFactory = this.sipFactory.createHeaderFactory();
this.addressFactory = this.sipFactory.createAddressFactory();
this.listeningPoint = this.sipStack.createListeningPoint(this.myIPAddress, this.myPort, this.protocolTyp);
@@ -119,6 +121,7 @@ public class VoIP implements SipListenerExt
request.addHeader(allow);
request.addHeader(expire);
this.sipProvider.sendRequest(request);
view.getTxtArea().append("Erfolgreiche Registierung\n");
lg.info("Erfolgreiches Senden der Registrierung");
}
public void sendInvitation(String sipaddresse, int serverPort)throws ParseException, InvalidArgumentException, SipException, SdpException
@@ -179,6 +182,7 @@ public class VoIP implements SipListenerExt
response.addHeader(allow);
response.addHeader(allowevents);
this.sipProvider.sendResponse(response);
view.getTxtArea().append("Server Option Request erfolgreich beantwortet\n");
lg.info("Erfolgreiches senden des Headers");
}
catch (ParseException | SipException ex)
@@ -189,6 +193,7 @@ public class VoIP implements SipListenerExt
//Aktive Kommunikation
else if ((Request.INVITE).equals(requestEvent.getRequest().getMethod())) // Invite von anderem Benutzer
{
view.getTxtArea().append("Werde von xxx angerufen");
lg.info("Hab Invitation bekommen");
try
{
@@ -359,6 +364,20 @@ public class VoIP implements SipListenerExt
return sessionDescription;
}
//Get Methoden falls man mal die Parameter braucht
public String getmyName()
{
return myName;
}
public Integer getMyPort()
{
return myPort;
}
public String getMyIPAdress()
{
return myIPAddress;
}
@Override
public void processTimeout(TimeoutEvent timeoutEvent)