Skip to content

Commit 11362fd

Browse files
committed
added support for tenantID that is sent to audio gateway
1 parent 8a0bae6 commit 11362fd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

config/configure.properties.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ IAMAPIKey=
1111
# Choosing which skill set to use (Required parameter)
1212
skillset=
1313

14+
# tenant ID can be passed (Optional parameter for customers with just one tenant - Required parameter for customers that have more then one tenant linked on their IBM ID account)
15+
#tenantID=
16+
1417
# Client language specific preferences can be passed (Optional parameter with a default value: en-US)
1518
#language=en-US
1619

src/main/java/wa/client/Client.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public class Client extends WebSocketListener implements ThreadManager, Runnable
9898
private Boolean watsonSsl = true;
9999

100100
private String userID = null;
101+
102+
private String tenantID = null;
101103

102104
private String watsonVoice = null;
103105

@@ -1071,7 +1073,7 @@ private void initialize(Properties props) {
10711073

10721074
String noSsl = props.getProperty("nossl", "false");
10731075
watsonSsl = noSsl.equalsIgnoreCase("false");
1074-
// the userId
1076+
tenantID = props.getProperty("tenantID");
10751077
userID = props.getProperty("userID");
10761078
watsonVoice = props.getProperty("voice");
10771079
commandSocketPort = Integer.parseInt(props.getProperty("cmdSocketPort", "10010"));
@@ -1090,6 +1092,7 @@ private void initialize(Properties props) {
10901092
LOG.info("WATSON PORT (Optional): " + watsonPort);
10911093
LOG.info("SKILLSET: " + skillset);
10921094
LOG.info("WATSON IAM API Key: " + (null == iamApiKey ? "null" : "*****"));
1095+
LOG.info("TENANT ID (Optional): " + tenantID);
10931096
LOG.info("USER ID (Optional): " + userID);
10941097
LOG.info("Language (Optional): " + language);
10951098
LOG.info("Engine (Optional): " + engine);
@@ -1227,7 +1230,7 @@ private synchronized void connect() throws InterruptedException {
12271230

12281231
try {
12291232
// Build request
1230-
String webSocketUrl = (watsonSsl ? "wss" : "ws") + "://" + watsonHost + (watsonPort == null ? "" : ":" + watsonPort) + "?skillset=" + skillset + "&userID=" + userID
1233+
String webSocketUrl = (watsonSsl ? "wss" : "ws") + "://" + watsonHost + (watsonPort == null ? "" : ":" + watsonPort) + "?skillset=" + skillset + "&tenantID=" + tenantID + "&userID=" + userID
12311234
+ "&language=" + language + "&engine=" + engine;
12321235
Request request = new Request.Builder().url(webSocketUrl).addHeader("Authorization", "Bearer " + iamAccessToken).build();
12331236

0 commit comments

Comments
 (0)