Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
* 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
package org.restcomm.connect.commons.telephony;

public enum CreateCallType {
CLIENT, PSTN, SIP, USSD
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,43 @@
* 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 class ExtensionRequest implements IExtensionRequest{
private boolean allowed = true;
private String accountSid;
public ExtensionRequest() {
this("", true);
}
public ExtensionRequest(String accountSid, boolean allowed) {
this.accountSid = accountSid;
this.allowed = allowed;
}

public void setObject(Object object) {
this.payload = object;
/**
* IExtensionRequest
* @return get accountSid
*/
@Override
public String getAccountSid() {
return this.accountSid;
}

public void setConfiguration(Configuration configuration) {
this.configuration = configuration;
/**
* IExtensionRequest
* @return is allowed
*/
@Override
public boolean isAllowed() {
return this.allowed;
}

public Configuration getConfiguration() {
return this.configuration;
/**
* IExtensionRequest
* @param is allowed
*/
@Override
public void setAllowed(boolean allowed) {
this.allowed = allowed;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package org.restcomm.connect.extension.api;

import java.util.ArrayList;
import java.util.Map;

import org.restcomm.connect.commons.dao.Sid;
import org.restcomm.connect.commons.telephony.CreateCallType;

public interface IExtensionCreateCallRequest extends IExtensionRequest {

/**
* @return the from address
*/
String getFrom();

/**
* @return the to address
*/
String getTo();

/**
* @return the accountId
*/
Sid getAccountId();

/**
* @return boolean if is from EP
*/
boolean isFromApi();

/**
* @return boolean if this is a child call
*/
boolean isParentCallSidExists();

/**
* @return the CreateCallType
*/
CreateCallType getType();

/**
* @return the outboundProxy
*/
String getOutboundProxy();

/**
* @param outboundProxy the outboundProxy to set
*/
void setOutboundProxy(String outboundProxy);

/**
* @return the outboundProxyUsername
*/
String getOutboundProxyUsername();

/**
* @param outboundProxyUsername the outboundProxyUsername to set
*/
void setOutboundProxyUsername(String outboundProxyUsername);

/**
* @return the outboundProxyPassword
*/
String getOutboundProxyPassword();

/**
* @param outboundProxyPassword the outboundProxyPassword to set
*/
void setOutboundProxyPassword(String outboundProxyPassword);

/**
* @return the outboundProxyHeaders
*/
Map<String,ArrayList<String>> getOutboundProxyHeaders();

/**
* @param outboundProxyHeaders the outboundProxyHeaders to set
*/
void setOutboundProxyHeaders(Map<String,ArrayList<String>> outboundProxyHeaders);

/**
* @return the Request URI
*/
String getRequestURI();
}
22 changes: 17 additions & 5 deletions .../extension/api/NodeExtensionResponse.java → ...pi/IExtensionCreateSmsSessionRequest.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@
* 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

import org.apache.commons.configuration.Configuration;

public interface IExtensionCreateSmsSessionRequest extends IExtensionRequest {
/**
* FIXME: potentially we will change this to be specific properties
* rather than a whole Config object
* @param set Configuration object
*/
void setConfiguration(Configuration configuration);

/**
* FIXME: potentially we will change this to be specific properties
* rather than a whole Config object
* @return the Configuration object
*/
Configuration getConfiguration();
}
23 changes: 18 additions & 5 deletions ...tension/api/MessageExtensionResponse.java → ...nect/extension/api/IExtensionRequest.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,23 @@
* 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

public interface IExtensionRequest {

/**
* @return the accountId as String
* FIXME: should this be at this level?
*/
String getAccountSid();

/**
* @return whether request should proceed
*/
boolean isAllowed();

/**
* @param set to allow/restrict request
*/
void setAllowed(boolean allowed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public interface RestcommExtensionGeneric {
* and either block/allow it or modify the session before Restcomm process it
* @return ExtensionResponse see ExtensionResponse
*/
ExtensionResponse preOutboundAction(ExtensionRequest extensionRequest);
ExtensionResponse preOutboundAction(IExtensionRequest extensionRequest);
/**
* Method that will be executed AFTER the process of an Outbound session
* Implement this method so you will be able to check the Outgoing session
* and either block or allow or modify the session after Restcomm process it
* @return ExtensionResponse see ExtensionResponse
*/
ExtensionResponse postOutboundAction(CallRequest callRequest);
ExtensionResponse postOutboundAction(IExtensionRequest extensionRequest);

/**
* Method that will be executed before the process of an API action, such as DID purchase (but after security checks)
Expand Down

This file was deleted.

This file was deleted.

Loading