Asterisk
  1. Asterisk
  2. ASTERISK-12896

[patch] Support a 'no-patterns' option for the Realtime switch

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Addons/New Feature
    • Labels:
      None
    • Mantis ID:
      13698
    • Regression:
      No

      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.

      1. 20081211__bug13698.diff.txt
        3 kB
        Tilghman Lesher
      2. realtime_no_ext_pattern
        2 kB
      3. realtime_no_ext_pattern_r153040.patch
        2 kB
        fhackenberger

        Activity

        Hide
        Leif Madsen added a comment -

        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!

        Show
        Leif Madsen added a comment - 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!
        Hide
        fhackenberger added a comment -

        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

        Show
        fhackenberger added a comment - 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
        Hide
        Tilghman Lesher added a comment -

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

        Show
        Tilghman Lesher added a comment - I'd prefer something along these lines, which uses standard option parsing. Good idea, though.
        Hide
        fhackenberger added a comment -

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

        Show
        fhackenberger added a comment - That's fine with me, I was simply not aware of that API. Thanks for the patch!
        Hide
        Digium Subversion added a comment -

        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

        Show
        Digium Subversion added a comment - 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

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development