diff options
author | Kinsey Moore <kmoore@digium.com> | 2012-06-19 21:13:41 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2012-06-19 21:13:41 +0000 |
commit | f080be134edec9e9fd7dc9175170db6fd946a010 (patch) | |
tree | 3531d5107d293d97ba5ef1e9dd955e4f63fbdc86 /main/channel.c | |
parent | 91157d5c2bdbc9eb44b799fde0df0841a34bfa4c (diff) |
Ensure that pvt cause information does not break native bridging
Channel drivers that allow native bridging need to handle
AST_CONTROL_PVT_CAUSE_CODE frames and previously did not handle them
properly, usually breaking out of the native bridge. This change
corrects that behavior and exposes the available cause code information
to the dialplan while native bridges are in place. This required
exposing the HANGUPCAUSE hash setter outside of channel.c, so
additional documentation has been added.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/main/channel.c b/main/channel.c index 9955dea68..59d40dc6c 100644 --- a/main/channel.c +++ b/main/channel.c @@ -4208,12 +4208,9 @@ static int attribute_const is_visible_indication(enum ast_control_frame_type con return 0; } -/*! \brief Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash - * on the given channel */ -static void set_hangupcause_hash(struct ast_channel *chan, const void *data) +void ast_channel_hangupcause_hash_set(struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code) { char causevar[256]; - const struct ast_control_pvt_cause_code *cause_code = data; snprintf(causevar, sizeof(causevar), "HASH(HANGUPCAUSE,%s)", cause_code->chan_name); ast_func_write(chan, causevar, cause_code->code); @@ -4368,7 +4365,7 @@ int ast_indicate_data(struct ast_channel *chan, int _condition, ts = ast_get_indication_tone(ast_channel_zone(chan), "congestion"); break; case AST_CONTROL_PVT_CAUSE_CODE: - set_hangupcause_hash(chan, data); + ast_channel_hangupcause_hash_set(chan, data); res = 0; break; case AST_CONTROL_PROGRESS: @@ -5515,7 +5512,7 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c break; case AST_CONTROL_PVT_CAUSE_CODE: - set_hangupcause_hash(chan, f->data.ptr); + ast_channel_hangupcause_hash_set(chan, f->data.ptr); break; /* Ignore these */ |