aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-29 00:28:10 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-29 00:28:10 +0000
commit4efbdfc704f10aac8f3a9284ae8e69dddd1ea3b5 (patch)
tree210d7ee2d2606a92c83abe9cbc972f9cb8ec96e1 /main
parent633b7b4f97532d6bcfe9c26a3bb3183118ce7a6e (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: http://svn.digium.com/svn/asterisk/trunk@90146 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c4
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)