summaryrefslogtreecommitdiff
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-06-19 21:13:41 +0000
committerKinsey Moore <kmoore@digium.com>2012-06-19 21:13:41 +0000
commitf080be134edec9e9fd7dc9175170db6fd946a010 (patch)
tree3531d5107d293d97ba5ef1e9dd955e4f63fbdc86 /channels/chan_iax2.c
parent91157d5c2bdbc9eb44b799fde0df0841a34bfa4c (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 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 8f42bf385..a723d2cf4 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -5593,19 +5593,24 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha
res = AST_BRIDGE_COMPLETE;
break;
}
- if ((f->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS) && (f->subclass.integer != AST_CONTROL_SRCUPDATE)) {
- *fo = f;
- *rc = who;
- res = AST_BRIDGE_COMPLETE;
- break;
- }
other = (who == c0) ? c1 : c0; /* the 'other' channel */
+ if ((f->frametype == AST_FRAME_CONTROL)) {
+ if (f->subclass.integer == AST_CONTROL_PVT_CAUSE_CODE) {
+ ast_channel_hangupcause_hash_set(other, f->data.ptr);
+ } else if (!(flags & AST_BRIDGE_IGNORE_SIGS)
+ && (f->subclass.integer != AST_CONTROL_SRCUPDATE)) {
+ *fo = f;
+ *rc = who;
+ res = AST_BRIDGE_COMPLETE;
+ break;
+ }
+ }
if ((f->frametype == AST_FRAME_VOICE) ||
(f->frametype == AST_FRAME_TEXT) ||
(f->frametype == AST_FRAME_VIDEO) ||
(f->frametype == AST_FRAME_IMAGE) ||
(f->frametype == AST_FRAME_DTMF) ||
- (f->frametype == AST_FRAME_CONTROL)) {
+ (f->frametype == AST_FRAME_CONTROL && f->subclass.integer != AST_CONTROL_PVT_CAUSE_CODE)) {
/* monitored dtmf take out of the bridge.
* check if we monitor the specific source.
*/