diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-30 19:21:04 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-30 19:21:04 +0000 |
commit | 527c601d0cf28b0b062a1e6d1ea1ec02cb9568dd (patch) | |
tree | 89d592fc9e276ed41a21062589ea44fedcf6d0d2 /apps/app_externalivr.c | |
parent | 4c3aecfc55663f0ed9d441aa2d2b2d4ddd35e28e (diff) |
Lock around variables retrieved, and copy the values, if they stay persistent,
since another thread could remove them.
(closes issue #12541)
Reported by: snuffy
Patches:
bug_12156_apps.diff uploaded by snuffy (license 35)
Several additional changes by me
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_externalivr.c')
-rw-r--r-- | apps/app_externalivr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 3bf7dd1c7..a93abb4a8 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -251,10 +251,13 @@ static void ast_eivr_getvariable(struct ast_channel *chan, char *data, char *out break; } - value = pbx_builtin_getvar_helper(chan, variable); - if(!value) + ast_channel_lock(chan); + if (!(value = pbx_builtin_getvar_helper(chan, variable))) { value = ""; + } + ast_str_append(&newstring, 0, "%s=%s,", variable, value); + ast_channel_unlock(chan); ast_copy_string(outbuf, newstring->str, outbuflen); } }; |