Summary:ASTERISK-17475: CNG or T.38 invite detected while call is bridged causes dialplan execution to stop after ReceiveFax
Reporter:Jay Reeder (escape2mtns)Labels:
Date Opened:2011-02-24 14:45:26.000-0600Date Closed:
Versions: 13.18.4 Frequency of
Environment:Attachments:( 0) chan_sip.patch
Description:We have calls that come in via SIP and are immediately routed out Dahdi PRI to a voice platform.  The call is answered by the Dial() function before bridging.  In cases where CNG or T.38 invite is detected after the call is bridged, the bridge is broken, the hangup extension is executed, and then the fax extension is executed.  When executing the fax extension, after the fax is received, ReceiveFax recognizes that the call has hung up and upon exiting should go to the hangup extension for post-fax processing.  Instead, the dialplan execution stops and we have no ability to perform fax reception processing (email fax or process with a script) because the dialplan never gets executed after the ReceiveFax.


I was able to resolve this issue by inserting the following just before the redirect to fax in chan_sip.c where CNG is detected:

       ast_set_flag(ast, AST_FLAG_BRIDGE_HANGUP_DONT);

and by inserting the following just before the redirect to fax in chan_sip.c where T.38 invite is detected:

             ast_set_flag(p->owner, AST_FLAG_BRIDGE_HANGUP_DONT);

Those flags prevent the hangup extension from being called when the bridge is broken, which allows proper processing of the fax extension so that we can process the fax after it is received successfully.

Actual version is but we had the same issues on
Comments:By: Matt Jordan (mjordan) 2012-09-05 08:51:28.822-0500

I inspected the 1.8+ code for chan_sip and it doesn't look like your fix ever got inserted into chan_sip.

Would you mind providing a patch for 1.8 and attaching it to this issue?  If possible, I'd like to get this fixed for later versions of Asterisk.

By: Jay Reeder (escape2mtns) 2012-09-09 17:46:57.738-0500

patch file for asterisk version

By: Jay Reeder (escape2mtns) 2012-09-09 17:51:53.862-0500

I've attached the patch file per request.  This is only a couple of lines of code, but the patch likely isn't in-line with coding requirements (it includes comments we made so that we could find the code changes).