Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Labels:
      None
    • Source Revision Number:
      89114
    • Mantis ID:
      11196
    • Regression:
      No

      Description

      Some parts of asterisk support RealTime, but others don't. This patch is an implementation of RT for res_musiconhold. Now you can store MOH classes in text config and RT engine. Classes from RT engine override classes from text config.

      To use it, add a line to your extconfig.conf:
      musiconhold => mysql,asterisk

      Every time MOH starts, search is perfomed first in RT engine, then in memory (linked list of classes created from musiconhold.conf).

      If MOH class is found in RT engine - separate structure is created in memory. This structure is not added to linked list (mohclasses) and will be destroyed as soon as MOH will stop.

                • ADDITIONAL INFORMATION ******

      MySQL table for MOH-RT:

      CREATE TABLE `musiconhold` (
      `name` varchar(80) NOT NULL,
      `directory` varchar(255) NOT NULL default '',
      `application` varchar(255) NOT NULL default '',
      `mode` varchar(80) NOT NULL default '',
      `digit` char(1) NOT NULL default '',
      `sort` varchar(16) NOT NULL default '',
      `format` varchar(16) NOT NULL default '',
      PRIMARY KEY (`name`)
      );

      1. moh-realtime-final-r89168.diff
        11 kB
        Sergey Tamkovich
      2. moh-realtime-r89114.diff
        8 kB
        Sergey Tamkovich
      3. moh-realtime-v2-r89133.diff
        10 kB
        Sergey Tamkovich
      4. moh-rt-final-v2-r89168.diff
        12 kB
        Sergey Tamkovich
      5. moh-rt-final-v3.2-r89168.diff
        13 kB
        Sergey Tamkovich
      6. moh-rt-final-v4-r89168.diff
        13 kB
        Sergey Tamkovich
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        Sergey Tamkovich added a comment -

        putnopvut, Thanks again!

        1. fixed
        2. not sure (i'm valgrind noob)
        3. fixed
        4. warning changed to debug message.

        Show
        Sergey Tamkovich added a comment - putnopvut, Thanks again! 1. fixed 2. not sure (i'm valgrind noob) 3. fixed 4. warning changed to debug message.
        Hide
        Mark Michelson added a comment -

        I just gave this a test, and it looks like you're one "else" away from having the mp3 part perfect. In local_ast_moh_start, just add an else before

        if (ast_pthread_create_background(&mohclass->thread, NULL, monmp3thread, mohclass)) {

        I'm going to be out of town and unable to test this for the next four days, but I will be back in the office on Monday and will do some regression tests.

        Show
        Mark Michelson added a comment - I just gave this a test, and it looks like you're one "else" away from having the mp3 part perfect. In local_ast_moh_start, just add an else before if (ast_pthread_create_background(&mohclass->thread, NULL, monmp3thread, mohclass)) { I'm going to be out of town and unable to test this for the next four days, but I will be back in the office on Monday and will do some regression tests.
        Hide
        Sergey Tamkovich added a comment -

        Here is the last "else"

        Show
        Sergey Tamkovich added a comment - Here is the last "else"
        Hide
        Mark Michelson added a comment -

        I ended up getting busy with some other work and didn't get a chance to do regression tests on this today. I'll do it tomorrow though and report my findings.

        Show
        Mark Michelson added a comment - I ended up getting busy with some other work and didn't get a chance to do regression tests on this today. I'll do it tomorrow though and report my findings.
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 89946

        U trunk/CHANGES
        U trunk/configs/extconfig.conf.sample
        U trunk/configs/musiconhold.conf.sample
        U trunk/res/res_musiconhold.c

        ------------------------------------------------------------------------
        r89946 | mmichelson | 2007-11-27 18:44:48 -0600 (Tue, 27 Nov 2007) | 24 lines

        Adding support for realtime music on hold. The following are the main points:

        1. When moh is started, we search first in memory to find the class. If we do not
        find it in memory, we search realtime instead.

        2. When moh is restarted (as in, it had been started on this particular channel, stopped,
        and now we're starting it again), if using the "files" mode, then realtime will always
        be rechecked. If you are using other modes, however, we will simply reattach to the external
        running process which was playing moh earlier in the call. This is a necessary compromise so that
        we don't end up with too many background processes.

        3. musiconhold.conf has a general section now. It has one option: cachertclasses. If set to yes,
        then moh classes found in realtime will be added to the in-memory list. This has the advantage
        of not requiring database lookups each time moh is started, but it has the disadvantage of not
        truly being realtime.

        I have tested this for functionality, and it passes. I also tested this under valgrind and there
        are no memory problems reported under typical use.

        Special thanks to Sergee for implementing this feature and enduring my complaints on the bugtracker!

        (closes issue ASTERISK-10718, reported and patched by sergee)

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

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 89946 U trunk/CHANGES U trunk/configs/extconfig.conf.sample U trunk/configs/musiconhold.conf.sample U trunk/res/res_musiconhold.c ------------------------------------------------------------------------ r89946 | mmichelson | 2007-11-27 18:44:48 -0600 (Tue, 27 Nov 2007) | 24 lines Adding support for realtime music on hold. The following are the main points: 1. When moh is started, we search first in memory to find the class. If we do not find it in memory, we search realtime instead. 2. When moh is restarted (as in, it had been started on this particular channel, stopped, and now we're starting it again), if using the "files" mode, then realtime will always be rechecked. If you are using other modes, however, we will simply reattach to the external running process which was playing moh earlier in the call. This is a necessary compromise so that we don't end up with too many background processes. 3. musiconhold.conf has a general section now. It has one option: cachertclasses. If set to yes, then moh classes found in realtime will be added to the in-memory list. This has the advantage of not requiring database lookups each time moh is started, but it has the disadvantage of not truly being realtime. I have tested this for functionality, and it passes. I also tested this under valgrind and there are no memory problems reported under typical use. Special thanks to Sergee for implementing this feature and enduring my complaints on the bugtracker! (closes issue ASTERISK-10718 , reported and patched by sergee) ------------------------------------------------------------------------

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development