[Home]

Summary:ASTERISK-09709: "ast_bridge_call: Bridge failed" after ChannelRedirect
Reporter:Dmitry Andrianov (dimas)Labels:
Date Opened:2007-06-19 18:58:31Date Closed:2007-10-30 11:13:43
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I want to create a feature which when activated by a person during a conversation, transfers peer to some internal service (using ChannelRedirect) and hangs up the person who activated the feature. This basically works but causes WARNING message on the Asterisk console which is probably not a good thing.

****** ADDITIONAL INFORMATION ******

( This one related to http://bugs.digium.com/view.php?id=9699 although not directly - I just using similar scenario for tests but issue is completely different )

feature.conf:

[applicationmap]
btfeat => *9,self/both,Macro,bridgetest

extensions.ael:

macro bridgetest() {
   ChannelRedirect(${BRIDGEPEER},btcontext,1,1);
};

context btcontext {
   1 => {
       Answer;
       Morsecode(SOS);
       Hangup;
   };
};

and then finally test extensions:

   131 => {
        Set(DYNAMIC_FEATURES=btfeat);
        Dial(Local/1002);
   };


Scenario 1 - caller activates feature

1. On softphone ext 1001 I dial 131
2. ext 1002 answers
3. Now I press *9 on caller (1001)
 = callee (1002) hears Morse code (that is correct)
 = At the same time, caller (1001) gets hung up and Asterisk console displays:
[Jun 20 02:51:37] WARNING[11710]: res_features.c:1460 ast_bridge_call: Bridge failed on channels SIP/1001-08679978 and AsyncGoto/SIP/1002-08677898<ZOMBIE>
 == Spawn extension (ael-default, 131, 2) exited non-zero on 'SIP/1001-08679978'

Scenario 2 - callee activates feature

1. On softphone ext 1001 I dial 131
2. ext 1002 answers
3. I press *9 on callee (1002)
 = caller (1001) hears Morse code (that is correct)
 = At the same time, callee (1002) gets hung up and Asterisk console displays:

[Jun 20 03:30:31] WARNING[12321]: res_features.c:1460 ast_bridge_call: Bridge failed on channels SIP/1001-08fbbaf8 and SIP/1002-08fb0218
 == Spawn extension (btcontext, 1, 0) exited non-zero on 'SIP/1001-08fbbaf8'


My guess is that this happens because after leaving from feature macro Asterisk tries to resume (???) call while channels are not part of the same call anymore.

I tried explicitly hanging up the channel in the bridgetest macro after the ChannelRedirect application:
1. When I did SoftHangup(${CHANNEL}); - nothing changed at all and everything worked exactly the same way as explained above
2. When I did Hangup; the Scenario 1 above worked just fine - no warnings, but Scenario 2 did not work at all - when callee activated feature, both channels were immediately hung up.
Comments:By: Digium Subversion (svnbot) 2007-08-30 18:35:26

Repository: asterisk
Revision: 81401

------------------------------------------------------------------------
r81401 | file | 2007-08-30 18:35:26 -0500 (Thu, 30 Aug 2007) | 4 lines

(closes issue ASTERISK-9709)
Reported by: dimas
Don't output a bridge failed warning message if it failed because one of the channels was part of the masquerade process. That is perfectly normal.

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-08-30 18:37:24

Repository: asterisk
Revision: 81402

------------------------------------------------------------------------
r81402 | file | 2007-08-30 18:37:24 -0500 (Thu, 30 Aug 2007) | 12 lines

Merged revisions 81401 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81401 | file | 2007-08-30 20:53:41 -0300 (Thu, 30 Aug 2007) | 4 lines

(closes issue ASTERISK-9709)
Reported by: dimas
Don't output a bridge failed warning message if it failed because one of the channels was part of the masquerade process. That is perfectly normal.

........

------------------------------------------------------------------------

By: Dmitry Andrianov (dimas) 2007-08-30 19:32:19

Well, I re-run my tests with you patch and found that the patch only closes half of issue. When caller activates feature everything is Ok, but when callee activates it, I still have the warning - please see console output for the whole call below:

   -- Executing [131@ael-default:1] Set("SIP/1001-0a0c0130", "_DYNAMIC_FEATURES=btfeat") in new stack
   -- Executing [131@ael-default:2] Dial("SIP/1001-0a0c0130", "Local/1002@ael-default") in new stack
   -- Called 1002@ael-default
   -- Executing [1002@ael-default:1] Macro("Local/1002@ael-default-cf6c,2", "stdexten|1002|SIP/1002&IAX2/1002") in new stack
   -- Executing [s@macro-stdexten:1] Set("Local/1002@ael-default-cf6c,2", "ext=1002") in new stack
   -- Executing [s@macro-stdexten:2] Set("Local/1002@ael-default-cf6c,2", "dev=SIP/1002&IAX2/1002") in new stack
   -- Executing [s@macro-stdexten:3] Dial("Local/1002@ael-default-cf6c,2", "SIP/1002&IAX2/1002/1002|20|") in new stack
   -- Called 1002
[Aug 31 04:35:10] WARNING[11788]: app_dial.c:1106 dial_exec_full: Unable to create channel of type 'IAX2' (cause 3 - No route to destination)

<XXX> please ignore this warning, I just have both IAX+SIP for this user and only SIP is registered at the moment

   -- SIP/1002-0a0cf518 is ringing
   -- Local/1002@ael-default-cf6c,1 is ringing
   -- SIP/1002-0a0cf518 answered Local/1002@ael-default-cf6c,2
   -- Local/1002@ael-default-cf6c,1 stopped sounds
   -- Local/1002@ael-default-cf6c,1 answered SIP/1001-0a0c0130
 == Spawn extension (macro-stdexten, s, 3) exited non-zero on 'Local/1002@ael-default-cf6c,2' in macro 'stdexten'
 == Spawn extension (macro-stdexten, s, 3) exited non-zero on 'Local/1002@ael-default-cf6c,2'
   -- Packet2Packet bridging SIP/1001-0a0c0130 and SIP/1002-0a0cf518
   -- Packet2Packet bridging SIP/1001-0a0c0130 and SIP/1002-0a0cf518
   --  Feature Found: btfeat exten: btfeat
   -- Executing [s@macro-bridgetest:1] NoOp("SIP/1002-0a0cf518", "SIP/1001-0a0c0130") in new stack
   -- Executing [s@macro-bridgetest:2] ChannelRedirect("SIP/1002-0a0cf518", "SIP/1001-0a0c0130|btcontext|1|1") in new stack
[Aug 31 04:35:17] WARNING[11785]: res_features.c:1461 ast_bridge_call: Bridge failed on channels SIP/1001-0a0c0130 and SIP/1002-0a0cf518, res = -1
 == Spawn extension (btcontext, 1, 0) exited non-zero on 'SIP/1001-0a0c0130'
   -- Executing [1@btcontext:1] Answer("SIP/1001-0a0c0130", "") in new stack
   -- Executing [1@btcontext:2] Morsecode("SIP/1001-0a0c0130", "SOS") in new stack
   -- Executing [1@btcontext:3] Hangup("SIP/1001-0a0c0130", "") in new stack
 == Spawn extension (btcontext, 1, 3) exited non-zero on 'SIP/1001-0a0c0130'

By: Digium Subversion (svnbot) 2007-10-30 11:12:00

Repository: asterisk
Revision: 87571

U   branches/1.4/res/res_features.c

------------------------------------------------------------------------
r87571 | file | 2007-10-30 11:11:59 -0500 (Tue, 30 Oct 2007) | 4 lines

Add two more checks before printing out a warning message about bridging. If either channel has hungup of course the bridge will have failed.
(closes issue ASTERISK-9709)
Reported by: dimas

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-10-30 11:13:42

Repository: asterisk
Revision: 87572

_U  trunk/
U   trunk/res/res_features.c

------------------------------------------------------------------------
r87572 | file | 2007-10-30 11:13:42 -0500 (Tue, 30 Oct 2007) | 12 lines

Merged revisions 87571 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r87571 | file | 2007-10-30 13:13:39 -0300 (Tue, 30 Oct 2007) | 4 lines

Add two more checks before printing out a warning message about bridging. If either channel has hungup of course the bridge will have failed.
(closes issue ASTERISK-9709)
Reported by: dimas

........

------------------------------------------------------------------------