2.0 BUG FIX for embedded pbxadmin MOH module!!!

Discussion in 'General' started by gl1176, Aug 27, 2010.

  1. gl1176

    Joined:
    Oct 5, 2009
    Messages:
    55
    Likes Received:
    0
    Hi,

    Not sure where to post this fix I found so here it goes...


    Please replace below in /var/www/html/modules/pbxadmin/index.php

    // The next block is to fix a music on hold issue
    $category = strtr(isset($_REQUEST['category'])?$_REQUEST['category']:''," ./\"\'\`", "------");
    if ($category == null) $category = 'default';

    if ($category == "default")
    $path_to_dir = $asterisk_conf['astvarlibdir']."/".$amp_conf["MOHDIR"]."/"; //path to directory u want to read.
    else
    $path_to_dir = $asterisk_conf['astvarlibdir']."/".$amp_conf["MOHDIR"]."/$category/"; //path to directory u want to read.

    $GLOBALS['path_to_dir'] = $path_to_dir;

    $path_to_moh_dir = $amp_conf['ASTVARLIBDIR'].'/'.$amp_conf['MOHDIR'];
    $GLOBALS['path_to_moh_dir'] = $path_to_moh_dir;


    I think it's currently is:

    // The next block is to fix a music on hold issue
    $category = strtr(isset($_REQUEST['category'])?$_REQUEST['category']:''," ./\"\'\`", "------");
    if ($category == null) $category = 'default';

    if ($category == "default")
    $path_to_dir = $asterisk_conf['astvarlibdir']."/mohmp3"; //path to directory u want to read.
    else
    $path_to_dir = $asterisk_conf['astvarlibdir']."/mohmp3/$category"; //path to directory u want to read.

    $GLOBALS['path_to_dir'] = $path_to_dir;



    Thanks, and keep up the good work!


    Gil
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Thank you for your efforts, I ask you to please take the time to post it at http://bugs.elastix.org (the link at the bottom of this page named "bug-tracker")

    It might well help others, or even the Elastix developers.

    dicko
     
  3. gl1176

    Joined:
    Oct 5, 2009
    Messages:
    55
    Likes Received:
    0
    Ok, just updated my original post for a better format.

    There is still a bug...

    In writing to the /etc/asterisk/musiconhold_additional.conf the pbxadmin embedded version creates this output:

    [default]
    mode=files
    directory=/
    [none]
    mode=files
    directory=/.nomusic_reserved


    When freepbx does it puts the correct output:

    [default]
    mode=files
    directory=/var/lib/asterisk/moh/
    random=yes
    [none]
    mode=files
    directory=/var/lib/asterisk/moh/.nomusic_reserved


    So there is still something wrong in the code.. I don't know where yet.

    But at least I fixed the gui look and uploading from the pbxadmin...

    hopefully we can get this fixed.
     
  4. gl1176

    Joined:
    Oct 5, 2009
    Messages:
    55
    Likes Received:
    0
    Ok, more digging into the issue, and I found the fix.


    I updated the fix again to original post.


    Thanks
     
  5. ramoncio

    Joined:
    May 12, 2010
    Messages:
    1,663
    Likes Received:
    0
    Hi gl1176, nice work.

    Coould you please fulfill a bug into the bugtracker, as dicko suggested?

    Thank you
     
  6. gl1176

    Joined:
    Oct 5, 2009
    Messages:
    55
    Likes Received:
    0
    Ok, i submitted the bug to the bugs section.


    Currently trying to fix mp3 uploading issue with centos/freepbx without getting error messages.

    I have compiled sox, mpg123, lame, and a few others from source.

    I can get the sox command to work fine in the shell mp3 to wav, but still get the errors in pbxadmin and freepbx MoH section.
     
  7. gl1176

    Joined:
    Oct 5, 2009
    Messages:
    55
    Likes Received:
    0
    After I posted bug to the bugs.elastix.org site, I got a reply back needing more info on what this bug fixes. The status of the bug record changed to feedback, so I gave an explanation to the fix. The status of the bug record never changed back to the assigned programmer, and I could not find a way to change the status.

    Is there a way to change the status so the can add this fix into the code?
     

Share This Page