Commit 5d005e91 authored by Dele Olajide's avatar Dele Olajide

Jitsi Videobridge plugin: Incoming SIP calls now works. Tested ok with iNums

parent 78ef972c
...@@ -156,6 +156,7 @@ public class CallSession ...@@ -156,6 +156,7 @@ public class CallSession
internalCallId = "CS" + String.format("%08x", nextInternalCallId++); internalCallId = "CS" + String.format("%08x", nextInternalCallId++);
offerPayloads.add(PAYLOAD_PCMU); offerPayloads.add(PAYLOAD_PCMU);
answerPayloads.add(PAYLOAD_PCMU);
try { try {
InetAddress bindAddr = InetAddress.getByName(host); InetAddress bindAddr = InetAddress.getByName(host);
...@@ -794,6 +795,7 @@ public class CallSession ...@@ -794,6 +795,7 @@ public class CallSession
if (bitRatePayload != null) if (bitRatePayload != null)
{ {
Payload p = new Payload(codec, name, clockRate, bitRatePayload.bitRate); Payload p = new Payload(codec, name, clockRate, bitRatePayload.bitRate);
if (offer) if (offer)
{ {
offerPayloads.add(p); offerPayloads.add(p);
......
...@@ -133,7 +133,8 @@ public class SipService ...@@ -133,7 +133,8 @@ public class SipService
public static String getLocalIP() public static String getLocalIP()
{ {
return localip; ListeningPoint lp = sipProvider.getListeningPoint(ListeningPoint.UDP);
return lp.getIPAddress();
} }
private void registerWithDefaultProxy() private void registerWithDefaultProxy()
......
...@@ -485,15 +485,21 @@ public class VideoBridgeSipListener implements SipListener ...@@ -485,15 +485,21 @@ public class VideoBridgeSipListener implements SipListener
if (cs != null) if (cs != null)
{ {
Log.info("[[SIP]] created call session : [[" + cs.internalCallId + "]]"); Log.info("[[SIP]] created call session : [[" + cs.internalCallId + "]]");
cs.parseInvite(req, dialog, trans);
dialog.setApplicationData(cs);
Response res = SipService.messageFactory.createResponse(Response.RINGING, req); Response res = SipService.messageFactory.createResponse(Response.RINGING, req);
trans.sendResponse(res); trans.sendResponse(res);
cs.parseInvite(req, dialog, trans);
dialog.setApplicationData(cs);
SipService.acceptCall(cs); SipService.acceptCall(cs);
return;
} else {
Response res = SipService.messageFactory.createResponse(Response.FORBIDDEN, req);
trans.sendResponse(res);
} }
return;
} else { } else {
// SIP RE-INVITE (dumbstart implementation, ignores timers, etc) // SIP RE-INVITE (dumbstart implementation, ignores timers, etc)
Log.info("[[SIP]] Got a re-invite!"); Log.info("[[SIP]] Got a re-invite!");
......
...@@ -661,7 +661,11 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -661,7 +661,11 @@ public class PluginImpl implements Plugin, PropertyEventListener
{ {
CallSession session = null; CallSession session = null;
String hostname = XMPPServer.getInstance().getServerInfo().getHostname(); String hostname = XMPPServer.getInstance().getServerInfo().getHostname();
String focusAgentName = "jitsi.videobridge." + to; String callerId = to;
if (callerId.indexOf("+") == 0) callerId = callerId.substring(1);
String focusAgentName = "jitsi.videobridge." + callerId;
if (sessions.containsKey(focusAgentName)) if (sessions.containsKey(focusAgentName))
{ {
...@@ -691,9 +695,6 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -691,9 +695,6 @@ public class PluginImpl implements Plugin, PropertyEventListener
session = new CallSession(mediaStream, hostname, focus, from); session = new CallSession(mediaStream, hostname, focus, from);
focus.callSessions.put(to, session); focus.callSessions.put(to, session);
session.jabberRemote = to;
session.jabberLocal = from;
} }
} }
} }
......
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