Merged revisions 90145 via svnmerge from
[asterisk/asterisk.git] / main / channel.c
index 0dd937c..2194859 100644 (file)
@@ -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)