[asterisk-bugs] [Asterisk 0010834]: [patch]Empty vars in AEL2 switches lead to dropped calls

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Oct 3 09:03:22 CDT 2007


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=10834 
====================================================================== 
Reported By:                adiemus
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   10834
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:            1.4.10  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-27-2007 17:59 CDT
Last Modified:              10-03-2007 09:03 CDT
====================================================================== 
Summary:                    [patch]Empty vars in AEL2 switches lead to dropped
calls
Description: 
Occasionally my telco doesn't signal CID data properly, leaving me empty
vars for CALLERID(number) and CALLERID(name).  In my dialplan, I have the
following structure:

switch(${CALLERID(number)}) {
    case 1234567890:
       NoOp(Call from 1234567890);
       break;
    default:
       NoOp(No special processing);
}

In the case of a blank CALLERID(number) I'd expect the default path to
run.  However, this AEL gets translated to:

exten => s,16,Goto(sw-12-${CALLERID(number)}|10)
exten => s,17,NoOp(Finish switch-pstn-inbound-12)
exten => _sw-12-.,10,NoOp(No special processing);
exten => _sw-12-.,11,Goto(s|17)
exten => sw-12-1234567890,10,NoOp(Call from 1234567890)
exten => sw-12-1234567890,11,Goto(s|17)

So when asterisk processes it, I end up with:

    -- Executing [s at pstn-inbound:12] Goto("Zap/4-1", "sw-12-|10") in new
stack
    -- Goto (pstn-inbound,sw-12-,10)
[Sep 27 17:58:13] WARNING[32414]: pbx.c:2450 __ast_pbx_run: Channel
'Zap/4-1' sent into invalid extension 'sw-12-' in context 'pstn-inbound',
but no invalid handler
    -- Hungup 'Zap/4-1'

Not quite sure where the "bug" is here since obviously "sw-12-" won't be
matched by "_sw-12-."  Maybe this is the desired behavior and I'm wrong.

For now I'm just checking if CALLERID(number) is empty first, and
populating it with "0000000000" before the switch() which works around the
problem.

  -Chris

====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 10-03-07 09:03  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 84511

U   branches/1.4/pbx/ael/ael-test/ref.ael-ntest10
U   branches/1.4/pbx/ael/ael-test/ref.ael-test1
U   branches/1.4/pbx/ael/ael-test/ref.ael-test18
U   branches/1.4/pbx/ael/ael-test/ref.ael-test3
U   branches/1.4/pbx/ael/ael-test/ref.ael-test5
U   branches/1.4/pbx/ael/ael-test/ref.ael-test8
U   branches/1.4/pbx/ael/ael-test/ref.ael-vtest13
U   branches/1.4/pbx/ael/ael-test/ref.ael-vtest17
U   branches/1.4/pbx/pbx_ael.c

------------------------------------------------------------------------
r84511 | murf | 2007-10-03 09:03:20 -0500 (Wed, 03 Oct 2007) | 1 line

closes issue http://bugs.digium.com/view.php?id=10834 ; where a null input to a
switch statement results in
a hangup; since switch is implemented with extensions, and the default case
is implemented with a '.', and the '.' matches 1 or more remaining
characters, the case where 0 characters exist isn't matched, and the
extension isn't matched, and the goto fails, and a hangup occurs. Now, when
a default case is generated, it also generates a single fixed extension
that will match a null input. That extension just does a goto to the
default extension for that switch. I played with an alternate solution,
where I just tack an extra char onto all the patterns and the goto, but not
the default case's pattern. Then even a null input will still have at least
one char in it. But it made me nervous, having that extra char in , even if
that's a pretty secret and low-level issue.
------------------------------------------------------------------------ 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-03-07 09:03  svnbot         Checkin                                      
10-03-07 09:03  svnbot         Note Added: 0071391                          
10-03-07 09:03  svnbot         Status                   feedback => assigned
======================================================================




More information about the asterisk-bugs mailing list