Skip to content

Commit

Permalink
Issue#1981: Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulazizali77 committed May 6, 2017
1 parent bbef17c commit 09b166d
Show file tree
Hide file tree
Showing 19 changed files with 654 additions and 203 deletions.
6 changes: 1 addition & 5 deletions restcomm/restcomm.application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,7 @@
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.1.0</version>
</dependency>

</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA, or see the FSF site: http://www.fsf.org. -->

<restcomm>
<extensions>
<!-- extension name="MultiProvider">
<name>MultiProvider</name>
<class>org.restcomm.connect.extension.multiprovider.MultiProvider</class>
<!--
<extension>
<name>ExampleExtension</name>
<class>org.restcomm.connect.ExampleExtension</class>
<enabled>true</enabled>
</extension-->
</extensions>
</extension>
-->
</extensions>
</restcomm>
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ GRANT DBA TO SA
SET WRITE_DELAY 10
SET SCHEMA PUBLIC
INSERT INTO "restcomm_accounts" VALUES('ACae6e420f425248d6a26948c17a9e2acf','2012-04-24 00:00:00.000000000','2012-04-24 00:00:00.000000000','administrator@company.com','Default Administrator Account',NULL,'Full','uninitialized','77f8c12cc7b8f8423e5c38b035249166','Administrator','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf')
INSERT INTO "restcomm_accounts" VALUES('ACae6e420f425248d6a26948c17a9e2acg','2012-04-24 00:00:00.000000000','2012-04-24 00:00:00.000000000','second@company.com','Second Administrator Account',NULL,'Full','uninitialized','77f8c12cc7b8f8423e5c38b035249166','Administrator','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acg')
INSERT INTO "restcomm_accounts" VALUES('ACae6e420f425248d6a26948c17a9e2ach','2012-04-24 00:00:00.000000000','2012-04-24 00:00:00.000000000','third@company.com','Third Administrator Account',NULL,'Full','uninitialized','77f8c12cc7b8f8423e5c38b035249166','Administrator','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2ach')
INSERT INTO "restcomm_applications" VALUES('AP73926e7113fa4d95981aa96b76eca854','2015-09-23 06:56:04.108000','2015-09-23 06:56:04.108000','rvdCollectVerbDemo','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/AP73926e7113fa4d95981aa96b76eca854','/restcomm-rvd/services/apps/AP73926e7113fa4d95981aa96b76eca854/controller','voice')
INSERT INTO "restcomm_applications" VALUES('AP81cf45088cba4abcac1261385916d582','2015-09-23 06:56:17.977000','2015-09-23 06:56:17.977000','rvdESDemo','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/AP81cf45088cba4abcac1261385916d582','/restcomm-rvd/services/apps/AP81cf45088cba4abcac1261385916d582/controller','voice')
INSERT INTO "restcomm_applications" VALUES('APb70c33bf0b6748f09eaec97030af36f3','2015-09-23 06:56:26.120000','2015-09-23 06:56:26.120000','rvdSayVerbDemo','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/APb70c33bf0b6748f09eaec97030af36f3','/restcomm-rvd/services/apps/APb70c33bf0b6748f09eaec97030af36f3/controller','voice')
Expand All @@ -45,7 +43,3 @@ INSERT INTO "restcomm_incoming_phone_numbers" VALUES('PN46678e5b01d44973bf184f65
INSERT INTO "restcomm_incoming_phone_numbers" VALUES('PNb43ed9e641364277b6432547ff1109e9','2014-02-17 22:37:19.392000000','2014-02-17 22:37:19.392000000','RVD external services app, customer ID 1 or 2 ','ACae6e420f425248d6a26948c17a9e2acf','+1241','2012-04-24',FALSE,NULL,'POST',NULL,'POST',NULL,'POST','AP81cf45088cba4abcac1261385916d582',NULL,'POST',NULL,'POST',NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/IncomingPhoneNumbers/PNb43ed9e641364277b6432547ff1109e9',NULL,NULL,NULL,NULL, TRUE,'0.0', NULL, NULL)
INSERT INTO "restcomm_clients" VALUES('CLa2b99142e111427fbb489c3de357f60a','2013-11-04 12:52:44.144000000','2013-11-04 12:52:44.144000000','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24','alice','alice','1234',1,NULL,'POST',NULL,'POST',NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Clients/CLa2b99142e111427fbb489c3de357f60a')
INSERT INTO "restcomm_clients" VALUES('CL3003328d0de04ba68f38de85b732ed56','2013-11-04 16:33:39.248000000','2013-11-04 16:33:39.248000000','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24','bob','bob','1234',1,NULL,'POST',NULL,'POST',NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Clients/CL3003328d0de04ba68f38de85b732ed56')
INSERT INTO "restcomm_accounts_extensions" VALUES('ACae6e420f425248d6a26948c17a9e2acf','EX00000000000000000000000000000005','{"outbound-sms": [{"destination_network_id": "1000"}]}')
INSERT INTO "restcomm_accounts_extensions" VALUES('ACae6e420f425248d6a26948c17a9e2acg','EX00000000000000000000000000000005','{"outbound-sms": [{"destination_network_id": "2000"}]}')
INSERT INTO "restcomm_accounts_extensions" VALUES('ACae6e420f425248d6a26948c17a9e2ach','EX00000000000000000000000000000005','{"outbound-sms": [{"destination_network_id": "3000"}]}')
INSERT INTO "restcomm_extensions_configuration" VALUES('EX00000000000000000000000000000005','multi_provider','{"outbound-sms": [{"destination_network_id": "1"}]}','JSON','2012-04-24 00:00:00.000000','2012-04-24 00:00:00.000000',TRUE)
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@ null,
"Administrator",
"/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf");

INSERT INTO restcomm_accounts_extensions VALUES("ACae6e420f425248d6a26948c17a9e2acf","EX00000000000000000000000000000005","{\"outbound-sms\": [{\"destination_network_id\": \"1000\"}]}")
INSERT INTO restcomm_accounts_extensions VALUES("ACae6e420f425248d6a26948c17a9e2acg","EX00000000000000000000000000000005","{\"outbound-sms\": [{\"destination_network_id\": \"2000\"}]}")
INSERT INTO restcomm_accounts_extensions VALUES("ACae6e420f425248d6a26948c17a9e2ach","EX00000000000000000000000000000005","{\"outbound-sms\": [{\"destination_network_id\": \"3000\"}]}")
INSERT INTO restcomm_extensions_configuration VALUES("EX00000000000000000000000000000005","multi_provider","{\"outbound-sms\": [{\"destination_network_id\": \"1\"}]}","JSON","2012-04-24 00:00:00.000000","2012-04-24 00:00:00.000000",TRUE, TRUE);
/* Create demo Applications */
INSERT INTO restcomm_applications VALUES('AP73926e7113fa4d95981aa96b76eca854','2015-09-23 06:56:04.108000','2015-09-23 06:56:04.108000','rvdCollectVerbDemo','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/AP73926e7113fa4d95981aa96b76eca854','/restcomm-rvd/services/apps/AP73926e7113fa4d95981aa96b76eca854/controller','voice');
INSERT INTO restcomm_applications VALUES('AP81cf45088cba4abcac1261385916d582','2015-09-23 06:56:17.977000','2015-09-23 06:56:17.977000','rvdESDemo','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/AP81cf45088cba4abcac1261385916d582','/restcomm-rvd/services/apps/AP81cf45088cba4abcac1261385916d582/controller','voice');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,32 @@ public interface ExtensionsConfigurationDao {
*/
boolean validate(ExtensionConfiguration extensionConfiguration);

/**/
/**
* Get account specific ExtensionConfiguration
* @param accountSid
* @param extensionSid
* @return ExtensionConfiguration
*/
ExtensionConfiguration getAccountExtensionConfiguration(String accountSid, String extensionSid);

/**/
/**
* Add a new account specific ExtensionConfiguration
* @param extensionConfiguration
* @param accountSid
*/
void addAccountExtensionConfiguration(ExtensionConfiguration extensionConfiguration, Sid accountSid) throws ConfigurationException;

/**/
/**
* Update an existing account specific ExtensionConfiguration
* @param extensionConfiguration
* @param accountSid
*/
void updateAccountExtensionConfiguration(ExtensionConfiguration extensionConfiguration, Sid accountSid) throws ConfigurationException;

/**/
/**
* Delete account specific ExtensionConfiguration
* @param accountSid
* @param extensionSid
*/
void deleteAccountExtensionConfiguration(String accountSid, String extensionSid);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.restcomm.connect.extension.api;

import java.util.Map;

public class CallResponse extends ExtensionResponse{
//expose all expected properties
// "outbound-proxy": [
// {
// "outbound-proxy": "outbound.proxy.com:5060",
// "username": "myusername",
// "password": "mypassword",
// "additional-headers": [
// {
// "header-name": "Route",
// "header-value": "sip:10.10.10.10:5080;transport=UDP;lr"
// },
// {
// "header-name": "X-Custom-Header1",
// "header-value": "ID-X-12345"
// }
// ]
// }
// ],
// username:{
// },
// password:{
// },
// proxy:{
// //proxy info here
// },

Map<String,String> additionalHeaders;
String outboundProxy;
String outboundProxyUsername;
String outboundProxyPassword;
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
package org.restcomm.connect.extension.api;
import org.apache.commons.configuration.Configuration;

public class ExtensionRequest {
private Object payload;
private Configuration configuration;

public ExtensionRequest() {}

public Object getObject() {
return payload;
}

public void setObject(Object object) {
this.payload = object;
}

public void setConfiguration(Configuration configuration) {
// TODO Auto-generated method stub
this.configuration = configuration;
}
public Configuration getConfiguration() {
// TODO Auto-generated method stub
return this.configuration;
}

}
/*
* TeleStax, Open Source Cloud Communications
* Copyright 2011-2013, Telestax Inc and individual contributors
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.restcomm.connect.extension.api;
import org.apache.commons.configuration.Configuration;

public class ExtensionRequest {
private Object payload;
private Configuration configuration;

public ExtensionRequest() {}

public Object getObject() {
return payload;
}

public void setObject(Object object) {
this.payload = object;
}

public void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}

public Configuration getConfiguration() {
return this.configuration;
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
package org.restcomm.connect.extension.api;
public class MessageExtensionResponse extends ExtensionResponse {
}
/*
* TeleStax, Open Source Cloud Communications
* Copyright 2011-2013, Telestax Inc and individual contributors
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
/**
* When an Extension returns a MessageReponse, RC will reconfigure the message it will send
*/
package org.restcomm.connect.extension.api;
public class MessageExtensionResponse extends ExtensionResponse {
//TODO: needs discussion, definition
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
package org.restcomm.connect.extension.api;
public class NodeExtensionResponse extends ExtensionResponse {
}
/*
* TeleStax, Open Source Cloud Communications
* Copyright 2011-2013, Telestax Inc and individual contributors
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
/**
* When an Extension returns a NodeReponse, RC will reconfigure the specific RC node it is in
*/
package org.restcomm.connect.extension.api;
public class NodeExtensionResponse extends ExtensionResponse {
//TODO: needs discussion, definition
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,15 @@ public interface RestcommExtensionGeneric {
*/
ExtensionResponse postApiAction(ApiRequest apiRequest);

/**
* Extension name getter
* @return String name of Extension
*/
String getName();

/**
* Extension version getter
* @return String version of Extension
*/
String getVersion();
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
package org.restcomm.connect.extension.api;
import org.apache.commons.configuration.Configuration;
public class SessionExtensionResponse extends ExtensionResponse {

public void setConfiguration(Configuration configuration){
super.setObject(configuration);
}
public Configuration getConfiguration(){
return (Configuration) super.getObject();
}
}
/*
* TeleStax, Open Source Cloud Communications
* Copyright 2011-2013, Telestax Inc and individual contributors
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
/**
* When an Extension returns a SessionReponse, RC will reconfigure the session it is in
*/
package org.restcomm.connect.extension.api;
import org.apache.commons.configuration.Configuration;
public class SessionExtensionResponse extends ExtensionResponse {
//TODO: needs discussion, definition
/**
* The Extension is expected to populate the session specific
* Configuration
*/
public void setConfiguration(Configuration configuration){
super.setObject(configuration);
}

/**
* RC expects an Extension to populate Configuration when it returns
* this SessionResponse
* @return Configuration object
*/
public Configuration getConfiguration(){
return (Configuration) super.getObject();
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
package org.restcomm.connect.extension.api;
public class SystemExtensionResponse extends ExtensionResponse {
}
/*
* TeleStax, Open Source Cloud Communications
* Copyright 2011-2013, Telestax Inc and individual contributors
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
/**
* When an Extension returns a SystemReponse, RC will reconfigure itself systemwide
*/
package org.restcomm.connect.extension.api;
public class SystemExtensionResponse extends ExtensionResponse {
//TODO: needs discussion, definition
}
Loading

0 comments on commit 09b166d

Please sign in to comment.