diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-11-29 00:28:10 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-11-29 00:28:10 +0000 |
commit | 53a5f2284963bd60a912f332d379c6c7fc3e06f3 (patch) | |
tree | 210d7ee2d2606a92c83abe9cbc972f9cb8ec96e1 /main | |
parent | 8a3e984b0c4c681909f8b8940d020a4e1141e9a3 (diff) |
Merged revisions 90145 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r90145 | russell | 2007-11-28 18:20:34 -0600 (Wed, 28 Nov 2007) | 5 lines
This set of changes is to make some callerID handling thread-safe.
The ast_set_callerid() function needed to lock the channel. Also, the handlers
for the CALLERID() dialplan function needed to lock the channel when reading
or writing callerid values directly on the channel structure.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index 0dd937c1e..219485939 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3758,6 +3758,8 @@ int ast_do_masquerade(struct ast_channel *original) void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char *cid_name, const char *cid_ani) { + ast_channel_lock(chan); + if (cid_num) { if (chan->cid.cid_num) ast_free(chan->cid.cid_num); @@ -3788,6 +3790,8 @@ void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char chan->cid.cid_pres, ast_describe_caller_presentation(chan->cid.cid_pres) ); + + ast_channel_unlock(chan); } int ast_setstate(struct ast_channel *chan, enum ast_channel_state state) |