diff --git a/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java b/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java index 10044a9..a958031 100644 --- a/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java +++ b/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java @@ -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 diff --git a/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/RcmlSmsStep.java b/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/RcmlSmsStep.java index 6cc952a..788c090 100644 --- a/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/RcmlSmsStep.java +++ b/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/RcmlSmsStep.java @@ -9,6 +9,7 @@ public class RcmlSmsStep extends RcmlStep { String action; String method; String statusCallback; + String encoding; public String getText() { return text; } @@ -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; + } } diff --git a/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStep.java b/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStep.java index c1ca767..ac97612 100644 --- a/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStep.java +++ b/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStep.java @@ -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(); @@ -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(); @@ -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; } diff --git a/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStepConverter.java b/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStepConverter.java index 2aafef1..0f8d71e 100644 --- a/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStepConverter.java +++ b/designer/src/main/java/org/restcomm/connect/rvd/model/steps/sms/SmsStepConverter.java @@ -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()); } diff --git a/designer/src/main/java/org/restcomm/connect/rvd/upgrade/ProjectUpgrader111to112.java b/designer/src/main/java/org/restcomm/connect/rvd/upgrade/ProjectUpgrader111to112.java new file mode 100644 index 0000000..66fde63 --- /dev/null +++ b/designer/src/main/java/org/restcomm/connect/rvd/upgrade/ProjectUpgrader111to112.java @@ -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 + */ + +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"; + } +} diff --git a/designer/src/main/java/org/restcomm/connect/rvd/upgrade/ProjectUpgraderFactory.java b/designer/src/main/java/org/restcomm/connect/rvd/upgrade/ProjectUpgraderFactory.java index da8149c..e3829bf 100644 --- a/designer/src/main/java/org/restcomm/connect/rvd/upgrade/ProjectUpgraderFactory.java +++ b/designer/src/main/java/org/restcomm/connect/rvd/upgrade/ProjectUpgraderFactory.java @@ -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 diff --git a/designer/src/main/java/org/restcomm/connect/rvd/upgrade/UpgradeService.java b/designer/src/main/java/org/restcomm/connect/rvd/upgrade/UpgradeService.java index 224be3a..50482cf 100644 --- a/designer/src/main/java/org/restcomm/connect/rvd/upgrade/UpgradeService.java +++ b/designer/src/main/java/org/restcomm/connect/rvd/upgrade/UpgradeService.java @@ -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; @@ -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 @@ -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; diff --git a/designer/src/main/resources/validation/rvdproject/1.12/controlStep.json b/designer/src/main/resources/validation/rvdproject/1.12/controlStep.json new file mode 100644 index 0000000..6504291 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/controlStep.json @@ -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"]} + } +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/dialstep.json b/designer/src/main/resources/validation/rvdproject/1.12/dialstep.json new file mode 100644 index 0000000..ec0a2d0 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/dialstep.json @@ -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"] + } + } +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/emailStep.json b/designer/src/main/resources/validation/rvdproject/1.12/emailStep.json new file mode 100644 index 0000000..a3bea3b --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/emailStep.json @@ -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"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/externalServiceStep.json b/designer/src/main/resources/validation/rvdproject/1.12/externalServiceStep.json new file mode 100644 index 0000000..bba544a --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/externalServiceStep.json @@ -0,0 +1,112 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "External Service step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["externalService"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "url": {"type": "string", "minLength": 1}, + "method":{"enum": ["GET","POST","PUT","DELETE"]}, + "contentType":{"enum": ["application/x-www-form-urlencoded","application/json"]}, + "requestBody": {"type": "string"}, + "populatePostBodyFromParams": {"type":"boolean"}, + "username": {"type": "string"}, + "password": {"type": "string"}, + "urlParams": { + "type": "array", + "items": { "$ref": "#/definitions/urlParam"} + }, + "assignments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "moduleNameScope": { "$ref": "rvdproject-schema.json#/nullOrString" }, + "scope": {"type": "string"}, + "destVariable": {"type":"string", "minLength":1}, + "valueExtractor": {"$ref": "#/definitions/valueExtractor"} + }, + "required": ["moduleNameScope","destVariable","valueExtractor"], + "additionalProperties": false + } + }, + "doRouting": {"type":"boolean"}, + "nextType": {"enum": ["fixed","responseBased","mapped"]}, + "routeMappings": { + "type":"array", + "items": { + "type":"object", + "properties": { + "value": {"type":"string", "minLength":1}, + "next": {"type":"string", "minLength":1} + }, + "required": ["value","next"] + } + }, + "exceptionNext": {"type": "string"}, + "onTimeout": {"type":"string","minLength": 1} + }, + "required": ["name","kind","label","title","url","doRouting"], + + "definitions":{ + "urlParam": { + "type": "object", + "properties": { + "name": {"type":"string", "minLength": 1}, + "value": {"type":"string", "minLength": 1} + }, + "required": ["name","value"], + "additionalProperties": false + }, + "valueExtractor": { + "type": "object", + "properties": { + "accessOperations": { + "type": "array", + "items": { + "oneOf":[ + { + "type": "object", + "properties": { + "kind": {"enum": ["object"]}, + "fixed": {"enum": [true]}, + "terminal": {"enum":[false]}, + "action": {"enum":["propertyNamed"]}, + "property": {"type": "string", "minLength":1}, + "expression": {"type": "string"} + }, + "required": ["kind","fixed","terminal","action","property","expression"] + }, + { + "type": "object", + "properties": { + "kind": {"enum": ["array"]}, + "fixed": {"enum": [true]}, + "terminal": {"enum":[false]}, + "action": {"enum":["itemAtPosition"]}, + "position": {"type": "integer", "minimum":0}, + "expression": {"type": "string"} + }, + "required": ["kind","fixed","terminal","action","position","expression"] + }, + { + "type": "object", + "properties": { + "kind": {"enum": ["value"]}, + "fixed": {"enum": [true]}, + "terminal": {"enum":[true]}, + "expression": {"type": "string"} + }, + "required": ["kind","fixed","terminal","expression"] + } + ] + } + }, + "lastOperation": {"type":"null"} + } + } + } +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/faxStep.json b/designer/src/main/resources/validation/rvdproject/1.12/faxStep.json new file mode 100644 index 0000000..dc921aa --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/faxStep.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Fax step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["fax"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "text": {"type": "string"}, + "next": { "$ref": "rvdproject-schema.json#/nullOrString" }, + "to": {"type": "string"}, + "from": {"type": "string"}, + "method": {"enum": ["GET","POST"]}, + "statusCallback": {"type": "string"} + }, + "required": ["name","kind","label","title","text"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/gatherstep.json b/designer/src/main/resources/validation/rvdproject/1.12/gatherstep.json new file mode 100644 index 0000000..2cb02d6 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/gatherstep.json @@ -0,0 +1,57 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "RVD project 0.1", + "description": "Specification for RVD 7.1.4", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["gather"] }, + "label": {"type": "string"}, + "title": {"type": "string"}, + "method":{"enum": ["GET","POST"]}, + "timeout":{"type": "integer"}, + "finishOnKey":{ "type": "string", "pattern": "($^)|(^[0-9*#]$)" }, + "numDigits": {"type": "integer"}, + "steps": { + "type": "array", + "items": { + "type": "object", + "oneOf": [ + { "$ref": "saystep.json" }, + { "$ref": "playstep.json" } + ] + } + }, + "gatherType": {"enum": ["menu","collectdigits"]}, + "menu": { + "type": "object", + "properties": { + "mappings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "digits": {"type": "string","minLength":1}, + "next": {"type": "string","minLength":1}, + "scope": {"type": "string"} + }, + "required":["digits","next"] + }, + "minItems": 1 + } + }, + "required":["mappings"] + }, + "collectdigits": { + "type": "object", + "properties": { + "collectVariable": { "type":"string", "pattern":"^[A-Za-z]+[A-Za-z0-9_]*$" }, + "next": {"type": "string", "minLength": 1 } + }, + "required": ["collectVariable","next"] + } + }, + "required": ["name","kind","label","title","method","steps","gatherType"] + +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/hangupstep.json b/designer/src/main/resources/validation/rvdproject/1.12/hangupstep.json new file mode 100644 index 0000000..fb3d048 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/hangupstep.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Hangup step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["hungup"]}, + "label": {"type": "string"}, + "title": {"type": "string"} + }, + "required": ["name","kind","label","title"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/logStep.json b/designer/src/main/resources/validation/rvdproject/1.12/logStep.json new file mode 100644 index 0000000..59e7a14 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/logStep.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Log step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["log"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "message": {"type": "string"} + }, + "required": ["name","kind","label","title"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/pauseStep.json b/designer/src/main/resources/validation/rvdproject/1.12/pauseStep.json new file mode 100644 index 0000000..a923edb --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/pauseStep.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Pause step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["pause"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "length": {"type": "integer", "minimum": 1} + }, + "required": ["name","kind","label","title"] +} diff --git a/designer/src/main/resources/validation/rvdproject/1.12/playstep.json b/designer/src/main/resources/validation/rvdproject/1.12/playstep.json new file mode 100644 index 0000000..97e995f --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/playstep.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "RVD project 0.1", + "description": "Specification for RVD 7.1.4", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["play"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "playType": {"enum": ["local","remote"]}, + "local": { + "type": "object", + "properties": { + "wavLocalFilename": {"type": "string", "minLength":1} + }, + "required": ["wavLocalFilename"] + }, + "remote": { + "type": "object", + "properties": { + "wavUrl": {"type": "string", "minLength":1} + }, + "required": ["wavUrl"] + }, + "loop": {"type": "integer"} + }, + "required": ["name","kind","label","title","playType"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/recordStep.json b/designer/src/main/resources/validation/rvdproject/1.12/recordStep.json new file mode 100644 index 0000000..fc43d25 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/recordStep.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Record step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["record"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "next": { "$ref": "rvdproject-schema.json#/nullOrString" }, + "method":{"enum": ["GET","POST"]}, + "timeout":{"type":"integer"}, + "finishOnKey":{ "type": "string", "pattern": "($^)|(^[0-9*#]+$)|(^-1$)" }, + "maxLength": {"type": "integer", "minimum":1}, + "transcribe": { "type": "boolean" }, + "transcribeCallback": {"type": "string"}, + "playBeep": { "type": "boolean" }, + "media": {"enum": ["audio_only", "video_only", "audio_video"]} + }, + "required": ["name","kind","label","title","next"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/redirectStep.json b/designer/src/main/resources/validation/rvdproject/1.12/redirectStep.json new file mode 100644 index 0000000..8769e74 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/redirectStep.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Redirect step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["redirect"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "url": {"type": "string", "minLength": 1}, + "method": { + "oneOf": [ + {"type":"null"}, + {"enum":["GET","POST"]} + ] + } + }, + "required": ["name","kind","label","title","url","method"] +} diff --git a/designer/src/main/resources/validation/rvdproject/1.12/rejectStep.json b/designer/src/main/resources/validation/rvdproject/1.12/rejectStep.json new file mode 100644 index 0000000..5302f03 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/rejectStep.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Reject step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["reject"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "reason": {"enum": ["busy","rejected"]} + }, + "required": ["name","kind","label","title"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/rvdproject-schema.json b/designer/src/main/resources/validation/rvdproject/1.12/rvdproject-schema.json new file mode 100644 index 0000000..a5c4286 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/rvdproject-schema.json @@ -0,0 +1,89 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "RVD project 1.12", + "description": "Addition of SMS encoding attribute", + "rvdproject": { + "type": "object", + "properties": { + "header": { + "type":"object", + "uniqueItems": true, + "properties": { + "startNodeName": {"type": "string"}, + "projectKind": {"type": "string"}, + "version": {"type": "string"}, + "owner": {"type": "string"} + } + }, + "nodes": { + "type": "array", + "items": { + "title": "RVD module", + "type": "object", + "uniqueItems": true, + "properties": { + "name": {"type": "string"}, + "label": {"type": "string"}, + "kind": {"type": "string"}, + "steps": { + "type": "array", + "items": { + "type": "object", + "oneOf": [ + { "$ref": "saystep.json" }, + { "$ref": "playstep.json" }, + { "$ref": "gatherstep.json" }, + { "$ref": "dialstep.json" }, + { "$ref": "hangupstep.json" }, + { "$ref": "controlStep.json" }, + { "$ref": "externalServiceStep.json" }, + { "$ref": "logStep.json" }, + { "$ref": "rejectStep.json" }, + { "$ref": "pauseStep.json" }, + { "$ref": "redirectStep.json" }, + { "$ref": "smsStep.json" }, + { "$ref": "emailStep.json" }, + { "$ref": "recordStep.json" }, + { "$ref": "faxStep.json" }, + { "$ref": "ussdSayStep.json" }, + { "$ref": "ussdCollectStep.json" }, + { "$ref": "ussdLanguageStep.json" } + ] + } + } + }, + "required": ["name","label","steps"] + } + }, + "lastStepId": { + "type": "integer" + }, + "activeNode": { + "type": "integer" + }, + "lastNodeId": { + "type": "integer" + }, + "startNodeName": { + "type": "string" + } + } + }, + "nullOrString": { + "oneOf":[ + {"type":"null"}, + {"type":"string", "minLength":1} + ] + }, + "nullOrBoolean": { + "oneOf":[ + {"type":"null"}, + {"type":"boolean"} + ] + }, + "variableName": { + "type":"string", + "pattern":"^[A-Za-z]+[A-Za-z0-9_]*$" + } +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/saystep.json b/designer/src/main/resources/validation/rvdproject/1.12/saystep.json new file mode 100644 index 0000000..ca8f689 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/saystep.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Say step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["say"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "phrase": {"type": "string", "minLength":1}, + "voice": {"type": "string"}, + "language": {"type": "string"}, + "loop": {"type": "integer"} + }, + "required": ["name","kind","label","title","phrase"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/smsStep.json b/designer/src/main/resources/validation/rvdproject/1.12/smsStep.json new file mode 100644 index 0000000..87b2708 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/smsStep.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Sms step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["sms"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "text": {"type": "string"}, + "to" : {"type": "string"}, + "from" : {"type": "string"}, + "next": { "$ref": "rvdproject-schema.json#/nullOrString" }, + "method": {"enum": ["GET","POST"]}, + "statusCallback": {"type": "string"}, + "encoding":{"type":"string"} + }, + "required": ["name","kind","label","title","text","to","from"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/ussdCollectStep.json b/designer/src/main/resources/validation/rvdproject/1.12/ussdCollectStep.json new file mode 100644 index 0000000..6ca1024 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/ussdCollectStep.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "USSD Collect step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["ussdCollect"] }, + "label": {"type": "string"}, + "title": {"type": "string"}, + "messages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "text": {"type":"string"} + } + } + }, + "gatherType": {"enum": ["menu","collectdigits"]}, + "menu": { + "type": "object", + "properties": { + "mappings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "digits": {"type": "string"}, + "next": {"type": "string","minLength":1} + }, + "required":["digits","next"] + }, + "minItems": 1 + } + }, + "required":["mappings"] + }, + "collectdigits": { + "type": "object", + "properties": { + "collectVariable": { "$ref": "rvdproject-schema.json#/variableName" }, + "next": {"type": "string", "minLength": 1 } + }, + "required": ["collectVariable","next"] + } + }, + "required": ["name","kind","label","title","gatherType"] + +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/ussdLanguageStep.json b/designer/src/main/resources/validation/rvdproject/1.12/ussdLanguageStep.json new file mode 100644 index 0000000..5b2d6c1 --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/ussdLanguageStep.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "USSD Language step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["ussdLanguage"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "language": {"type": ["string","null"]} + }, + "required": ["name","kind","label","title","language"] +} + diff --git a/designer/src/main/resources/validation/rvdproject/1.12/ussdSayStep.json b/designer/src/main/resources/validation/rvdproject/1.12/ussdSayStep.json new file mode 100644 index 0000000..03c472f --- /dev/null +++ b/designer/src/main/resources/validation/rvdproject/1.12/ussdSayStep.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "USSD Say step", + "type": "object", + "properties": { + "name":{"type": "string"}, + "kind": {"enum": ["ussdSay"]}, + "label": {"type": "string"}, + "title": {"type": "string"}, + "text": {"type": "string"}, + "language": {"type": ["string","null"]} + }, + "required": ["name","kind","label","title","text"] +} + diff --git a/designer/src/main/webapp/js/app/controllers/designer.js b/designer/src/main/webapp/js/app/controllers/designer.js index b79931b..b60e005 100644 --- a/designer/src/main/webapp/js/app/controllers/designer.js +++ b/designer/src/main/webapp/js/app/controllers/designer.js @@ -174,6 +174,11 @@ var designerCtrl = App.controller('designerCtrl', function($scope, $q, $statePar {name:'th',text: 'Thai'}, {name:'tr',text: 'Turkish'} ]; + $scope.smsLanguages = [ + {name:'GSM',text:'GSM (default)'}, + {name:'UCS-2',text:'UCS-2'}, + {name:'UTF-8',text:'UTF-8'} + ]; $scope.methods = ['POST', 'GET']; $scope.ussdMaxEnglishChars = 182; diff --git a/designer/src/main/webapp/languages/en-US.json b/designer/src/main/webapp/languages/en-US.json index f631adb..e935129 100644 --- a/designer/src/main/webapp/languages/en-US.json +++ b/designer/src/main/webapp/languages/en-US.json @@ -558,5 +558,7 @@ "Mode": "Mode", "Resolution": "Resolution", "Layout": "Layout", - "Overlay": "Overlay" + "Overlay": "Overlay", + + "Encoding": "Encoding" } diff --git a/designer/src/main/webapp/languages/es.json b/designer/src/main/webapp/languages/es.json index cc2ed81..6dc7393 100644 --- a/designer/src/main/webapp/languages/es.json +++ b/designer/src/main/webapp/languages/es.json @@ -559,5 +559,7 @@ "Mode": "Mode", "Resolution": "Resolution", "Layout": "Layout", - "Overlay": "Overlay" + "Overlay": "Overlay", + + "Encoding": "Encoding" } diff --git a/designer/src/main/webapp/languages/pt-BR.json b/designer/src/main/webapp/languages/pt-BR.json index 633bce8..e591698 100644 --- a/designer/src/main/webapp/languages/pt-BR.json +++ b/designer/src/main/webapp/languages/pt-BR.json @@ -529,5 +529,7 @@ "Mode": "Mode", "Resolution": "Resolution", "Layout": "Layout", - "Overlay": "Overlay" + "Overlay": "Overlay", + + "Encoding": "Encoding" } diff --git a/designer/src/main/webapp/templates/steps/smsStep.html b/designer/src/main/webapp/templates/steps/smsStep.html index b81fd03..eecd258 100644 --- a/designer/src/main/webapp/templates/steps/smsStep.html +++ b/designer/src/main/webapp/templates/steps/smsStep.html @@ -10,9 +10,23 @@ {{'smsStepSmsTextLabel' | translate}}   -
- -
+
+
+
+
+ {{ 'Encoding' | translate }} + +
+
+
+
+
+ +
+
+