Skip to content

Commit a0303fb

Browse files
author
Maria Farooq
committed
Merge branch 'master' into RESTCOMM-1032_1a_D1
* master: (23 commits) RESTCOMM-2000: check WebOlympusDomain before modifying olympus.xml added testing categories Added JProfiler to acknowledgements Fix Olympus configuration. Fix. RESTCOM-1935: Add extensionHeaders for Call authenticate Configure Web Olympus Domain. Added extra logging statement to check the callState at the end of a dial fork call flow Fix conf Script. Update #2741 Fixing tests compilation failing after latest master merge and fix from aziz on multiprovider extension for specific rule for calls between Olympus and PSTN Update #2741 making sure when using useSbc that we don't enable webRTC in SDP between RC and SBC. SBC will be responsible for DTLS termination and media interactions with WebRTC Clients Enable RCUSESBC configuration option. Enable USESBC configuration option. Fix issue where the SBC route is pushed twice on the INVITE Fixing failing tests, adding some for Dial with SBC and fixed registration removal in case of SBC being used Update #2741 Fixing wrong boolean assignment on disable SDP Patching and handling default ports Update #2741 Fixing wrong values in restcomm.xml from previous commit Update #2741 with support for disabling of NAT patching when an SBC is used in front of RC + test case for it. It fixes also broken tests in UserAgentManager #MSB-352 Handle Route Header for MultiProvider config. Add handling for B2BUA Motivation: - Push routes defined in MultiProvider outbound-voice config. Fixes. ...
2 parents a0e0b73 + b4163bc commit a0303fb

17 files changed

Lines changed: 2453 additions & 64 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ Continuous Integration and Delivery
5656

5757
Acknowledgements
5858
========
59-
Java Profiler sponsored by YourKit
60-
[![YourKit The Industry Leader in .NET & Java Profiling](https://www.yourkit.com/images/yk_logo.png)](https://www.yourkit.com/)
6159

62-
[See who has been contributing to RestComm](http://www.telestax.com/opensource/acknowledgments/)
60+
* [![YourKit The Industry Leader in .NET & Java Profiling](https://www.yourkit.com/images/yk_logo.png)](https://www.yourkit.com/) Java Profiler sponsored by YourKit
61+
62+
* [![JProfiler](https://www.ej-technologies.com/images/product_banners/jprofiler_large.png)](https://www.ej-technologies.com/products/jprofiler/overview.html) JProfiler Open Source License
63+
64+
---
65+
We also maintain a list of [all Restcomm contributors](http://www.telestax.com/opensource/acknowledgments/) on the Restcomm website, to acknowledge contributions by the broad open source community.

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/advanced.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,8 @@ CACHE_NO_WAV=false
152152

153153
#MSS Configuration
154154
TLS_CLIENT_AUTH_TYPE="Disabled" #Possible values Enabled, Want, Disabled,DisabledAll
155+
156+
#USESBC: Option to disable all patch for NAT (Includes patch-for-nat-b2bua-sessions,disable-sdp-patching-on-updating-mediasession)
157+
RCUSESBC=false
158+
#Domain to be used in the SIP URI <user>@<domain>. If not defined, it will default to the webapp host name.
159+
WebOlympusDomain=""

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/autoconfig.d/config-olympus.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,18 @@ FILE=$BASEDIR/standalone/deployments/olympus.war/resources/xml/olympus.xml
3838
}
3939

4040

41+
DomainConf(){
42+
#Configure Web Olympus Domain.
43+
FILE=$BASEDIR/standalone/deployments/olympus.war/resources/xml/olympus.xml
44+
echo "WebOlympusDomain: $WebOlympusDomain"
45+
if [ ! -z "${WebOlympusDomain}" ]; then
46+
xmlstarlet ed -L -P -u "/olympus/server/address" -v ${WebOlympusDomain} $FILE
47+
fi
48+
}
4149

4250

4351
# MAIN
4452
echo 'Configuring Olympus...'
4553
#Reload Variables
4654
olympusPortConf
55+
DomainConf

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/autoconfig.d/config-restcomm.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,10 @@ otherRestCommConf(){
687687
echo "CACHE_NO_WAV $CACHE_NO_WAV"
688688
sed -i "s|<cache-no-wav>.*</cache-no-wav>|<cache-no-wav>${CACHE_NO_WAV}</cache-no-wav>|" $FILE
689689

690+
#Configure USESBC
691+
echo "USESBC: $RCUSESBC"
692+
sed -i "s|<use-sbc>.*</use-sbc>|<use-sbc>${RCUSESBC}</use-sbc>|" $FILE
693+
690694
echo "End Rest RestComm configuration"
691695
}
692696

restcomm/restcomm.application/src/main/webapp/WEB-INF/conf/restcomm.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@
175175
If set to false RestComm will use the Request URI to determine the destination. -->
176176
<use-to>true</use-to>
177177

178+
<!-- if this flag is set to true, it will disable all patching done for NAT
179+
even if they are enabled in the configuration file-->
180+
<use-sbc>false</use-sbc>
181+
178182
<!-- If set to true Restcomm will use the Local Address (or external address
179183
if available) in the host part of the From header for calls to the outbound
180184
proxy. Default is False, which means that Restcomm will use outbound proxy

restcomm/restcomm.dao/src/test/java/org/restcomm/connect/dao/mybatis/ExtensionConfigurationDaoTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.joda.time.DateTime;
77
import org.junit.After;
88
import org.junit.Before;
9+
import org.junit.Ignore;
910
import org.junit.Test;
1011
import org.junit.experimental.categories.Category;
1112
import org.restcomm.connect.commons.annotations.UnstableTests;
@@ -28,6 +29,7 @@
2829
* Created by gvagenas on 21/10/2016.
2930
*/
3031
@Category(UnstableTests.class)
32+
@Ignore
3133
public class ExtensionConfigurationDaoTest {
3234
private static MybatisDaoManager manager;
3335
private MybatisExtensionsConfigurationDao extensionsConfigurationDao;

restcomm/restcomm.extension.controller/src/test/java/org.restcomm.connect.extension.controller/ExtensionsControllerTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919

2020
package org.restcomm.connect.extension.controller;
2121

22+
import java.util.List;
23+
24+
import javax.servlet.ServletContext;
25+
2226
import org.apache.log4j.Logger;
27+
import org.junit.After;
2328
import org.junit.Assert;
24-
import org.junit.Ignore;
2529
import org.junit.Test;
26-
import org.junit.experimental.categories.Category;
27-
import org.restcomm.connect.commons.annotations.UnstableTests;
2830
import org.restcomm.connect.commons.dao.Sid;
2931
import org.restcomm.connect.extension.api.ApiRequest;
3032
import org.restcomm.connect.extension.api.ExtensionRequest;
@@ -34,10 +36,6 @@
3436
import org.restcomm.connect.extension.api.RestcommExtension;
3537
import org.restcomm.connect.extension.api.RestcommExtensionGeneric;
3638

37-
import javax.servlet.ServletContext;
38-
import java.util.List;
39-
import org.junit.After;
40-
4139
public class ExtensionsControllerTest {
4240

4341
private static Logger logger = Logger.getLogger(ExtensionsControllerTest.class);

restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,6 +2896,10 @@ public void execute(final Object message) throws Exception {
28962896
return;
28972897
} else {
28982898
if (callState == CallStateChanged.State.IN_PROGRESS) {
2899+
if (logger.isInfoEnabled()) {
2900+
String msg = String.format("At finishDialingState, will ASK call to hangup. Current VI State %s Call State: %s ",state, callState);
2901+
logger.info(msg);
2902+
}
28992903
call.tell(new Hangup(), self());
29002904
} else {
29012905
if (logger.isInfoEnabled()) {

restcomm/restcomm.sms/src/main/java/org/restcomm/connect/sms/SmsService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ public SmsService(final Configuration configuration, final SipFactory factory,
151151
// final Configuration runtime = configuration.subset("runtime-settings");
152152
// TODO this.useTo = runtime.getBoolean("use-to");
153153
patchForNatB2BUASessions = runtime.getBoolean("patch-for-nat-b2bua-sessions", true);
154+
boolean useSbc = runtime.getBoolean("use-sbc", false);
155+
if(useSbc) {
156+
if (logger.isDebugEnabled()) {
157+
logger.debug("SmsService: use-sbc is true, overriding patch-for-nat-b2bua-sessions to false");
158+
}
159+
patchForNatB2BUASessions = false;
160+
}
154161

155162
extensions = ExtensionController.getInstance().getExtensions(ExtensionType.SmsService);
156163
if (logger.isInfoEnabled()) {

restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/util/B2BUAHelper.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,37 @@ public static boolean redirectToB2BUA(final ActorSystem system, final SipServlet
120120
final String aor = registration.getAddressOfRecord();
121121
SipURI to;
122122
SipURI from;
123-
to = (SipURI) sipFactory.createURI(location);
123+
SipURI locationURI = null;
124+
124125
Sid fromOrganizationSid = OrganizationUtil.getOrganizationSidBySipURIHost(storage, (SipURI) request.getFrom().getURI());
125126
// if both clients don't belong to same organization, call should not be allowed.
126127
if(!toOrganizationSid.equals(fromOrganizationSid)){
127128
logger.warn(String.format("B2B clients do not belong to same organization. from-client: %s belong to %s . where as to-client %s belong to %s", client.getLogin(), fromOrganizationSid, user, toOrganizationSid));
128129
return false;
129130
}
130-
from = (SipURI) sipFactory.createURI((registrations.getRegistration(client.getLogin(), fromOrganizationSid)).getLocation());
131+
if(patchForNat) {
132+
to = (SipURI) sipFactory.createURI(location);
133+
from = (SipURI) sipFactory.createURI((registrations.getRegistration(client.getLogin(), fromOrganizationSid)).getLocation());
134+
} else {
135+
// https://github.com/RestComm/Restcomm-Connect/issues/2741 support for SBC
136+
if (logger.isDebugEnabled()) {
137+
logger.debug("B2BUA not patched for NAT, using address of record for to and from");
138+
}
139+
to = (SipURI) sipFactory.createURI(aor);
140+
locationURI = (SipURI) sipFactory.createURI(location);
141+
from = (SipURI) sipFactory.createURI((registrations.getRegistration(client.getLogin(), fromOrganizationSid)).getAddressOfRecord());
142+
}
143+
131144
final SipSession incomingSession = request.getSession();
132145
// create and send the outgoing invite and do the session linking
133146
incomingSession.setAttribute(B2BUA_LAST_REQUEST, request);
134147
SipServletRequest outRequest = sipFactory.createRequest(request.getApplicationSession(), request.getMethod(),
135148
from, to);
136-
outRequest.setRequestURI(to);
149+
if(patchForNat) {
150+
outRequest.setRequestURI(to);
151+
} else {
152+
outRequest.setRequestURI(locationURI);
153+
}
137154

138155
if (request.getContent() != null) {
139156
final byte[] sdp = request.getRawContent();

0 commit comments

Comments
 (0)