This commit is contained in:
parent
8fbb5a96c8
commit
df6c26245d
@ -12,8 +12,10 @@ import java.awt.event.ActionListener;
|
||||
import java.text.ParseException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.sdp.SdpException;
|
||||
import javax.sip.InvalidArgumentException;
|
||||
import javax.sip.SipException;
|
||||
import logger.OhmLogger;
|
||||
import model.VoIP;
|
||||
|
||||
/**
|
||||
@ -22,6 +24,7 @@ import model.VoIP;
|
||||
*/
|
||||
public class CommandController implements ActionListener
|
||||
{
|
||||
private static final Logger lc = OhmLogger.getLogger();
|
||||
private VoIP model;
|
||||
private Hauptfenster view;
|
||||
public CommandController(VoIP model, Hauptfenster view)
|
||||
@ -33,26 +36,35 @@ public class CommandController implements ActionListener
|
||||
public void registerEvents()
|
||||
{
|
||||
view.getBtn1().addActionListener(this);
|
||||
view.getBtn2().addActionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e)
|
||||
{
|
||||
try
|
||||
Object key = e.getSource();
|
||||
if (key.equals(view.getBtn1()))
|
||||
{
|
||||
model.sendRegister("123123", 1);
|
||||
lc.info("Register Butten geklickt");
|
||||
try
|
||||
{
|
||||
model.sendRegister("123123", 1);
|
||||
}
|
||||
catch (ParseException|InvalidArgumentException|SipException ex)
|
||||
{
|
||||
lc.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
catch (ParseException ex)
|
||||
if(key.equals(view.getBtn2()))
|
||||
{
|
||||
Logger.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
catch (InvalidArgumentException ex)
|
||||
{
|
||||
Logger.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
catch (SipException ex)
|
||||
{
|
||||
Logger.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
try {
|
||||
lc.info("Invite Button geklickt");
|
||||
model.sendInvitation("23", 2);
|
||||
}
|
||||
catch (ParseException|InvalidArgumentException|SdpException|SipException ex) {
|
||||
lc.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
@ -60,12 +61,18 @@
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="btn1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="btn1"/>
|
||||
<Property name="text" type="java.lang.String" value="Register"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Registrierung am Server"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btn2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="btn2"/>
|
||||
<Property name="text" type="java.lang.String" value="Anrufen"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButton1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Annehmen"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
|
@ -83,6 +83,7 @@ public class Hauptfenster extends javax.swing.JFrame
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
btn1 = new javax.swing.JButton();
|
||||
btn2 = new javax.swing.JButton();
|
||||
jButton1 = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
|
||||
@ -93,12 +94,16 @@ public class Hauptfenster extends javax.swing.JFrame
|
||||
getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
|
||||
getContentPane().add(textField, java.awt.BorderLayout.PAGE_START);
|
||||
|
||||
btn1.setText("btn1");
|
||||
btn1.setText("Register");
|
||||
btn1.setToolTipText("Registrierung am Server");
|
||||
jPanel1.add(btn1);
|
||||
|
||||
btn2.setText("btn2");
|
||||
btn2.setText("Anrufen");
|
||||
jPanel1.add(btn2);
|
||||
|
||||
jButton1.setText("Annehmen");
|
||||
jPanel1.add(jButton1);
|
||||
|
||||
getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END);
|
||||
|
||||
pack();
|
||||
@ -157,6 +162,7 @@ public class Hauptfenster extends javax.swing.JFrame
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btn1;
|
||||
private javax.swing.JButton btn2;
|
||||
private javax.swing.JButton jButton1;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JTextField textField;
|
||||
|
57
src/logger/OhmLogger.java
Normal file
57
src/logger/OhmLogger.java
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import logger.myformatter.MyFormatter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author nobody
|
||||
*/
|
||||
public class OhmLogger
|
||||
{
|
||||
private static Logger lg = null;
|
||||
|
||||
public static Logger getLogger()
|
||||
{
|
||||
if (lg == null)
|
||||
{
|
||||
lg = Logger.getLogger("OhmLogger");
|
||||
initLogger();
|
||||
}
|
||||
return lg;
|
||||
}
|
||||
|
||||
private static void initLogger()
|
||||
{
|
||||
try
|
||||
{
|
||||
String datei = System.getProperty("java.io.tmpdir") + File.separator + "log.txt";
|
||||
FileHandler fh = new FileHandler(datei);
|
||||
ConsoleHandler ch = new ConsoleHandler();
|
||||
lg.setUseParentHandlers(false);
|
||||
lg.addHandler(fh);
|
||||
ch.setFormatter(new MyFormatter());
|
||||
lg.addHandler(ch);
|
||||
lg.setLevel(Level.ALL);
|
||||
}
|
||||
catch (IOException ioex)
|
||||
{
|
||||
System.err.println(ioex);
|
||||
}
|
||||
}
|
||||
|
||||
public OhmLogger()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
35
src/logger/myformatter/MyFormatter.java
Normal file
35
src/logger/myformatter/MyFormatter.java
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package logger.myformatter;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author nobody
|
||||
*/
|
||||
public class MyFormatter extends SimpleFormatter
|
||||
{
|
||||
private String message;
|
||||
private final Date dat = new Date();
|
||||
|
||||
@Override
|
||||
public String format(LogRecord record)
|
||||
{
|
||||
dat.setTime(record.getMillis());
|
||||
message = "| " + dat + " | " + record.getLevel() + " | "
|
||||
+ record.getSourceClassName() + " | " + record.getMessage() + " |\n";
|
||||
|
||||
return message;
|
||||
}
|
||||
public MyFormatter()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -30,6 +30,7 @@ import javax.sip.TransactionTerminatedEvent;
|
||||
import javax.sip.address.*;
|
||||
import javax.sip.header.*;
|
||||
import javax.sip.message.*;
|
||||
import logger.OhmLogger;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -37,6 +38,7 @@ import javax.sip.message.*;
|
||||
*/
|
||||
public class VoIP implements SipListenerExt
|
||||
{
|
||||
private static final Logger lg = OhmLogger.getLogger();
|
||||
SipFactory sipFactory; // Used to access the SIP API.
|
||||
SipStack sipStack; // The SIP stack.
|
||||
SipProvider sipProvider; // Used to send SIP messages.
|
||||
@ -45,7 +47,7 @@ public class VoIP implements SipListenerExt
|
||||
AddressFactory addressFactory; // Used to create SIP URIs.
|
||||
ListeningPoint listeningPoint; // SIP listening IP address/port.
|
||||
Properties properties; // Other properties.
|
||||
|
||||
|
||||
private int counter;
|
||||
private int myPort = 5060;
|
||||
|
||||
@ -56,6 +58,8 @@ public class VoIP implements SipListenerExt
|
||||
private int branch = hashCode();
|
||||
Address contactAddress;
|
||||
private ContactHeader contactHeader;
|
||||
|
||||
|
||||
|
||||
public VoIP() //Konstruktor für eigene Daten
|
||||
{
|
||||
@ -64,7 +68,9 @@ public class VoIP implements SipListenerExt
|
||||
{
|
||||
//wird an sich erstmal nicht gebraucht aber später sinnvoll um eigene Daten zu initialisieren
|
||||
String abc = InetAddress.getLocalHost().getHostAddress();
|
||||
|
||||
this.myIPAddress = InetAddress.getLocalHost().getHostAddress();
|
||||
|
||||
this.sipFactory = SipFactory.getInstance();
|
||||
this.sipFactory.setPathName("gov.nist");
|
||||
this.properties = new Properties();
|
||||
@ -95,13 +101,12 @@ public class VoIP implements SipListenerExt
|
||||
|
||||
public void sendRegister(String serverIP, int serverPort) throws ParseException, InvalidArgumentException, SipException
|
||||
{
|
||||
System.out.println("-----------SendRegister-----------");
|
||||
lg.info("Vorbereiten des Registrierungs Headers");
|
||||
Address addressto = this.addressFactory.createAddress("sip:192.168.100.11"); //evtl. mit Port: sip:192.168.100.11:5060
|
||||
Address addresstob = this.addressFactory.createAddress("sip:192.168.100.11"); //to get example maybe needed
|
||||
ToHeader to = this.headerFactory.createToHeader(addresstob, null); // Integer.toString(tag) address + tag
|
||||
ToHeader to = this.headerFactory.createToHeader(addressto, null); // Integer.toString(tag) address + tag
|
||||
URI requestURI = addressto.getURI();
|
||||
CallIdHeader callId = this.sipProvider.getNewCallId();
|
||||
FromHeader from = this.headerFactory.createFromHeader(addresstob, String.valueOf(this.tag)); //this.contactAddress
|
||||
FromHeader from = this.headerFactory.createFromHeader(addressto, String.valueOf(this.tag)); //this.contactAddress
|
||||
ArrayList via = new ArrayList(); //Via needs a List as input
|
||||
ViaHeader viaheader = this.headerFactory.createViaHeader(this.myIPAddress, this.myPort, "UDP", String.valueOf(branch));
|
||||
via.add(viaheader);
|
||||
@ -109,14 +114,39 @@ public class VoIP implements SipListenerExt
|
||||
MaxForwardsHeader maxForwards = this.headerFactory.createMaxForwardsHeader(70);
|
||||
AllowHeader allow = this.headerFactory.createAllowHeader("NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS,MESSAGE");
|
||||
ExpiresHeader expire = this.headerFactory.createExpiresHeader(3600); //int value
|
||||
//Create Request Header
|
||||
System.out.println("----REQUEST HEADER----");
|
||||
Request request = this.messageFactory.createRequest(requestURI, "REGISTER", callId, cSeq, from, to, via, maxForwards);
|
||||
request.addHeader(contactHeader);
|
||||
request.addHeader(allow);
|
||||
request.addHeader(expire);
|
||||
this.sipProvider.sendRequest(request);
|
||||
lg.info("Erfolgreiches Senden der Registrierung");
|
||||
}
|
||||
public void sendInvitation(String sipaddresse, int serverPort)throws ParseException, InvalidArgumentException, SipException, SdpException
|
||||
{
|
||||
Address addressto = this.addressFactory.createAddress(sipaddresse); //evtl. mit Port: sip:192.168.100.11:5060
|
||||
ToHeader to = this.headerFactory.createToHeader(addressto, null); // Integer.toString(tag) address + tag
|
||||
URI requestURI = addressto.getURI();
|
||||
CallIdHeader callId = this.sipProvider.getNewCallId();
|
||||
FromHeader from = this.headerFactory.createFromHeader(addressto, String.valueOf(this.tag)); //this.contactAddress
|
||||
ArrayList via = new ArrayList(); //Via needs a List as input
|
||||
ViaHeader viaheader = this.headerFactory.createViaHeader(this.myIPAddress, this.myPort, "UDP", String.valueOf(branch));
|
||||
via.add(viaheader);
|
||||
CSeqHeader cSeq = this.headerFactory.createCSeqHeader(1L, "INVITE");
|
||||
MaxForwardsHeader maxForwards = this.headerFactory.createMaxForwardsHeader(70);
|
||||
AllowHeader allow = this.headerFactory.createAllowHeader("NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS,MESSAGE");
|
||||
ExpiresHeader expire = this.headerFactory.createExpiresHeader(3600); //int value
|
||||
Request request = this.messageFactory.createRequest(requestURI, "REGISTER", callId, cSeq, from, to, via, maxForwards);
|
||||
request.addHeader(contactHeader);
|
||||
request.addHeader(allow);
|
||||
request.addHeader(expire);
|
||||
|
||||
ContentTypeHeader content = headerFactory.createContentTypeHeader("application", "sdp");
|
||||
request.addHeader(content);
|
||||
request.setContent(createSDPHeader(), content);
|
||||
System.out.println("---Invitation Header---");
|
||||
System.out.println(request);
|
||||
this.sipProvider.sendRequest(request);
|
||||
//lg.info("Erfolgreiches Senden der Invitation");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -127,11 +157,11 @@ public class VoIP implements SipListenerExt
|
||||
@Override
|
||||
public void processRequest(RequestEvent requestEvent)
|
||||
{
|
||||
System.out.println("----Bekomme Anfrage----");
|
||||
lg.info("Bekomme Anfrage");
|
||||
//Kommunikation mit Server das man zur Verfügung steht
|
||||
if ((Request.OPTIONS).equals(requestEvent.getRequest().getMethod())) //Options Anfrage von Server nach erfolgreicher Registrierung
|
||||
{
|
||||
System.out.println("200 OK zu Server");
|
||||
lg.info("Option Request von Server, erstellen 200 OK zu Server");
|
||||
try
|
||||
{
|
||||
Response response = this.messageFactory.createResponse(200, requestEvent.getRequest());
|
||||
@ -149,23 +179,23 @@ public class VoIP implements SipListenerExt
|
||||
response.addHeader(allow);
|
||||
response.addHeader(allowevents);
|
||||
this.sipProvider.sendResponse(response);
|
||||
lg.info("Erfolgreiches senden des Headers");
|
||||
}
|
||||
catch (ParseException | SipException ex)
|
||||
{
|
||||
Logger.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
|
||||
lg.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
//Aktive Kommunikation
|
||||
else if ((Request.INVITE).equals(requestEvent.getRequest().getMethod())) // Invite von anderem Benutzer
|
||||
{
|
||||
System.out.println("Hab invitation bekommen");
|
||||
System.out.println("Gleich antworte ich");
|
||||
lg.info("Hab Invitation bekommen");
|
||||
try
|
||||
{
|
||||
//Trying Message to Server (Response Trying)
|
||||
|
||||
System.out.println("----REquest HEader----");
|
||||
Response responsetry = this.messageFactory.createResponse(100, requestEvent.getRequest());
|
||||
|
||||
responsetry.addHeader((ViaHeader) requestEvent.getRequest().getHeader("Via"));
|
||||
responsetry.addHeader((FromHeader) requestEvent.getRequest().getHeader("From"));
|
||||
responsetry.addHeader((ToHeader) requestEvent.getRequest().getHeader("To"));
|
||||
@ -178,7 +208,7 @@ public class VoIP implements SipListenerExt
|
||||
responsetry.addHeader(supp);
|
||||
responsetry.addHeader(allow);
|
||||
this.sipProvider.sendResponse(responsetry);
|
||||
System.out.println("Trying ist raus");
|
||||
lg.info("Trying ist raus");
|
||||
|
||||
//Ringing Message to Server (Responste Ringing)
|
||||
Response responsering = this.messageFactory.createResponse(180, requestEvent.getRequest());
|
||||
@ -216,44 +246,11 @@ public class VoIP implements SipListenerExt
|
||||
okandSDP.addHeader(allow);
|
||||
okandSDP.addHeader(allowevent);
|
||||
ContentTypeHeader content = headerFactory.createContentTypeHeader("application", "sdp");
|
||||
|
||||
//Create Session Description Body
|
||||
SdpFactory sdpFactory = SdpFactory.getInstance();
|
||||
SessionDescription sessionDescription = sdpFactory.createSessionDescription();
|
||||
sessionDescription.setOrigin(sdpFactory.createOrigin(myName, 8000, 8000, "IN", "IP4", myIPAddress));
|
||||
sessionDescription.setSessionName(sdpFactory.createSessionName("SIP Call"));
|
||||
sessionDescription.setConnection(sdpFactory.createConnection("IN", "IP4", myIPAddress));
|
||||
|
||||
//Media Body
|
||||
String sdpformat[] =
|
||||
{
|
||||
"0", "4", "18",
|
||||
};
|
||||
Vector mediavec = new Vector();
|
||||
mediavec.add(sdpFactory.createMediaDescription("audio", 6022, 1, "RTP/AVP", sdpformat));
|
||||
|
||||
//Media Attribute
|
||||
mediavec.add(sdpFactory.createAttribute("sendrecv", null));
|
||||
mediavec.add(sdpFactory.createAttribute("rtpmap", "0 PCMU/8000"));
|
||||
mediavec.add(sdpFactory.createAttribute("rtpmap", "4 G723/8000"));
|
||||
mediavec.add(sdpFactory.createAttribute("rtpmap", "18 G729A/8000"));
|
||||
mediavec.add(sdpFactory.createAttribute("ptime", "20"));
|
||||
|
||||
sessionDescription.setAttributes(mediavec);
|
||||
|
||||
|
||||
System.out.println("---Beispiel Header---");
|
||||
/*
|
||||
String contentparam = "v=0\r\n" + "o=129 1202 1202" + " IN IP4 192.168.100.247\r\n" + "s=SIP Call\r\n"
|
||||
+ "c=192.168.100.247\r\n" + "t=0 0\r\n" + "m=audio 6022 RTP/AVP 0 4 18\r\n"
|
||||
+ "a=rtpmap:0 PCMU/8000\r\n" + "a=rtpmap:4 G723/8000\r\n" + "a=rtpmap:18 G729A/8000\r\n" +
|
||||
"a=ptime:20\r\n";
|
||||
*/
|
||||
okandSDP.addHeader(content);
|
||||
okandSDP.setContent(sessionDescription, content);
|
||||
okandSDP.setContent(createSDPHeader(), content);
|
||||
System.out.println(okandSDP);
|
||||
this.sipProvider.sendResponse(okandSDP);
|
||||
}
|
||||
}
|
||||
catch (ParseException | SipException | SdpException ex)
|
||||
{
|
||||
Logger.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
|
||||
@ -316,23 +313,52 @@ public class VoIP implements SipListenerExt
|
||||
request.addHeader(allow);
|
||||
request.addHeader(expire);
|
||||
request.addHeader(auth);
|
||||
//System.out.println(request);
|
||||
this.sipProvider.sendRequest(request);
|
||||
}
|
||||
catch (ParseException | SipException | InvalidArgumentException ex)
|
||||
{
|
||||
Logger.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
|
||||
lg.getLogger(VoIP.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}
|
||||
else if (responseEvent.getResponse().getStatusCode() == Response.OK)
|
||||
{
|
||||
//System.out.println("responseEvent.getResponse()" + responseEvent.getResponse());
|
||||
System.out.println("Server hat Registrierung akzeptiert");
|
||||
|
||||
lg.info("Erfolgreichen Response (200 OK) bekommen");
|
||||
}
|
||||
|
||||
}
|
||||
public SessionDescription createSDPHeader() throws SdpException
|
||||
{
|
||||
/*
|
||||
String contentparam = "v=0\r\n" + "o=129 1202 1202" + " IN IP4 192.168.100.247\r\n" + "s=SIP Call\r\n"
|
||||
+ "c=192.168.100.247\r\n" + "t=0 0\r\n" + "m=audio 6022 RTP/AVP 0 4 18\r\n"
|
||||
+ "a=rtpmap:0 PCMU/8000\r\n" + "a=rtpmap:4 G723/8000\r\n" + "a=rtpmap:18 G729A/8000\r\n" +
|
||||
"a=ptime:20\r\n";
|
||||
*/
|
||||
SdpFactory sdpFactory = SdpFactory.getInstance();
|
||||
SessionDescription sessionDescription = sdpFactory.createSessionDescription();
|
||||
sessionDescription.setOrigin(sdpFactory.createOrigin(myName, 8000, 8000, "IN", "IP4", myIPAddress));
|
||||
sessionDescription.setSessionName(sdpFactory.createSessionName("SIP Call"));
|
||||
sessionDescription.setConnection(sdpFactory.createConnection("IN", "IP4", myIPAddress));
|
||||
|
||||
//Media Body
|
||||
String sdpformat[] =
|
||||
{
|
||||
"0", "4", "18",
|
||||
};
|
||||
Vector mediavec = new Vector();
|
||||
mediavec.add(sdpFactory.createMediaDescription("audio", 6022, 1, "RTP/AVP", sdpformat)); //(Übertragungstyp, Port, anzahl der Ports, Verbindungstyp,..)
|
||||
//Media Attribute
|
||||
mediavec.add(sdpFactory.createAttribute("sendrecv", null));
|
||||
mediavec.add(sdpFactory.createAttribute("rtpmap", "0 PCMU/8000"));
|
||||
mediavec.add(sdpFactory.createAttribute("rtpmap", "4 G723/8000"));
|
||||
mediavec.add(sdpFactory.createAttribute("rtpmap", "18 G729A/8000"));
|
||||
mediavec.add(sdpFactory.createAttribute("ptime", "20"));
|
||||
|
||||
sessionDescription.setAttributes(mediavec);
|
||||
|
||||
return sessionDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processTimeout(TimeoutEvent timeoutEvent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user