Summary:ASTERISK-07108: [patch] ast_channel_bridge in channel.c doesn't check AST_FEATURE_REDIRECT before deciding if a native bridge is suitable
Reporter:Nick Burch (gagravarr)Labels:
Date Opened:2006-06-06 12:36:55Date Closed:2006-07-06 16:43:28
Versions:Frequency of
Environment:Attachments:( 0) channel.c.diff
Description:In ast_channel_bridge, on line 3523 (in 1.2.7), it decides if two channels can be natively bridged together.

It fails to check to see if the bridge config requests AST_FEATURE_REDIRECT from either party. So, if you pass a 't' option to Dial, it will request a bridge with redirects enabled. If both parties are on the same technology, channel.c will ignore this, perform a native bridge, the redirect won't be processed, and you won't be able to transfer.

The fix is to make the "native bridge is ok" code also check for the AST_FEATURE_REDIRECT flag on the bridge config:

--- channel.c.sav       2006-06-06 17:19:51.000000000 +0100
+++ channel.c   2006-06-06 17:26:37.000000000 +0100
@@ -3523,7 +3523,9 @@
                   (config->timelimit == 0) &&
                   (c0->tech->bridge == c1->tech->bridge) &&
                   !nativefailed && !c0->monitor && !c1->monitor &&
-                   !c0->spies && !c1->spies) {
+                   !c0->spies && !c1->spies &&
+                       !ast_test_flag(&(config->features_callee),AST_FEATURE_REDIRECT) &&
+                       !ast_test_flag(&(config->features_caller),AST_FEATURE_REDIRECT) ) {
                       /* Looks like they share a bridge method and nothing else is in the way */
                       if (option_verbose > 2)
                               ast_verbose(VERBOSE_PREFIX_3 "Attempting native bridge of %s and %s\n", c0->name, c1->name);
Comments:By: Serge Vecher (serge-v) 2006-06-06 12:42:10

can you please upload this change as a patchfile? And get a Disclaimer on file. Thanks.

By: Nick Burch (gagravarr) 2006-06-06 12:53:45

Patch uploaded, and disclaimer faxed through.

By: Matt O'Gorman (mogorman) 2006-07-06 16:43:28

fixed in branch 1.2 and trunk thanks for the patch