Commit 51e60be8 authored by Dele Olajide's avatar Dele Olajide Committed by dele

Rayo plugin - Added support for SIP over TCP transport

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13774 b35dd754-fafc-0310-a699-88a17e54d16e
parent c8b2a138
......@@ -166,7 +166,8 @@ public class SipServer implements SipListener {
return;
}
ListeningPoint lp = null;
ListeningPoint udpListenPort = null;
ListeningPoint tcpListenPort = null;
try {
/*
......@@ -176,28 +177,29 @@ public class SipServer implements SipListener {
* port to assign to outgoing messages from this provider
* at this point.
*/
String s = System.getProperty(
"gov.nist.jainsip.stack.enableUDP", String.valueOf(SIP_PORT));
String s = System.getProperty("com.sun.voip.server.SIP_PORT", String.valueOf(SIP_PORT));
int sipPort = Integer.parseInt(s);
int sipPort = Integer.parseInt(s);
lp = sipStack.createListeningPoint(sipPort, "tcp");
sipProvider = sipStack.createSipProvider(lp);
sipProvider.addSipListener(this);
Logger.println("");
Logger.println("Bridge private address: " + properties.getProperty("javax.sip.IP_ADDRESS"));
lp = sipStack.createListeningPoint(sipPort, "udp");
String protocol = System.getProperty("com.sun.voip.server.PROTOCOL");
sipAddress = new InetSocketAddress(sipStack.getIPAddress(), sipPort);
if ("tcp".equals(protocol))
{
tcpListenPort = sipStack.createListeningPoint(sipPort, "tcp");
sipProvider = sipStack.createSipProvider(tcpListenPort);
}
sipProvider = sipStack.createSipProvider(lp);
if ("udp".equals(protocol))
{
udpListenPort = sipStack.createListeningPoint(sipPort, "udp");
sipProvider = sipStack.createSipProvider(udpListenPort);
}
sipProvider.addSipListener(this);
Logger.println("");
Logger.println("Bridge private address: " + properties.getProperty("javax.sip.IP_ADDRESS"));
Logger.println("Bridge private SIP port: " + lp.getPort());
sipAddress = new InetSocketAddress(sipStack.getIPAddress(), sipPort);
/*
* get IPs of the SIP Proxy server
......
......@@ -556,8 +556,7 @@ if (false) {
* 152.70.1.43:5060 == (local address and SIP port)
* branch=z9hG4bk5 == (auto generated branch id)
*/
viaHeader = headerFactory.createViaHeader(ourIpAddress,
ourSipPort, "udp", null);
viaHeader = headerFactory.createViaHeader(ourIpAddress, ourSipPort, sipProvider.getListeningPoint().getTransport(), null);
//viaHeader.setBranch(MessageFactoryImpl.generateBranchId());
viaHeaders = new ArrayList();
viaHeaders.add(viaHeader);
......@@ -769,7 +768,8 @@ if (false) {
*/
Dialog dialog = clientTransaction.getDialog();
Request ackRequest = dialog.createRequest(Request.ACK);
//Request ackRequest = dialog.createRequest(Request.ACK);
Request ackRequest = clientTransaction.createAck();
dialog.sendAck(ackRequest);
return;
......
......@@ -44,6 +44,8 @@ public class Application implements CallEventListener {
System.setProperty("com.sun.voip.server.BRIDGE_LOG", "bridge.log");
System.setProperty("com.sun.voip.server.LOGLEVEL", "99");
System.setProperty("com.sun.voip.server.PUBLIC_IP_ADDRESS", config.getPublicHost());
System.setProperty("com.sun.voip.server.PROTOCOL", config.getDefaultProtocol());
System.setProperty("com.sun.voip.server.SIP_PORT", config.getDefaultSIPPort());
System.setProperty("com.sun.voip.server.Bridge.recordDirectory", pluginDirectory.getAbsolutePath() + File.separator + ".." + File.separator + ".." + File.separator + "rayo" + File.separator + "recordings");
System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
......
......@@ -40,6 +40,8 @@ public class Config implements MUCEventListener {
private String publicHost = JiveGlobals.getProperty("voicebridge.default.public.host", "127.0.0.1");
private String conferenceExten = JiveGlobals.getProperty("voicebridge.default.conf.exten", "default");
private String defaultProxy = JiveGlobals.getProperty("voicebridge.default.proxy.name", null);
private String defaultProtocol = JiveGlobals.getProperty("voicebridge.default.protocol", "udp");
private String defaultSIPPort = JiveGlobals.getProperty("voicebridge.default.sip.port", "5060");
private boolean prefixPhoneNumber = true;
private String internationalPrefix = "00"; // for international calls
......@@ -584,6 +586,14 @@ public class Config implements MUCEventListener {
{
return defaultProxy;
}
public String getDefaultProtocol()
{
return defaultProtocol;
}
public String getDefaultSIPPort()
{
return defaultSIPPort;
}
public ArrayList<String> getRegistrars()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment