[Home]

Summary:ASTERISK-12896: [patch] Support a 'no-patterns' option for the Realtime switch
Reporter:fhackenberger (fhackenberger)Labels:
Date Opened:2008-10-15 07:31:17Date Closed:2008-12-15 15:17:03.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/New Feature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20081211__bug13698.diff.txt
( 1) realtime_no_ext_pattern
( 2) realtime_no_ext_pattern_r153040.patch
Description:This patch adds a 'no-patterns' option to the Realtime dialplan switch in order to be able to reduce the number of
SELECT * FROM extension_table WHERE exten LIKE '\\_%' AND ...
statements.

This is very useful in dialplans with a lot of includes.
Comments:By: Leif Madsen (lmadsen) 2008-10-15 08:27:31

As this is not a bug (but rather a feature with a patch attached), you will need to make it for trunk as opposed to 1.4.x since it won't be accepted into 1.4.

Thanks!

By: fhackenberger (fhackenberger) 2008-10-31 03:41:14

Added a patch for trunk against r153040. Compiles just fine. Judging from the source code the patch should work just fine (the function it affects is just the same as in 1.4). The diff between the 1.4 patch and the 1.6 patch boils down to:
28c28
<       var = ast_load_realtime(table, ematch, rexten, "context", context, "priority", pri, NULL);
---
>       var = ast_load_realtime(table, ematch, rexten, "context", context, "priority", pri, SENTINEL);
31c31
<               cfg = ast_load_realtime_multientry(table, "exten LIKE", "\\_%", "context", context, "priority", pri, NULL);
---
>               cfg = ast_load_realtime_multientry(table, "exten LIKE", "\\_%", "context", context, "priority", pri, SENTINEL);
34c34

By: Tilghman Lesher (tilghman) 2008-12-11 18:37:12.000-0600

I'd prefer something along these lines, which uses standard option parsing.  Good idea, though.

By: fhackenberger (fhackenberger) 2008-12-12 02:28:36.000-0600

That's fine with me, I was simply not aware of that API. Thanks for the patch!

By: Digium Subversion (svnbot) 2008-12-15 15:17:02.000-0600

Repository: asterisk
Revision: 164485

U   trunk/CHANGES
U   trunk/configs/extconfig.conf.sample
U   trunk/pbx/pbx_realtime.c

------------------------------------------------------------------------
r164485 | tilghman | 2008-12-15 15:17:02 -0600 (Mon, 15 Dec 2008) | 7 lines

Allow disabling pattern match searches within the Realtime dialplan switch.
(closes issue ASTERISK-12896)
Reported by: fhackenberger
Patches:
      20081211__bug13698.diff.txt uploaded by Corydon76 (license 14)
Tested by: fhackenberger

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

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