Skip to content

Commit e9ec3be

Browse files
author
Maria Farooq
committed
Merge branch 'master' into issue-2073
* master: (37 commits) closed #2341 - Patch for Recording and Dial with record, race condition - Patch for DialStatusCallback to don't execute the same state more than once This close #2332 This close #2335 Work in progress for issue #2332 Modified test case to test child behavior on parent termination This refer to #2274 Configure 'rvdUrl' in dashboard.json from advanced.conf/RVD_URL TLS_CLIENT_AUTH_TYPE configuration option. Fixes #2328 - config-rvd.sh if/then/else syntax bug Merge Issue-2274 with origin/master Testsuite improvements added ActorSupervisorStrategyTest RestcommSupervisorStrategy.getStrategy() Patch to don't block call actor on Stopping state waiting for MmsCallController response This close #2261 added ActorSupervisorStrategyTest trying blackhub copilot Integrating black duck software copilot for license check fixed #2319 hangupOnEnd default value bugfix Patch for race condition for Calls that execute Record verb and receive a Bye from client. This close #2313 added DTMF_DETECTOR_TONE_INTERVAL #2303 added MEDIA_MAX_DURATION #2317 ... Conflicts resolved: restcomm/restcomm.monitoring.service/src/main/java/org/restcomm/connect/monitoringservice/MonitoringService.java restcomm/restcomm.mrb/src/main/java/org/restcomm/connect/mrb/MediaResourceBrokerGeneric.java restcomm/restcomm.sms/src/main/java/org/restcomm/connect/sms/SmsSession.java restcomm/restcomm.sms/src/main/java/org/restcomm/connect/sms/smpp/SmppMessageHandler.java restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/CallManager.java restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/ua/UserAgentManager.java restcomm/restcomm.ussd/src/main/java/org/restcomm/connect/ussd/telephony/UssdCallManager.java
2 parents cea494b + 4129587 commit e9ec3be

File tree

156 files changed

+7491
-1852
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+7491
-1852
lines changed

Diff for: .travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ addons:
1919
organization: "restcomm-connect" # the key of the org you chose at step #3
2020
script:
2121
- ./build.sh
22+
after_success:
23+
- cd restcomm
24+
- mvn com.blackducksoftware.integration:hub-maven-plugin:2.0.2:build-bom -Dhub.output.directory=. -Dhub.deploy.bdio=false
25+
- bash <(curl -s https://copilot.blackducksoftware.com/bash/travis) ./*_bdio.jsonld
2226
# Problem to run testsuite https://github.com/travis-ci/travis-ci/issues/1382
2327
# - echo "About to run sonar-scanner"
2428
# - cd restcomm

Diff for: restcomm/configuration/config-scripts/as7-config-scripts/restcomm/advanced.conf

+3
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,6 @@ HTTP_RESPONSE_TIMEOUT=6000
143143

144144
# If set to true RestComm will NOT use cache for *.wav files playback.If set to false RestComm will use cache for *.wav files playback.
145145
CACHE_NO_WAV=false
146+
147+
#MSS Configuration
148+
TLS_CLIENT_AUTH_TYPE="Disabled" #Possible values Enabled, Want, Disabled,DisabledAll

Diff for: restcomm/configuration/config-scripts/as7-config-scripts/restcomm/autoconfig.d/config-SecureSSL.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ CertConfigure(){
142142
MssStackConf(){
143143
FILE=$RESTCOMM_CONF/mss-sip-stack.properties
144144

145-
if grep -q 'gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE=Disabled' "$FILE"; then
146-
sed -i '/gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE=Disabled/,+5d' $FILE
145+
if grep -q "gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE=${TLS_CLIENT_AUTH_TYPE}" "$FILE"; then
146+
sed -i '/gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE='"$TLS_CLIENT_AUTH_TYPE"'/,+5d' $FILE
147147
fi
148148

149149
if [[ "$TRUSTSTORE_FILE" = /* ]]; then
@@ -157,7 +157,7 @@ MssStackConf(){
157157

158158

159159
sed -i '/org.mobicents.ha.javax.sip.LOCAL_SSL_PORT='"$HTTPS_PORT"'/ a \
160-
\gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE=Disabled\
160+
\gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE='"$TLS_CLIENT_AUTH_TYPE"'\
161161
\javax.net.ssl.keyStore='"$TRUSTSTORE_LOCATION"'\
162162
\javax.net.ssl.keyStorePassword='" $TRUSTSTORE_PASSWORD"'\
163163
\javax.net.ssl.trustStorePassword='"$TRUSTSTORE_PASSWORD"'\
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
##
3+
## Configures dashboard.json based on global configuration options in restcomm.conf and advanced.conf.
4+
##
5+
## requirements:
6+
##
7+
## RESTCOMM_HOME env variable to be set
8+
## dashboard.json should be in place (under $RESTCOMM_HOME/standalone/deployments/restcomm-management.war)
9+
##
10+
## Author: [email protected] - Orestis Tsakiridis
11+
12+
echo "Configuring Dashboard..."
13+
14+
15+
# MAIN
16+
if [ -z "$RESTCOMM_HOME" ]
17+
then
18+
echo "RESTCOMM_HOME env variable not set. Aborting."
19+
exit 1
20+
fi
21+
22+
23+
# Variables
24+
DASHBOARD_ROOT="$RESTCOMM_HOME"/standalone/deployments/restcomm-management.war
25+
DASHBOARD_JSON_FILE="$DASHBOARD_ROOT"/conf/dashboard.json
26+
27+
sed -i "s|\"rvdUrl\":\"[^\"]*\"|\"rvdUrl\":\"$RVD_URL/restcomm-rvd\"|" "$DASHBOARD_JSON_FILE"
28+
29+
echo "Dasboard configured:"
30+
cat $DASHBOARD_JSON_FILE

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

+20-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##
33
## Description: Configures RestComm
44
## Author: Lefteris Banos ([email protected])
@@ -13,33 +13,28 @@ if [ ! -d "$BASEDIR/standalone/deployments/olympus.war" ]; then
1313
mv -f $BASEDIR/standalone/deployments/olympus-exploded.war $BASEDIR/standalone/deployments/olympus.war
1414
fi
1515

16-
#Set Olympus port if WSS is used.
16+
# Set Olympus ports
1717
olympusPortConf(){
18-
FILE=$BASEDIR/standalone/deployments/olympus.war/resources/js/controllers/register.js
19-
20-
#Check for Por Offset
21-
local SIP_PORT_WS=$((SIP_PORT_WS + PORT_OFFSET))
22-
local SIP_PORT_WSS=$((SIP_PORT_WSS + PORT_OFFSET))
23-
24-
if [ -n "$SECURESSL" ]; then
25-
sed -i "s|ws:|wss:|" $FILE
26-
if [ "$ACTIVATE_LB" == "true" ] || [ "$ACTIVATE_LB" == "TRUE" ]; then
27-
sed -i "s|\$scope.serverAddress + ':[0-9][0-9]*'|\$scope.serverAddress + ':${LB_EXTERNAL_PORT_WSS}'|" $FILE
28-
sed -i "s|\$scope.serverPort = '[0-9][0-9]*';|\$scope.serverPort = '${LB_EXTERNAL_PORT_WSS}';|" $FILE
29-
else
30-
sed -i "s|\$scope.serverAddress + ':[0-9][0-9]*'|\$scope.serverAddress + ':${SIP_PORT_WSS}'|" $FILE
31-
sed -i "s|\$scope.serverPort = '[0-9][0-9]*';|\$scope.serverPort = '${SIP_PORT_WSS}';|" $FILE
32-
fi
18+
FILE=$BASEDIR/standalone/deployments/olympus.war/resources/xml/olympus.xml
19+
20+
# Check for Port Offset
21+
local SIP_PORT_WS=$((SIP_PORT_WS + PORT_OFFSET))
22+
local SIP_PORT_WSS=$((SIP_PORT_WSS + PORT_OFFSET))
23+
24+
if [ -n "$SECURESSL" ]; then
25+
xmlstarlet ed -L -P -u "/olympus/server/@secure" -v "true" $FILE
3326
else
27+
xmlstarlet ed -L -P -u "/olympus/server/@secure" -v "false" $FILE
28+
fi
29+
30+
if [ "$ACTIVATE_LB" == "true" ] || [ "$ACTIVATE_LB" == "TRUE" ]; then
31+
xmlstarlet ed -L -P -u "/olympus/server/port" -v ${LB_EXTERNAL_PORT_WS} $FILE
32+
xmlstarlet ed -L -P -u "/olympus/server/secure-port" -v ${LB_EXTERNAL_PORT_WSS} $FILE
33+
else
34+
xmlstarlet ed -L -P -u "/olympus/server/port" -v ${SIP_PORT_WS} $FILE
35+
xmlstarlet ed -L -P -u "/olympus/server/secure-port" -v ${SIP_PORT_WSS} $FILE
36+
fi
3437

35-
if [ "$ACTIVATE_LB" == "true" ] || [ "$ACTIVATE_LB" == "TRUE" ]; then
36-
sed -i "s|\$scope.serverAddress + ':[0-9][0-9]*'|\$scope.serverAddress + ':${LB_EXTERNAL_PORT_WS}'|" $FILE
37-
sed -i "s|\$scope.serverPort = '[0-9][0-9]*';|\$scope.serverPort = '${LB_EXTERNAL_PORT_WS}';|" $FILE
38-
else
39-
sed -i "s|\$scope.serverAddress + ':[0-9][0-9]*'|\$scope.serverAddress + ':${SIP_PORT_WS}'|" $FILE
40-
sed -i "s|\$scope.serverPort = '[0-9][0-9]*';|\$scope.serverPort = '${SIP_PORT_WS}';|" $FILE
41-
fi
42-
fi
4338
}
4439

4540

Diff for: restcomm/configuration/config-scripts/as7-config-scripts/restcomm/autoconfig.d/config-rvd.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fi
5656

5757
echo "Configuring RVD"
5858

59-
if [ "$RVD_VIDEO_SUPPORT" = true || "$RVD_VIDEO_SUPPORT" = TRUE || "$RVD_VIDEO_SUPPORT" = True ] ; then
59+
if [[ "$RVD_VIDEO_SUPPORT" = true || "$RVD_VIDEO_SUPPORT" = TRUE || "$RVD_VIDEO_SUPPORT" = True ]] ; then
6060
updateVideoSupport true
6161
else
6262
updateVideoSupport false

Diff for: restcomm/configuration/config-scripts/as7-config-scripts/restcomm/mediaserver.conf

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ MGCP_PORT=2427
1616

1717
# Media
1818
MEDIA_TIMEOUT=0
19+
MEDIA_MAX_DURATION=14440
1920
MEDIA_LOW_PORT=64534
2021
MEDIA_HIGH_PORT=65534
2122
MEDIA_JITTER_SIZE=50
@@ -27,6 +28,7 @@ AUDIO_CACHE_SIZE=100
2728
AUDIO_CACHE_ENABLED=false
2829
DTMF_DETECTOR_DBI=-30
2930
DTMF_DETECTOR_TONE_DURATION=80
31+
DTMF_DETECTOR_TONE_INTERVAL=400
3032

3133
# DTLS
3234
DTLS_MIN_VERSION=1.0

Diff for: restcomm/restcomm.application/src/main/java/org/restcomm/connect/application/Bootstrapper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private MediaServerControllerFactory mediaServerControllerFactory(final Configur
8080
try {
8181
settings = configuration.subset("media-server-manager");
8282
ActorRef mrb = mediaResourceBroker(settings, storage, loader);
83-
factory = new MmsControllerFactory(system, mrb);
83+
factory = new MmsControllerFactory(mrb);
8484
} catch (UnknownHostException e) {
8585
throw new ServletException(e);
8686
}
@@ -100,7 +100,7 @@ private MediaServerControllerFactory mediaServerControllerFactory(final Configur
100100
// Create JSR 309 factory
101101
MsControlFactory msControlFactory = driver.getFactory(properties);
102102
MediaServerInfo mediaServerInfo = mediaServerInfo(settings);
103-
factory = new Jsr309ControllerFactory(system, mediaServerInfo, msControlFactory);
103+
factory = new Jsr309ControllerFactory(mediaServerInfo, msControlFactory);
104104
} catch (UnknownHostException | MsControlException e) {
105105
throw new ServletException(e);
106106
}

Diff for: restcomm/restcomm.asr/src/main/java/org/restcomm/connect/asr/ISpeechAsr.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,22 @@
2020
package org.restcomm.connect.asr;
2121

2222
import akka.actor.ActorRef;
23-
import akka.actor.UntypedActor;
24-
2523
import com.iSpeech.SpeechResult;
2624
import com.iSpeech.iSpeechRecognizer;
27-
import static com.iSpeech.iSpeechRecognizer.*;
2825
import com.iSpeech.iSpeechRecognizer.SpeechRecognizerEvent;
26+
import org.apache.commons.configuration.Configuration;
27+
import org.restcomm.connect.commons.faulttolerance.RestcommUntypedActor;
2928

3029
import java.io.File;
3130
import java.util.HashMap;
3231
import java.util.Map;
3332

34-
import org.apache.commons.configuration.Configuration;
33+
import static com.iSpeech.iSpeechRecognizer.FREEFORM_DICTATION;
3534

3635
/**
3736
* @author [email protected] (Thomas Quintana)
3837
*/
39-
public final class ISpeechAsr extends UntypedActor implements SpeechRecognizerEvent {
38+
public final class ISpeechAsr extends RestcommUntypedActor implements SpeechRecognizerEvent {
4039
private static final Map<String, String> languages = new HashMap<String, String>();
4140
static {
4241
languages.put("en", "en-US");

Diff for: restcomm/restcomm.commons/src/main/java/org/restcomm/connect/commons/cache/DiskCache.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
package org.restcomm.connect.commons.cache;
2121

2222
import akka.actor.ActorRef;
23-
import akka.actor.UntypedActor;
2423
import akka.event.Logging;
2524
import akka.event.LoggingAdapter;
2625
import org.apache.commons.io.FileUtils;
2726
import org.apache.commons.lang.StringUtils;
2827
import org.apache.shiro.crypto.hash.Sha256Hash;
28+
import org.restcomm.connect.commons.faulttolerance.RestcommUntypedActor;
2929

3030
import java.io.File;
3131
import java.io.FileNotFoundException;
@@ -39,7 +39,7 @@
3939
/**
4040
* @author [email protected] (Thomas Quintana)
4141
*/
42-
public final class DiskCache extends UntypedActor {
42+
public final class DiskCache extends RestcommUntypedActor {
4343
// Logger.
4444
private final LoggingAdapter logger = Logging.getLogger(getContext().system(), this);
4545

Diff for: restcomm/restcomm.commons/src/main/java/org/restcomm/connect/commons/faulttolerance/RestcommSupervisorStrategy.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,21 @@ public class RestcommSupervisorStrategy implements SupervisorStrategyConfigurato
2020

2121
private static Logger logger = Logger.getLogger(RestcommSupervisorStrategy.class);
2222

23-
final SupervisorStrategy.Directive strategy = resume();
23+
static final SupervisorStrategy.Directive strategy = resume();
2424

25-
RestcommFaultToleranceStrategy defaultStrategy = new RestcommFaultToleranceStrategy(10, Duration.create("1 minute"),
25+
static RestcommFaultToleranceStrategy defaultStrategy = new RestcommFaultToleranceStrategy(10, Duration.create("1 minute"),
2626
new RestcommFaultToleranceDecider());
2727

2828
@Override
2929
public SupervisorStrategy create() {
3030
return defaultStrategy;
3131
}
3232

33-
private class RestcommFaultToleranceStrategy extends OneForOneStrategy {
33+
public static SupervisorStrategy getStrategy() {
34+
return defaultStrategy;
35+
}
36+
37+
private static class RestcommFaultToleranceStrategy extends OneForOneStrategy {
3438

3539
public RestcommFaultToleranceStrategy(int maxNrOfRetries, Duration withinTimeRange, Function<Throwable, Directive> function) {
3640
super(maxNrOfRetries, withinTimeRange, function);
@@ -51,7 +55,7 @@ public boolean handleFailure(ActorContext context, ActorRef child, Throwable cau
5155
// }
5256
}
5357

54-
private class RestcommFaultToleranceDecider implements Function<Throwable, SupervisorStrategy.Directive> {
58+
private static class RestcommFaultToleranceDecider implements Function<Throwable, SupervisorStrategy.Directive> {
5559

5660
@Override
5761
// - 2nd the Supervisor strategy will execute the Decider apply() to check what to do with the exception
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* TeleStax, Open Source Cloud Communications
3+
* Copyright 2011-2014, Telestax Inc and individual contributors
4+
* by the @authors tag.
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* under the terms of the GNU Affero General Public License as
8+
* published by the Free Software Foundation; either version 3 of
9+
* the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>
18+
*
19+
*/
20+
21+
package org.restcomm.connect.commons.faulttolerance;
22+
23+
import akka.actor.SupervisorStrategy;
24+
import akka.actor.UntypedActor;
25+
26+
/**
27+
* @author [email protected] (Oleg Agafonov)
28+
*/
29+
public abstract class RestcommUntypedActor extends UntypedActor {
30+
31+
@Override
32+
public SupervisorStrategy supervisorStrategy() {
33+
return RestcommSupervisorStrategy.getStrategy();
34+
}
35+
}

Diff for: restcomm/restcomm.commons/src/test/java/org/restcomm/connect/commons/faulttolerance/SupervisorActorCreationStressTest.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import org.junit.Test;
1717
import org.restcomm.connect.commons.faulttolerance.tool.ActorCreatingThread;
1818

19-
import akka.actor.ActorRef;
2019
import akka.actor.ActorSystem;
21-
import akka.actor.Props;
2220

2321
/**
2422
* @author mariafarooq
@@ -46,7 +44,7 @@ public static void beforeClass() throws Exception {
4644
actorFailureCount = new AtomicInteger();
4745
}
4846

49-
@Test
47+
@Test
5048
public void testCreateSampleAkkaActor() throws ConfigurationException, MalformedURLException, UnknownHostException, InterruptedException {
5149
ExecutorService executor = Executors.newFixedThreadPool(nThreads);
5250
for (int i = 0; i < THREAD_COUNT; i++) {

Diff for: restcomm/restcomm.commons/src/test/java/org/restcomm/connect/commons/faulttolerance/tool/MyUntypedActor.java

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
package org.restcomm.connect.commons.faulttolerance.tool;
22

3-
import static akka.pattern.Patterns.ask;
4-
5-
import java.util.concurrent.TimeUnit;
6-
7-
import akka.actor.ActorSystem;
8-
import org.restcomm.connect.commons.faulttolerance.SupervisorActorCreationStressTest;
9-
103
import akka.actor.ActorRef;
4+
import akka.actor.ActorSystem;
115
import akka.actor.Props;
126
import akka.actor.UntypedActor;
137
import akka.actor.UntypedActorFactory;
148
import akka.event.Logging;
159
import akka.event.LoggingAdapter;
16-
import scala.concurrent.Await;
17-
import scala.concurrent.duration.Duration;
10+
import org.restcomm.connect.commons.faulttolerance.RestcommUntypedActor;
11+
import org.restcomm.connect.commons.faulttolerance.SupervisorActorCreationStressTest;
1812

1913
/**
2014
* MyUntypedActor represent a restcomm-connect class that request supervisor to create actor for it
2115
*
2216
* @author mariafarooq
2317
*
2418
*/
25-
public class MyUntypedActor extends UntypedActor {
19+
public class MyUntypedActor extends RestcommUntypedActor {
2620
private LoggingAdapter logger = Logging.getLogger(getContext().system(), this);
2721

2822
private final ActorSystem system;

Diff for: restcomm/restcomm.commons/src/test/java/org/restcomm/connect/commons/faulttolerance/tool/SimpleActor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.restcomm.connect.commons.faulttolerance.tool;
22

3-
import akka.actor.UntypedActor;
3+
import org.restcomm.connect.commons.faulttolerance.RestcommUntypedActor;
44

55
/**
66
* SampleActor: a simple actor to be created
77
*
88
* @author mariafarooq
99
*
1010
*/
11-
public class SimpleActor extends UntypedActor {
11+
public class SimpleActor extends RestcommUntypedActor {
1212

1313
public SimpleActor(){
1414
}

Diff for: restcomm/restcomm.commons/src/test/java/org/restcomm/connect/commons/patterns/ObserverPatternTest.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,17 @@
2222
import akka.actor.ActorRef;
2323
import akka.actor.ActorSystem;
2424
import akka.actor.Props;
25-
import akka.actor.UntypedActor;
2625
import akka.testkit.JavaTestKit;
26+
import org.junit.AfterClass;
27+
import org.junit.BeforeClass;
28+
import org.junit.Test;
29+
import org.restcomm.connect.commons.faulttolerance.RestcommUntypedActor;
2730

2831
import java.util.ArrayList;
2932
import java.util.List;
3033

31-
import static org.junit.Assert.*;
32-
import org.junit.AfterClass;
33-
import org.junit.BeforeClass;
34-
import org.junit.Test;
35-
import org.restcomm.connect.commons.patterns.Observe;
36-
import org.restcomm.connect.commons.patterns.Observing;
37-
import org.restcomm.connect.commons.patterns.StopObserving;
38-
import org.restcomm.connect.commons.patterns.TooManyObserversException;
34+
import static org.junit.Assert.assertFalse;
35+
import static org.junit.Assert.assertTrue;
3936

4037
/**
4138
* @author [email protected] (Thomas Quintana)
@@ -108,7 +105,7 @@ public void testTooManyObserversException() {
108105
private static final class BroadcastHelloWorld {
109106
}
110107

111-
private static final class ObservableActor extends UntypedActor {
108+
private static final class ObservableActor extends RestcommUntypedActor {
112109
private final List<ActorRef> listeners;
113110

114111
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)