diff options
author | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-17 14:58:39 +0000 |
---|---|---|
committer | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-17 14:58:39 +0000 |
commit | a464816f6c27b208cbaf997a3dd24add3fa6bac3 (patch) | |
tree | 37966b79e2f86dffd64ad6718586e932d97149af /include | |
parent | a4ba40ed053eeace7aeec7ea7677cfe4ab6b1af2 (diff) |
Prevent a potential race condition and crash when hanging up a channel by removing the channel from the channel list before begining channel tear down.
This fix may potentially cause problems with CDR backends that access the channel a CDR is associated with via the channel list. This fix makes the channel unavabile at the time when the CDR backend is invoked. This has been documented in include/asterisk/cdr.h.
(closes issue #15316)
Reported by: vmarrone
Tested by: mnicholson
Review: https://reviewboard.asterisk.org/r/362/
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219136 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/cdr.h | 5 | ||||
-rw-r--r-- | include/asterisk/channel.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h index 3d576b712..738292e98 100644 --- a/include/asterisk/cdr.h +++ b/include/asterisk/cdr.h @@ -112,6 +112,11 @@ int ast_cdr_serialize_variables(struct ast_cdr *cdr, char *buf, size_t size, cha void ast_cdr_free_vars(struct ast_cdr *cdr, int recur); int ast_cdr_copy_vars(struct ast_cdr *to_cdr, struct ast_cdr *from_cdr); +/*!\brief CDR backend callback + * \warning CDR backends should NOT attempt to access the channel associated + * with a CDR record. This channel is not guaranteed to exist when the CDR + * backend is invoked. + */ typedef int (*ast_cdrbe)(struct ast_cdr *cdr); /*! \brief Allocate a CDR record diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 92c86fca5..2a835c96c 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -515,6 +515,8 @@ enum { * bridge terminates, this will allow the hangup in the pbx loop to be run instead. * */ AST_FLAG_BRIDGE_HANGUP_DONT = (1 << 17), + /*! This flag indicates whether the channel is in the channel list or not. */ + AST_FLAG_IN_CHANNEL_LIST = (1 << 19), }; /*! \brief ast_bridge_config flags */ |