Skip to content

Commit

Permalink
Merge branch 'master' into issue-5
Browse files Browse the repository at this point in the history
* master: (45 commits)
  changed sections and title
  Enabled role submission from AdminUI.
  Added permission for /Usage endpoint for Developer role.
  Fixed comparison problem in AbstractEndpoint:secure() and AccountsEndpoint.
  Removed unnecessary code
  Changes getAccount() permission to Restcomm:Read:Accounts from Restcomm:Modify:Accounts.
  Fixes permission parsing and processing. - Tweaked XMLConfinguration creation from restcomm.xml so that 'comma' characters don't confuse it. - Fixed shiro permission population in Realm.java.
  added paragraph, links, details
  CheckStyle review for RestComm#977
  RestComm#977 restoring restcomm.application/src/main/webapp/WEB-INF/conf/mybatis.xml
  RestComm#977
  RestComm#977 Fix for Windows path: VoiceRSSSpeechSynthesizerTest MybatisDaoManager
  added [source,bash] and links
  made some required changes, added two paragraphs and one picture
  Properly cleanup outgoing call created with Calls API in case of a problem while downloading the RCML
  Support for dialling clients with multiple registrations This close RestComm#1033
  Fix RestComm#1026.
  Adding Documentation configuration index
  Documentation Configuration Changes
  Migration of tutorials
  ...
  • Loading branch information
Maria Farooq committed May 17, 2016
2 parents 4b0d322 + a5505ae commit 74ad562
Show file tree
Hide file tree
Showing 104 changed files with 1,359 additions and 509 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,34 @@ private Properties getDialogicXmsProperties(final Configuration configuration) {

// Configure the transport to be used by the connector
final String mediaTransport = configuration.getString("media-server.transport", "udp");
logger.info("JSR 309 - media-server.transport: udp");
if(logger.isInfoEnabled()) {
logger.info("JSR 309 - media-server.transport: udp");
}
properties.setProperty("connector.sip.transport", mediaTransport);

// Configure SIP connector using RestComm binding address
SipURI sipURI = outboundInterface(getServletContext(), mediaTransport);
properties.setProperty("connector.sip.address", sipURI.getHost());
logger.info("JSR 309 - connector.sip.address: " + sipURI.getHost());
if(logger.isInfoEnabled()) {
logger.info("JSR 309 - connector.sip.address: " + sipURI.getHost());
}
properties.setProperty("connector.sip.port", String.valueOf(sipURI.getPort()));
logger.info("JSR 309 - connector.sip.port: " + String.valueOf(sipURI.getPort()));
if(logger.isInfoEnabled()) {
logger.info("JSR 309 - connector.sip.port: " + String.valueOf(sipURI.getPort()));
}

// Configure Media Server address based on restcomm configuration file
final String mediaAddress = configuration.getString("media-server.address", "127.0.0.1");
properties.setProperty("mediaserver.sip.ipaddress", mediaAddress);
logger.info("JSR 309 - mediaserver.sip.ipaddress: " + mediaAddress);
if(logger.isInfoEnabled()) {
logger.info("JSR 309 - mediaserver.sip.ipaddress: " + mediaAddress);
}

final String mediaPort = configuration.getString("media-server.port", "5060");
properties.setProperty("mediaserver.sip.port", mediaPort);
logger.info("JSR 309 - mediaserver.sip.port: " + mediaPort);
if(logger.isInfoEnabled()) {
logger.info("JSR 309 - mediaserver.sip.port: " + mediaPort);
}

// Let RestComm control call legs
properties.setProperty("connector.conferenceControlLeg", "no");
Expand Down Expand Up @@ -248,7 +258,11 @@ public void servletInitialized(SipServletContextEvent event) {
// Load the RestComm configuration file.
Configuration xml = null;
try {
xml = new XMLConfiguration(path);
XMLConfiguration xmlConfiguration = new XMLConfiguration();
xmlConfiguration.setDelimiterParsingDisabled(true);
xmlConfiguration.setAttributeSplittingDisabled(true);
xmlConfiguration.load(path);
xml = xmlConfiguration;
} catch (final ConfigurationException exception) {
logger.error(exception);
}
Expand Down Expand Up @@ -281,7 +295,9 @@ public void servletInitialized(SipServletContextEvent event) {
ActorRef monitoring = monitoringService(xml, loader);
if (monitoring != null) {
context.setAttribute(MonitoringService.class.getName(), monitoring);
logger.info("Monitoring Service created and stored in the context");
if(logger.isInfoEnabled()) {
logger.info("Monitoring Service created and stored in the context");
}
} else {
logger.error("Monitoring Service is null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ public GenerateInstanceId(ServletContext servletContext, final SipURI sipURI) th
public InstanceId instanceId() {
InstanceId instanceId = instanceIdDao.getInstanceIdByHost(host);
if (instanceId != null) {
logger.info("Restcomm Instance ID: "+instanceId.toString());
if(logger.isInfoEnabled()) {
logger.info("Restcomm Instance ID: "+instanceId.toString());
}
} else {
instanceId = new InstanceId(Sid.generate(Sid.Type.INSTANCE), host, DateTime.now(), DateTime.now());
instanceIdDao.addInstancecId(instanceId);
logger.info("Restcomm Instance ID created: "+instanceId.toString());
if(logger.isInfoEnabled()) {
logger.info("Restcomm Instance ID created: "+instanceId.toString());
}
}
servletContext.setAttribute(InstanceId.class.getName(), instanceId);
return instanceId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private void storeNewMessage(String message, boolean asServerLog, boolean asMigr
if (asServerLog) {
if (error) {
logger.error(message);
} else {
} else if(logger.isInfoEnabled()) {
logger.info(message);
}
}
Expand All @@ -233,7 +233,7 @@ private void storeNewMessage(String message, boolean asServerLog, boolean asMigr
} else if (!asServerLog) { // Prevent duplicated messages
if (error) {
logger.error(message);
} else {
} else if(logger.isInfoEnabled()) {
logger.info(message);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
<permission>RestComm:Read:Transcriptions</permission>
<permission>RestComm:*:OutboundProxies</permission>
<permission>RestComm:*:EmailMessages</permission>
<permission>RestComm:*:Usage</permission>
</role>
</security-roles>
</runtime-settings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ public URI uploadFile(final String fileToUpload) {
AWSCredentials credentials =new BasicAWSCredentials(accessKey, securityKey);
AmazonS3 s3client = new AmazonS3Client(credentials);
s3client.setRegion(Region.getRegion(Regions.fromName(bucketRegion)));
logger.info("S3 Region: "+bucketRegion.toString());
if(logger.isInfoEnabled()){
logger.info("S3 Region: "+bucketRegion.toString());
}
try {
StringBuffer bucket = new StringBuffer();
bucket.append(bucketName);
if (folder != null && !folder.isEmpty())
bucket.append("/").append(folder);
URI fileUri = URI.create(fileToUpload);
logger.info("File to upload to S3: "+fileUri.toString());
if(logger.isInfoEnabled()){
logger.info("File to upload to S3: "+fileUri.toString());
}
File file = new File(fileUri);
// while (!file.exists()){}
// logger.info("File exist: "+file.exists());
Expand Down Expand Up @@ -147,7 +151,9 @@ public URI uploadFile(final String fileToUpload) {

private void removeLocalFile(final File file) {
if (!file.delete()) {
logger.info("Error while trying to delete the file: "+file.toString());
if(logger.isInfoEnabled()){
logger.info("Error while trying to delete the file: "+file.toString());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ private static HttpConnectorList getHttpConnectors() throws MalformedObjectNameE
String scheme = mbs.getAttribute(obj, "name").toString().replaceAll("\"", "");
Integer port = (Integer) mbs.getAttribute(obj, "boundPort");
String address = ((String)mbs.getAttribute(obj, "boundAddress")).replaceAll("\"", "");
logger.info("Jboss Http Connector: "+scheme+"://"+address+":"+port);
if(logger.isInfoEnabled()) {
logger.info("Jboss Http Connector: "+scheme+"://"+address+":"+port);
}
HttpConnector httpConnector = new HttpConnector(scheme, address, port, scheme.equalsIgnoreCase("https"));
endPoints.add(httpConnector);
} }
Expand All @@ -87,7 +89,9 @@ private static HttpConnectorList getHttpConnectors() throws MalformedObjectNameE
String scheme = mbs.getAttribute(obj, "scheme").toString().replaceAll("\"", "");
String port = obj.getKeyProperty("port").replaceAll("\"", "");
String address = obj.getKeyProperty("address").replaceAll("\"", "");
logger.info("Tomcat Http Connector: "+scheme+"://"+address+":"+port);
if(logger.isInfoEnabled()){
logger.info("Tomcat Http Connector: "+scheme+"://"+address+":"+port);
}
HttpConnector httpConnector = new HttpConnector(scheme, address, Integer.parseInt(port), scheme.equalsIgnoreCase("https"));
endPoints.add(httpConnector);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.authz.SimpleRole;
import org.apache.shiro.authz.permission.DomainPermission;
import org.apache.shiro.authz.permission.WildcardPermission;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;

Expand Down Expand Up @@ -139,9 +139,10 @@ private void loadSecurityRoles(final Configuration configuration) {
if (numberOfPermissions > 0) {
final SimpleRole role = new SimpleRole(name);
for (int permissionIndex = 0; permissionIndex < numberOfPermissions; permissionIndex++) {
buffer = new StringBuilder();
buffer.append(prefix).append(".permission(").append(permissionIndex).append(")");
final Permission permission = new DomainPermission(buffer.toString());
String permissionName = permissions.get(permissionIndex);
//buffer = new StringBuilder();
//buffer.append(prefix).append(".permission(").append(permissionIndex).append(")");
final Permission permission = new WildcardPermission(permissionName);
role.add(permission);
}
roles.put(name, role);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
[[build-from-source]]
*How to build Restcomm-Connect from source*
= How to build Restcomm-Connect from source

*Requirements*
== Requirements

* You must have *git* installed on your computer
* You must have *ant* installed on your computer
* You must have *JDK - 7* installed on your computer
* You must be running *maven* version 3.x.x on your computer
* You must have link:https://git-scm.com/book/en/v2/Getting-Started-Installing-Git[git] installed on your computer
* You must have link:http://ant.apache.org/manual/install.html[ant] installed on your computer
* You must have link:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html[JDK - 7] installed on your computer
* You must be running link:https://maven.apache.org/download.cgi[maven] version 3.x.x on your computer

*Step 1*
== Obtaining git URL

* Go to https://github.com/RestComm/Restcomm-Connect.git
You will see the page like this one below. Copy the URL in the *HTTPS* field.
The URL should look like this: https://github.com/RestComm/Restcomm-Connect.git

image::images/1.png[]

*Step 2*
== Restcomm-Connect cloning

In the bash window of your local computer create a directory where you should clone Restcomm-Connect:

* run the command : *git clone https://github.com/RestComm/Restcomm-Connect.git*.
* run the command :

[source,bash]
----
git clone https://github.com/RestComm/Restcomm-Connect.git
----
This command will create a new directory called RestComm-Connect. Go to this directory entering the command:
*cd Restcomm-Connect*.

[source,bash]
----
cd Restcomm-Connect
----

The content of the directory should contain the following:

image::images/6.png[]

== Restcomm-Connect building

* You will need to create a script to build Restcomm-Connect.
Copy the script below into a bash script on your local directory at the root of the RestComm-Connect.
In this tutorial, the script below is stored in the file *restcomm-connect-build.sh*.

[source,bash]
----
#!/bin/bash
export RESTCOMM_HOME=/home/yuliachornobrivets/Restcomm-Connect
Expand All @@ -46,16 +58,26 @@ export DEPENDENCIES_HOME=$WORKSPACE/dependencies
ant release -f ./release/build.xml -Drestcomm.release.version=$MAJOR_VERSION_NUMBER.$BUILD_NUMBER -Drestcomm.branch.name=restcomm-release-$MAJOR_VERSION_NUMBER.$BUILD_NUMBER -Dcheckout.restcomm.dir=$RESTCOMM_HOME -Dworkspace.restcomm.dir=$RESTCOMM_HOME/restcomm -Dcheckout.dir=$DEPENDENCIES_HOME
----

* Change the restcomm-connect-build.sh permission to make it executable as follows:
*chmod +x ./restcomm-connect-build.sh*.
The RestComm directory should now display the following content:
* Change the restcomm-connect-build.sh permission to make it executable as follows

[source,bash]
----
chmod +x ./restcomm-connect-build.sh
----
The RestComm directory should now display the following content:


image::images/4.png[]

* Now, run the build script as follows: *./restcomm-connect-build.sh*
* Now, run the build script as follows:
[source,bash]
----
./restcomm-connect-build.sh
----

This may take a while to build. If the build is successful, you should see this output at the end of the build:

[source,bash]
----
make-final-zip:
Expand All @@ -76,3 +98,5 @@ image::images/3.png[]

Note that the zip file called *Restcomm-JBoss-AS7-7.6.2* is the binary for JBoss container.
You can copy this zip file into a directory on your computer and unzip the content.

Here you can read the detailed information on <<Starting Restcomm-Connect.adoc#configure-restcomm-iP-information-and-text-to-speech,Starting Restcomm-Connect>>.
Loading

0 comments on commit 74ad562

Please sign in to comment.