mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +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`.
This commit is contained in:
committed by
asterisk-org-access-app[bot]
parent
31c44d0634
commit
ca931c9436
@@ -3035,7 +3035,7 @@ static int action_playback(struct ast_bridge_channel *bridge_channel, const char
|
||||
char *file_copy = ast_strdupa(playback_file);
|
||||
char *file = NULL;
|
||||
|
||||
while ((file = strsep(&file_copy, "&"))) {
|
||||
while ((file = ast_strsep(&file_copy, '&', AST_STRSEP_STRIP | AST_STRSEP_TRIM))) {
|
||||
if (ast_stream_and_wait(bridge_channel->chan, file, "")) {
|
||||
ast_log(LOG_WARNING, "Failed to playback file %s to channel\n", file);
|
||||
return -1;
|
||||
@@ -3059,7 +3059,7 @@ static int action_playback_and_continue(struct confbridge_conference *conference
|
||||
char *file_copy = ast_strdupa(playback_file);
|
||||
char *file = NULL;
|
||||
|
||||
while ((file = strsep(&file_copy, "&"))) {
|
||||
while ((file = ast_strsep(&file_copy, '&', AST_STRSEP_STRIP | AST_STRSEP_TRIM))) {
|
||||
if (ast_streamfile(bridge_channel->chan, file, ast_channel_language(bridge_channel->chan))) {
|
||||
ast_log(LOG_WARNING, "Failed to playback file %s to channel\n", file);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user