mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
app.c: Allow ampersands in playback lists to be escaped.
Any function or application that accepts a `&`-separated list of
filenames can now include a literal `&` in a filename by wrapping the
entire filename in single quotes, e.g.:
```
exten = _X.,n,Playback('https://example.com/sound.cgi?a=b&c=d'&hello-world)
```
Fixes #172
UpgradeNote: Ampersands in URLs passed to the `Playback()`,
`Background()`, `SpeechBackground()`, `Read()`, `Authenticate()`, or
`Queue()` applications as filename arguments can now be escaped by
single quoting the filename. Additionally, this is also possible when
using the `CONFBRIDGE` dialplan function, or configuring various
features in `confbridge.conf` and `queues.conf`.
(cherry picked from commit f8212d4594
)
This commit is contained in:
committed by
Asterisk Development Team
parent
989e61890a
commit
f19b74ad31
@@ -371,7 +371,8 @@ static void play_files_helper(struct ast_channel *chan, const char *prompts)
|
||||
char *prompt, *rest = ast_strdupa(prompts);
|
||||
|
||||
ast_stopstream(chan);
|
||||
while ((prompt = strsep(&rest, "&")) && !ast_stream_and_wait(chan, prompt, "")) {
|
||||
while ((prompt = ast_strsep(&rest, '&', AST_STRSEP_STRIP | AST_STRSEP_TRIM))
|
||||
&& !ast_stream_and_wait(chan, prompt, "")) {
|
||||
ast_stopstream(chan);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user