Skip to content

Commit

Permalink
Merge branch 'master' into bs-156
Browse files Browse the repository at this point in the history
# Conflicts:
#	restcomm/restcomm.interpreter/pom.xml
#	restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/BaseVoiceInterpreter.java
#	restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/CallManager.java
  • Loading branch information
gvagenas committed Jun 27, 2018
2 parents ec20791 + e954f44 commit 9c4e5f2
Show file tree
Hide file tree
Showing 33 changed files with 1,365 additions and 53 deletions.
Expand Up @@ -146,6 +146,8 @@ USSDGATEWAYUSER=''
USSDGATEWAYPASSWORD=''
#Used to set HTTP Response timeout for RC to download the RCML.
HTTP_RESPONSE_TIMEOUT=6000
#Maximum P2P call length configuration. Unit is munite
MAX_P2P_CALL_LENGTH=60

# 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.
CACHE_NO_WAV=false
Expand Down
Expand Up @@ -864,6 +864,11 @@ configConferenceTimeout(){
xmlstarlet ed --inplace -u "/restcomm/runtime-settings/conference-timeout" -v "$CONFERENCE_TIMEOUT" $FILE
}

configMaxP2PCallLength(){
echo "Configure Max P2P Call Length $MAX_P2P_CALL_LENGTH"
xmlstarlet ed --inplace -u "/restcomm/runtime-settings/max-p2p-call-length" -v "$MAX_P2P_CALL_LENGTH" $FILE
}

configSdrService(){
xmlstarlet ed --inplace -d "/restcomm/runtime-settings/sdr-service" $FILE
if [ -n "$SDR_SERVICE_CLASS" ]; then
Expand Down Expand Up @@ -927,5 +932,6 @@ configRMSNetworking
configAsrDriver
configDnsProvisioningManager
configConferenceTimeout
configMaxP2PCallLength
configSdrService
echo 'Configured RestComm!'
Expand Up @@ -266,6 +266,9 @@
or send appropriate response according to the response from outbound dial-->
<!-- https://github.com/RestComm/Restcomm-Connect/issues/1649 -->
<enable-200-ok-delay>false</enable-200-ok-delay>

<!-- Maximum P2P call length within RestComm, unit is minute -->
<max-p2p-call-length>60</max-p2p-call-length>

<push-notification-server-enabled>false</push-notification-server-enabled>
<!-- Path to Restcomm Push Notification Server (Notification API) -->
Expand Down
Expand Up @@ -38,7 +38,9 @@ The *<Gather>* verb supports two modes: *DTMF* and *SPEECH*. In DTMF mode it "ga
* *finishOnKey.* The 'finishOnKey' attribute lets you choose one value that submits the received data when entered. For example, if you set 'finishOnKey' to '\#' and the user enters '1234#', RestComm will immediately stop waiting for more input when the '\#' is received and will submit "Digits=1234" to the 'action' URL. Note that the 'finishOnKey' value is not sent. The allowed values are the digits 0-9, '#', '*' and the empty string (set 'finishOnKey' to ''). If the empty string is used, <Gather> captures all input and no key will end the <Gather> when pressed. In this case RestComm will submit the entered digits to the 'action' URL only after the timeout has been reached. The value can only be a single character.
* *numDigits.* The 'numDigits' attribute lets you set the number of digits you are expecting, and submits the data to the 'action' URL once the caller enters that number of digits.
* *input* A list of inputs that RestComm should accept for <Gather>. Can be "dtmf" or "speech". Defaults to "dtmf".
* *partialResultCallback* A relative or fully qualified URL. Is a mandatory attribute for “speech” mode. RestComm will make requests to your partialResultCallback in real-time as speech is recognized.
* *partialResultCallback* A relative or fully qualified URL. Is a mandatory attribute for “speech” mode. RestComm will make requests to your partialResultCallback in real-time as speech is recognized. These webhooks will contain UnstableSpeechResult parameter with partial transcriptions that may change as the recognition progresses.

NOTE: The Webhooks to partialResultCallback are async and doesn't accept RCML back. If you want to act based on the partial result, then use the REST API to Live Modify the call.

=== Request Parameters

Expand Down
Expand Up @@ -29,7 +29,6 @@ You can use different combinations of the verbs below to create all kinds of int
** <<number-rcml.adoc#number,Number>>
** <<sip-rcml.adoc#sip,SIP>>
* <<email-rcml.adoc#email,Email- Send an Email>>
* <<fax-rcml.adoc#fax,Fax- Send a Fax>>
* <<gather-rcml.adoc#gather,Gather - Collect digits the caller types on their keypad>>
* <<hangup-rcml.adoc#hangup,Hangup - Hang up the call>>
* <<pause-rcml.adoc#pause,Pause - Wait before executing more instructions>>
Expand All @@ -39,9 +38,6 @@ You can use different combinations of the verbs below to create all kinds of int
* <<reject-rcml.adoc#reject,Reject - Decline an incoming call without being billed.>>
* <<say-rcml.adoc#say,Say - Read text to the caller>>
* <<sms-rcml.adoc#sms,SMS - Send an SMS message during a phone call>>
* <<ussd-collect-rcml.adoc#ussd-collect,USSD Collect - Collect USSD>>
* <<geolocation-rcml.adoc#geolocation,Geolocation - Gather geolocation information>>
* <<video-rcml.adoc#video,Video - Configure and enable video for calls and conferences>>

== How Restcomm Interacts with Your Application

Expand Down
Expand Up @@ -9,6 +9,40 @@ The folowing tags are used to categorize and state the scope of a change
* **security improvement** tags changes related to security
* **commercial** tags changes that are available only in the commercial RestcommOne product

== 8.7.0 version 2018-06-19 (docker tag _____)
=== New Features
// New features (whether major or minor) go here


=== Breaking Changes
// draws attention to functionality that is getting removed


=== Bug Fixes
* Send BYE on session expiration for B2BUA calls


=== Migration Notes
// Things to consider during migration from previous release

==== Migration steps - part 1

Follow the steps below to upgrade DB schema

* Use full backup database script to backup database - follow <<configuration/MySQL_Backup_Restore_Scripts.html,Mysql backup/restore scripts>>
* Use database schema upgrade scripts to move DB schema to the latest - follow <<configuration/How to use Mysql schema upgrade scripts.adoc#mysql-schema-upgrade,How to use Mysql schema upgrade scripts>>

*At this point, you can upgrade Restcomm-Connect instance.*

==== Rollback steps
In case something goes wrong during the migration/upgrade process, you can rollback changes and run the previous version of Restcomm-Connect

Follow the steps below:

2. Stop 8.7.0 instance
3. Start old version instance.

*You don't need to migrate DB schema*

== 8.6.0 version 2018-06-19 (docker tag 8.6.0-211)
=== New Features
Expand Down
12 changes: 11 additions & 1 deletion restcomm/restcomm.interpreter/pom.xml
Expand Up @@ -136,7 +136,7 @@

<dependency>
<groupId>org.restcomm</groupId>
<artifactId>restcomm-connect.http</artifactId>
<artifactId>restcomm-connect.extension.controller</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -177,6 +177,16 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>1.57</version>
<!-- Include this if you have dependency conflicts for Guava, Jetty, Jackson
or Apache HTTP Client -->
<classifier>standalone</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.restcomm</groupId>
<artifactId>restcomm-connect.core</artifactId>
Expand Down
Expand Up @@ -178,7 +178,6 @@ public abstract class BaseVoiceInterpreter extends RestcommUntypedActor {
final State sendingSms;
final State hangingUp;
final State sendingEmail;
final State continuousGathering;
// final State finished;

// FSM.
Expand Down Expand Up @@ -307,8 +306,6 @@ public BaseVoiceInterpreter() {
sendingSms = new State("sending sms", new SendingSms(source), null);
hangingUp = new State("hanging up", new HangingUp(source), null);
sendingEmail = new State("sending Email", new SendingEmail(source), null);
continuousGathering = new State("push partial result", new PartialGathering(source), null);

// Initialize the transitions for the FSM.
transitions.add(new Transition(uninitialized, acquiringAsrInfo));
transitions.add(new Transition(acquiringAsrInfo, acquiringSynthesizerInfo));
Expand Down Expand Up @@ -390,10 +387,6 @@ public BaseVoiceInterpreter() {

transitions.add(new Transition(gathering, finishGathering));
transitions.add(new Transition(gathering, hangingUp));
transitions.add(new Transition(gathering, continuousGathering));

transitions.add(new Transition(continuousGathering, continuousGathering));
transitions.add(new Transition(continuousGathering, finishGathering));

transitions.add(new Transition(finishGathering, faxing));
transitions.add(new Transition(finishGathering, sendingEmail));
Expand Down Expand Up @@ -421,6 +414,8 @@ public BaseVoiceInterpreter() {

extensions = ExtensionController.getInstance().getExtensions(ExtensionType.FeatureAccessControl);

httpAsycClientHelper = httpAsycClientHelper();

this.uriUtils = RestcommConnectServiceProvider.getInstance().uriUtils();
}

Expand Down Expand Up @@ -702,6 +697,9 @@ void postCleanup() {
if (downloader != null && !downloader.isTerminated()) {
getContext().stop(downloader);
}
if(httpAsycClientHelper != null && !httpAsycClientHelper.isTerminated()) {
getContext().stop(httpAsycClientHelper);
}
}

void sendMail(final Notification notification) {
Expand Down Expand Up @@ -840,6 +838,26 @@ public ActorRef getSynthesizer() {
return synthesizer;
}

private ActorRef httpAsycClientHelper;

protected ActorRef httpAsycClientHelper(){
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;

@Override
public UntypedActor create() throws Exception {
return new HttpAsycClientHelper();
}
});
return getContext().actorOf(props);

}
private void notifyAsyncWebHook(HttpRequestDescriptor httpReq) {
httpAsycClientHelper.tell(httpReq, self());


}

ActorRef tts(final Configuration ttsConf) {
final String classpath = ttsConf.getString("[@class]");
final Props props = new Props(new UntypedActorFactory() {
Expand Down Expand Up @@ -1723,7 +1741,7 @@ protected void execHttpRequest(final NotificationsDao notifications,
final URI base = request.getUri();
final URI uri = uriUtils.resolveWithBase(base, target);
request = new HttpRequestDescriptor(uri, method, parameters);
downloader.tell(request, source);
notifyAsyncWebHook(request);
}
}

Expand Down
Expand Up @@ -335,9 +335,6 @@ public VoiceInterpreter(VoiceInterpreterParams params) {
transitions.add(new Transition(finishGathering, ready));
transitions.add(new Transition(finishGathering, finishGathering));
transitions.add(new Transition(finishGathering, finished));
transitions.add(new Transition(continuousGathering, ready));
transitions.add(new Transition(continuousGathering, finishGathering));
transitions.add(new Transition(continuousGathering, finished));
transitions.add(new Transition(creatingSmsSession, finished));
transitions.add(new Transition(sendingSms, ready));
transitions.add(new Transition(sendingSms, startDialing));
Expand Down Expand Up @@ -853,11 +850,18 @@ private void onMediaGroupResponse(Object message) throws TransitionFailedExcepti
}
// This is either MMS collected digits or SIP INFO DTMF. If the DTMF is from SIP INFO, then more DTMF might
// come later
else if (is(gathering) || is(continuousGathering) || (is(finishGathering) && !super.dtmfReceived)) {
else if (is(gathering) || (is(finishGathering) && !super.dtmfReceived)) {
final MediaGroupResponse dtmfResponse = (MediaGroupResponse) message;
Object data = dtmfResponse.get();
if (data instanceof CollectedResult && ((CollectedResult)data).isAsr() && ((CollectedResult)data).isPartial()) {
fsm.transition(message, continuousGathering);
try {
//we dont need a new state for this action. The notification
//is purely async, and the Interpreter logic will resume
//regardless notification result.
new PartialGathering(self()).execute(message);
} catch (Exception ex) {
this.logger.debug("Notifying partial result", ex);
}
} else if (data instanceof CollectedResult && ((CollectedResult)data).isAsr() && !((CollectedResult)data).isPartial() && collectedDigits.length() == 0) {
speechResult = ((CollectedResult)data).getResult();
fsm.transition(message, finishGathering);
Expand Down Expand Up @@ -1194,7 +1198,7 @@ private void onDownloaderResponse(Object message, State state) throws IOExceptio
logger.debug("statusCode " + response.get().getStatusCode());
}
if (response.succeeded() && HttpStatus.SC_OK == response.get().getStatusCode()) {
if (continuousGathering.equals(state)) {
if (gathering.equals(state)) {
//no need change state
return;
}
Expand Down Expand Up @@ -1958,7 +1962,7 @@ public void execute(final Object message) throws IOException {
source.tell(verb, source);
return;
} else if (downloadingRcml.equals(state) || downloadingFallbackRcml.equals(state) || redirecting.equals(state)
|| continuousGathering.equals(state) || finishGathering.equals(state) || finishRecording.equals(state) || sendingSms.equals(state)
|| finishGathering.equals(state) || finishRecording.equals(state) || sendingSms.equals(state)
|| finishDialing.equals(state) || finishConferencing.equals(state) || is(forking)) {
response = ((DownloaderResponse) message).get();
if (parser != null) {
Expand Down
Expand Up @@ -57,21 +57,21 @@ public final class DownloaderTest {

private ActorSystem system;
private ActorRef downloader;

private static int MOCK_PORT = 8099;
//use localhost instead of 127.0.0.1 to match the route rule
private static String PATH = "http://localhost:" + MOCK_PORT + "/";

@Rule
public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().bindAddress("127.0.0.1").port(MOCK_PORT));
public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().bindAddress("127.0.0.1").port(MOCK_PORT));

public DownloaderTest() {
super();
}

@Before
public void before() throws Exception {
URL url = this.getClass().getResource("/restcomm.xml");
URL url = this.getClass().getResource("/restcomm_downloader.xml");
Configuration xml = new XMLConfiguration(url);
RestcommConfiguration.createOnce(xml);
system = ActorSystem.create();
Expand All @@ -89,7 +89,7 @@ public void testGet() throws URISyntaxException, IOException {
stubFor(get(urlMatching("/testGet")).willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("expectedBody")));
.withBody("expectedBody")));
new JavaTestKit(system) {
{
final ActorRef observer = getRef();
Expand Down Expand Up @@ -135,7 +135,7 @@ public void testNotFound() throws URISyntaxException, IOException {
stubFor(get(urlMatching("/testNotFound")).willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", "application/json")
.withBody("{}")));
.withBody("{}")));
new JavaTestKit(system) {
{
final ActorRef observer = getRef();
Expand Down Expand Up @@ -172,12 +172,12 @@ public void testDownloaderWithRouteconfiguration() throws Exception {
final String method = "GET";
final HttpRequestDescriptor request = new HttpRequestDescriptor(uri, method);
final ActorRef observer = getRef();

for (int i =0; i < connsPerRoute; i ++)
{
downloader = system.actorOf(new Props(Downloader.class));
downloader.tell(request, observer);
}
}
Thread.sleep(1000);
downloader = system.actorOf(new Props(Downloader.class));
downloader.tell(request, observer);
Expand Down

0 comments on commit 9c4e5f2

Please sign in to comment.