Skip to content
Open
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 @@ -57,7 +57,7 @@ public class RvdConfiguration {
public static final String USERS_DIRECTORY_NAME = "@users";

public static final String WAVS_DIRECTORY_NAME = "wavs";
private static final String RVD_PROJECT_VERSION = "1.11"; // version for rvd project syntax
private static final String RVD_PROJECT_VERSION = "1.12"; // version for rvd project syntax
private static final String PACKAGING_VERSION = "1.0";
private static final String RAS_APPLICATION_VERSION = "2"; // version of the RAS application specification
public static final String STICKY_PREFIX = "sticky_"; // a prefix for rvd sticky variable names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class RcmlSmsStep extends RcmlStep {
String action;
String method;
String statusCallback;
String encoding;
public String getText() {
return text;
}
Expand Down Expand Up @@ -45,4 +46,11 @@ public String getStatusCallback() {
public void setStatusCallback(String statusCallback) {
this.statusCallback = statusCallback;
}
public String getEncoding() {
return encoding;
}

public void setEncoding(String encoding) {
this.encoding = encoding;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class SmsStep extends Step {
String statusCallback;
String method;
String next;
String encoding;

public static SmsStep createDefault(String name, String phrase) {
SmsStep step = new SmsStep();
Expand Down Expand Up @@ -92,6 +93,9 @@ public String getStatusCallback() {
public void setStatusCallback(String statusCallback) {
this.statusCallback = statusCallback;
}
public String getEncoding() {
return encoding;
}
public RcmlSmsStep render(Interpreter interpreter) {
RcmlSmsStep rcmlStep = new RcmlSmsStep();

Expand All @@ -108,6 +112,7 @@ public RcmlSmsStep render(Interpreter interpreter) {
rcmlStep.setTo(interpreter.populateVariables(getTo()));
rcmlStep.setStatusCallback(getStatusCallback());
rcmlStep.setText(interpreter.populateVariables(getText()));
rcmlStep.setEncoding(getEncoding());

return rcmlStep;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingCo
writer.addAttribute("method", step.getMethod());
if (step.getAction() != null )
writer.addAttribute("action", step.getAction());
if (step.getEncoding() != null)
writer.addAttribute("encoding", step.getEncoding());

writer.setValue(step.getText());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.rvd.upgrade;

import com.google.gson.JsonElement;

/**
* @author Orestis Tsakiridis
*/
public class ProjectUpgrader111to112 implements ProjectUpgrader {
@Override
public JsonElement upgrade(JsonElement sourceElement) {
sourceElement = ProjectUpgrader10to11.setVersion(sourceElement, getResultingVersion());
return sourceElement;
}

@Override
public String getResultingVersion() {
return "1.12";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
public class ProjectUpgraderFactory {

public static ProjectUpgrader create(String version) throws NoUpgraderException {
if ("1.11".equals(version)) {
return new ProjectUpgrader111to112();
} else
if ("1.10".equals(version)) {
return new ProjectUpgrader110to111();
} else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

package org.restcomm.connect.rvd.upgrade;

import java.util.Arrays;
import java.util.List;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;

import org.restcomm.connect.rvd.BuildService;
import org.restcomm.connect.rvd.RvdConfiguration;
import org.restcomm.connect.rvd.exceptions.InvalidProjectVersion;
Expand All @@ -38,8 +37,8 @@
import org.restcomm.connect.rvd.upgrade.exceptions.NoUpgradePathException;
import org.restcomm.connect.rvd.upgrade.exceptions.UpgradeException;

import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import java.util.Arrays;
import java.util.List;

/**
* @author otsakir@gmail.com - Orestis Tsakiridis
Expand Down Expand Up @@ -70,6 +69,11 @@ public UpgradeService(WorkspaceStorage workspaceStorage) {
* @throws InvalidProjectVersion
*/
public static boolean checkBackwardCompatible(String checkedProjectVesion, String referenceProjectVersion) throws InvalidProjectVersion {
if ( "1.12".equals(referenceProjectVersion)) {
if ( "1.12".equals(checkedProjectVesion))
return true;
return false;
} else
if ( "1.11".equals(referenceProjectVersion)) {
if ( "1.11".equals(checkedProjectVesion) || "1.10".equals(checkedProjectVesion) || "1.9".equals(checkedProjectVesion) || "1.8".equals(checkedProjectVesion) || "1.7".equals(checkedProjectVesion) || "1.6".equals(checkedProjectVesion) )
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Say step",
"type": "object",
"properties": {
"name":{"type": "string"},
"kind": {"enum": ["control"]},
"label": {"type": "string"},
"title": {"type": "string"},
"conditions":{
"type": "array",
"items": { "$ref": "#/definitions/condition"}
},
"actions":{
"type":"array",
"items": { "$ref": "#/definitions/action"}
},
"conditionExpression":{"type":"string"}
},
"required": ["name","kind"],
"definitions": {
"condition": {
"type":"object",
"properties": {
"name": {"type":"string", "minLength": 1},
"operator": {"type":"string", "enum": ["equals","notequal","greater","greaterEqual","less","lessEqual","matches"]},
"comparison": {
"type": "object",
"properties": {
"operand1": {"type":"string"},
"operand2": {"type":"string"},
"type": {"type":"string","enum": ["text","numeric"]}
},
"required": ["operand1","operand2","type"]
},
"matcher": {
"type":"object",
"properties": {
"text": {"type":"string"},
"regex": {"type":"string"}
},
"required": ["text","regex"]
}
},
"required": ["name","operator"]
},
"action": {
"type":"object",
"properties": {
"name": {"type":"string", "minLength": 1},
"assign": {
"type": "object",
"properties": {
"expression": {"type":"string"},
"varName": { "$ref": "rvdproject-schema.json#/variableName" },
"varScope": { "$ref": "#/definitions/varScope"}
},
"required": ["expression","varName"]
},
"continueTo": {
"type": "object",
"properties": {
"target": {"type":"string","minLength": 1}
},
"required": ["target"]
},
"capture": {
"type": "object",
"properties": {
"regex": {"type":"string"},
"data": {"type":"string"},
"varName": { "$ref": "rvdproject-schema.json#/variableName" },
"varScope": { "$ref": "#/definitions/varScope"}
}
}
},
"required": ["name"]
},
"varScope": {"enum": ["mod","app"]}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Dial step",
"type": "object",
"properties": {
"name":{"type": "string"},
"kind": {"enum": ["dial"]},
"label": {"type": "string"},
"title": {"type": "string"},
"method":{"enum": ["GET","POST"]},
"timeout":{"type":"integer"},
"timeLimit":{"type":"integer"},
"callerId":{"type":"string"},
"record": {"type":"boolean"},
"dialNouns": {
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/numberNoun" },
{ "$ref": "#/definitions/clientNoun" },
{ "$ref": "#/definitions/conferenceNoun" },
{ "$ref": "#/definitions/sipuriNoun" }
]
}
},
"nextModule": {"type":"string"}
},
"required": ["name","kind","label","title","dialNouns"],

"definitions": {
"numberNoun": {
"type":"object",
"properties": {
"dialType": {"enum":["number"]},
"destination":{"type":"string"},
"sendDigits": { "type": "string", "minLength":1 },
"beforeConnectModule":{ "type": "string", "minLength":1 },
"statusCallback": {"type": "string"},
"statusCallbackModule": {"type":"string","minLength": 1}
},
"required":["dialType","destination"]
},
"clientNoun": {
"type":"object",
"properties": {
"dialType": {"enum":["client"]},
"destination":{"type":"string"},
"beforeConnectModule":{ "type": "string", "minLength":1 },
"statusCallback": {"type": "string"},
"statusCallbackModule": {"type":"string","minLength": 1},
"enableVideo": {"type": "boolean"},
"videoOverlay": {"type": "string"}
},
"required": ["dialType","destination"]
},
"conferenceNoun": {
"type":"object",
"properties": {
"dialType": {"enum":["conference"]},
"destination": {"type":"string"},
"nextModule": {"type": "string", "minLength":1},
"muted": {"type": "boolean"},
"beep": {"type": "boolean"},
"startConferenceOnEnter": {"type": "boolean"},
"endConferenceOnExit": {"type": "boolean"},
"waitUrl": { "type":"string", "minLength":1 },
"waitModule": {"type": "string", "minLength":1},
"waitMethod": {"enum":["GET","POST"]},
"maxParticipants": {"type":"integer"},
"statusCallback": {"type": "string"},
"statusCallbackModule": {"type":"string","minLength": 1},
"enableVideo": {"type": "boolean"},
"videoMode": {"type": "string"},
"videoResolution": {"type": "string"},
"videoLayout": {"type": "string"},
"videoOverlay": {"type": "string"}
},
"required": ["dialType","destination"]
},
"sipuriNoun": {
"type":"object",
"properties": {
"dialType": {"enum":["sipuri"]},
"destination":{"type":"string"},
"statusCallback": {"type": "string"},
"statusCallbackModule": {"type":"string","minLength": 1},
"enableVideo": {"type": "boolean"},
"videoOverlay": {"type": "string"}
},
"required": ["dialType","destination"]
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Email step",
"type": "object",
"properties": {
"name":{"type": "string"},
"kind": {"enum": ["email"]},
"label": {"type": "string"},
"title": {"type": "string"},
"text": {"type": "string"},
"next": { "$ref": "rvdproject-schema.json#/nullOrString" },
"to": {"type": "string"},
"from": {"type": "string"},
"cc": {"type": "string"},
"bcc": {"type": "string"},
"subject": {"type": "string"},
"method": {"enum": ["GET","POST"]},
"statusCallback": {"type": "string"}
},
"required": ["name","kind","label","title","text","from","to","subject"]
}

Loading