Summary:ASTERISK-20455: dialplan fails to run the invalid "i" extension due to an uninitialized variable dat_exten in main/pbx.c
Reporter:Richard Miller (ulogic)Labels:
Date Opened:2012-09-20 22:59:26Date Closed:2012-10-09 17:26:27
Versions: 10.8.0 11.0.0-beta2 Frequency of
is caused byASTERISK-18243 VoiceMail application fails to assign some DTMF codes for application exit when using d() option with context
Environment:Fedora Core 5 i686 i386, gcc 4.1.1Attachments:( 0) pbx-
Description:The dialplan fails to run the invalid "i" extension due to an uninitialized variable dat_exten in main/pbx.c

In the following code I had to use the word OR instead of the pipe characters because JIRA was causing the text to display in an unexpected fashion.

Because dst_exten contains random data, it fails at the block of code that reads:

{code:title=in version}
if (invalid
OR (ast_strlen_zero(dst_exten) &&
 !ast_exists_extension(c, c->context, c->exten, 1,
  S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL)))) {

{code:title=in version 11.0.0-beta2}
if (invalid
OR (ast_strlen_zero(dst_exten) &&
 !ast_exists_extension(c, ast_channel_context(c), ast_channel_exten(c), 1,
 S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, NULL)))) {

I have another newer system under CentOS 6.2 x86_64 that does not exhibit the problem, but nevertheless, there is a flaw in the code that goes back many generations.

My company's production system had been running Asterisk for several years under Fedora Core 5.  I wanted to use some of the newer features in Asterisk 1.8, so I installed the latest version.  However, when I tried placing a call, it would not go through.

The console showed:
auto fallthrough, channel 'SIP/131-00000005' status is 'UNKNOWN'

My dialplan uses the i extension in several places and this was happening right where it should have dispatched extension i.  Once I applied the one line patch I am submitting, the problem went away.
Comments:By: Richard Miller (ulogic) 2012-09-21 06:49:06.986-0500

Even though these past issues have been closed and marked as "fixed", I'll bet you anything they are related to the problem I just isolated.


By: Richard Mudgett (rmudgett) 2012-10-09 17:02:05.217-0500

The patch for ASTERISK-18243 introduced the use of dst_exten[] being used uninitialized.  The problem is not as old as indicated.