-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-2493
* master: (34 commits) IVR test fix fixed class casting errors in different classes moved Collected result to mscontrol.api and did proper translation in mediagroup, made IvrEndpointResponse to generic changed rvd url Recording issue fix "Gather" replaced with Verbs.gather Hints limits logic change Hints limits Rename local variable Added pr parameter to ASR Signal Fix for DTMF from MediaServer Fix for DTMF using SIP INFO added Timeouts description added all languages supported by google Added configuration for timeouts, fixed issue with languages in ASR Added unit tests Fix: Go to the next Verb after silent Minor changes to restcomm configuration script Ignore RCML from partialCallback Remove PartialCallback check. Add FinalResult tests ...
- Loading branch information
Showing
34 changed files
with
3,392 additions
and
258 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...main/java/org/restcomm/connect/commons/configuration/sets/impl/MgAsrConfigurationSet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* TeleStax, Open Source Cloud Communications | ||
* Copyright 2011-2014, Telestax Inc and individual contributors | ||
* by the @authors tag. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation; either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
package org.restcomm.connect.commons.configuration.sets.impl; | ||
|
||
import org.apache.commons.configuration.Configuration; | ||
import org.restcomm.connect.commons.configuration.sources.ConfigurationSource; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by gdubina on 26.06.17. | ||
*/ | ||
public class MgAsrConfigurationSet extends ConfigurationSet { | ||
|
||
private final List<String> drivers; | ||
private final String defaultDriver; | ||
private final List<String> languages; | ||
private final String defaultLanguage; | ||
private final int asrMRT; | ||
private final int defaultGatheringTimeout; | ||
|
||
public MgAsrConfigurationSet(ConfigurationSource source, Configuration config) { | ||
super(source); | ||
drivers = Collections.unmodifiableList(config.getList("runtime-settings.mg-asr-drivers.driver")); | ||
defaultDriver = config.getString("runtime-settings.mg-asr-drivers[@default]"); | ||
languages = Collections.unmodifiableList(config.getList("runtime-settings.asr-languages.language")); | ||
defaultLanguage = config.getString("runtime-settings.asr-languages[@default]"); | ||
asrMRT = config.containsKey("runtime-settings.asr-mrt-timeout") ? config.getInt("runtime-settings.asr-mrt-timeout") : 60; | ||
defaultGatheringTimeout = config.containsKey("runtime-settings.default-gathering-timeout") ? config.getInt("runtime-settings.default-gathering-timeout") : 5; | ||
} | ||
|
||
public List<String> getDrivers() { | ||
return drivers; | ||
} | ||
|
||
public String getDefaultDriver() { | ||
return defaultDriver; | ||
} | ||
|
||
public List<String> getLanguages() { | ||
return languages; | ||
} | ||
|
||
public String getDefaultLanguage() { | ||
return defaultLanguage; | ||
} | ||
|
||
public int getAsrMRT() { | ||
return asrMRT; | ||
} | ||
|
||
public int getDefaultGatheringTimeout() { | ||
return defaultGatheringTimeout; | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
...mons/src/test/java/org/restcomm/connect/commons/configuration/MgAsrConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* TeleStax, Open Source Cloud Communications | ||
* Copyright 2011-2014, Telestax Inc and individual contributors | ||
* by the @authors tag. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation; either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
package org.restcomm.connect.commons.configuration; | ||
|
||
import org.apache.commons.collections.CollectionUtils; | ||
import org.apache.commons.configuration.Configuration; | ||
import org.apache.commons.configuration.ConfigurationException; | ||
import org.apache.commons.configuration.XMLConfiguration; | ||
import org.junit.Test; | ||
import org.restcomm.connect.commons.configuration.sets.impl.MgAsrConfigurationSet; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class MgAsrConfigurationTest { | ||
|
||
private List<String> expectedDrivers = Arrays.asList("driver1", "driver2"); | ||
|
||
private List<String> expectedLanguages = Arrays.asList("en-US", "en-GB", "es-ES", "it-IT", "fr-FR", "pl-PL", "pt-PT"); | ||
|
||
private RestcommConfiguration createCfg(final String cfgFileName) throws ConfigurationException, | ||
MalformedURLException { | ||
URL url = this.getClass().getResource(cfgFileName); | ||
|
||
Configuration xml = new XMLConfiguration(url); | ||
return new RestcommConfiguration(xml); | ||
} | ||
|
||
public MgAsrConfigurationTest() { | ||
super(); | ||
} | ||
|
||
@Test | ||
public void checkMgAsrSection() throws ConfigurationException, MalformedURLException { | ||
MgAsrConfigurationSet conf = createCfg("/restcomm.xml").getMgAsr(); | ||
|
||
assertTrue(CollectionUtils.isEqualCollection(expectedDrivers, conf.getDrivers())); | ||
assertEquals("driver1", conf.getDefaultDriver()); | ||
} | ||
|
||
@Test | ||
public void checkNoMgAsrSection() throws ConfigurationException, MalformedURLException { | ||
MgAsrConfigurationSet conf = createCfg("/restcomm-no-mg-asr.xml").getMgAsr(); | ||
|
||
assertTrue(CollectionUtils.isEqualCollection(Collections.emptyList(), conf.getDrivers())); | ||
assertNull(conf.getDefaultDriver()); | ||
} | ||
|
||
@Test | ||
public void checkAsrLanguagesSection() throws ConfigurationException, MalformedURLException { | ||
MgAsrConfigurationSet conf = createCfg("/restcomm.xml").getMgAsr(); | ||
|
||
assertTrue(CollectionUtils.isEqualCollection(expectedLanguages, conf.getLanguages())); | ||
assertEquals("en-US", conf.getDefaultLanguage()); | ||
} | ||
|
||
@Test | ||
public void checkAsrMRT() throws ConfigurationException, MalformedURLException { | ||
MgAsrConfigurationSet conf = createCfg("/restcomm.xml").getMgAsr(); | ||
assertSame(60, conf.getAsrMRT()); | ||
} | ||
|
||
@Test | ||
public void checkDefaultGatheringTimeout() throws ConfigurationException, MalformedURLException { | ||
MgAsrConfigurationSet conf = createCfg("/restcomm.xml").getMgAsr(); | ||
assertSame(5, conf.getDefaultGatheringTimeout()); | ||
} | ||
|
||
} |
Oops, something went wrong.