Skip to content

Commit b9c31a6

Browse files
committed
Patch for Play verb to support URL that don't point to wav files
This close #2308
1 parent 892d07f commit b9c31a6

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

  • restcomm/restcomm.commons/src/main/java/org/restcomm/connect/commons/cache

restcomm/restcomm.commons/src/main/java/org/restcomm/connect/commons/cache/DiskCache.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,20 @@ private URI handleExternalUrl(final DiskCacheRequest request) throws IOException
146146
}
147147

148148
final String extension = extension(uri).toLowerCase();
149-
final File path = new File(cacheDir + hash + "." + extension);
150-
if (!path.exists()) {
151-
downloader.download(uri, path);
149+
File path = null;
150+
if (extension.equalsIgnoreCase("wav")) {
151+
path = new File(cacheDir + hash + "." + extension);
152+
if (!path.exists()) {
153+
downloader.download(uri, path);
154+
}
155+
return URI.create(this.cacheUri + hash + "." + extension);
156+
} else {
157+
path = new File(cacheDir + hash + ".wav" );
158+
if (!path.exists()) {
159+
downloader.download(uri, path);
160+
}
161+
return URI.create(this.cacheUri + hash + ".wav");
152162
}
153-
return URI.create(this.cacheUri + hash + "." + extension);
154163
}
155164

156165
@Override

0 commit comments

Comments
 (0)