[Home]

Summary:ASTERISK-17703: [patch] 'e' special extension fails to trigger in at least two cases
Reporter:Kenneth Shumard (kshumard)Labels:
Date Opened:2011-04-18 14:45:16Date Closed:2011-04-26 17:18:44
Priority:MinorRegression?No
Status:Closed/CompleteComponents:PBX/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) issue19136_v1.8.patch
( 1) pbx.c.e-patch
Description:https://wiki.asterisk.org/wiki/display/AST/The+Asterisk+Dialplan says, "e - This extension will substitute as a catchall for any of the 'i', 't', or 'T' extensions, if any of them do not exist and catching the error in a single routine is desired. The function EXCEPTION may be used to query the type of exception or the location where it occurred."

The attached patch attempts to make this statement more true. In testing, neither 'i' nor 't' was present but when the appropriate conditions were met the channel didn't move it to the 'e' extension. The patch throws an exception if WaitExten results in a timeout, and explicitly jumps to e,1 when an invalid extension is entered and there's no 'i' (though the proposed patch might not be the proper way to accomplish this).

pbx_builtin_background should also throw an exception if it times out, but currently doesn't. I just didn't know the appropriate logic to use at the end of the function to add it in.

****** STEPS TO REPRODUCE ******

[e-test]
exten => s,1,Background(main-menu)
same => n,WaitExten(2) ; comment this to see that Background times out without throwing an exception

exten => e,1,NoOp(Exception caught: '${EXCEPTION(reason)}')
same => n,Goto(s,1)
Comments:By: Richard Mudgett (rmudgett) 2011-04-22 18:31:28

The issue19136_v1.8.patch contains the fixes in pbx.c.e-patch as well as several more items I found for the 'e' extension.

The Background application should not be raising a timeout exception because:
1) It changes behavior.
2) If a timeout happens the dialplan continues executing with the next priority.  I think this is more desirable than an exception anyway.

By: Leif Madsen (lmadsen) 2011-04-25 06:53:58

Just adding a reminder for mnicholson as I believe he is the original author of the 'e' extension.

By: Digium Subversion (svnbot) 2011-04-26 17:14:33

Repository: asterisk
Revision: 315645

U   branches/1.8/main/pbx.c

------------------------------------------------------------------------
r315645 | rmudgett | 2011-04-26 17:14:32 -0500 (Tue, 26 Apr 2011) | 21 lines

The 'e' special extension fails to trigger in at least two cases.

The 'e' extension is a fall back for the 'i', 't', or 'T' extensions if
any of them do not exist.  Many of the places the 'e' extension was
supposed to be invoked fail because the priority was set wrong.  There
were two places where the 'e' extension was not even checked for fall
back.

* Made invoke the 'e' extension similarly to the previous 'i', 't', or 'T'
extension check and added the 'e' extension as a fall back to the two
missing locations.

* Prioritized and optimized some hangup tests associated with the 'e'
extension.

(closes issue ASTERISK-17703)
Reported by: kshumard
Tested by: rmudgett

Review: https://reviewboard.asterisk.org/r/1196/

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

http://svn.digium.com/view/asterisk?view=rev&revision=315645

By: Digium Subversion (svnbot) 2011-04-26 17:18:43

Repository: asterisk
Revision: 315649

_U  trunk/
U   trunk/main/pbx.c

------------------------------------------------------------------------
r315649 | rmudgett | 2011-04-26 17:18:43 -0500 (Tue, 26 Apr 2011) | 28 lines

Merged revisions 315645 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 r315645 | rmudgett | 2011-04-26 17:14:31 -0500 (Tue, 26 Apr 2011) | 21 lines
 
 The 'e' special extension fails to trigger in at least two cases.
 
 The 'e' extension is a fall back for the 'i', 't', or 'T' extensions if
 any of them do not exist.  Many of the places the 'e' extension was
 supposed to be invoked fail because the priority was set wrong.  There
 were two places where the 'e' extension was not even checked for fall
 back.
 
 * Made invoke the 'e' extension similarly to the previous 'i', 't', or 'T'
 extension check and added the 'e' extension as a fall back to the two
 missing locations.
 
 * Prioritized and optimized some hangup tests associated with the 'e'
 extension.
 
 (closes issue ASTERISK-17703)
 Reported by: kshumard
 Tested by: rmudgett
 
 Review: https://reviewboard.asterisk.org/r/1196/
........

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

http://svn.digium.com/view/asterisk?view=rev&revision=315649