Koozali.org: home of the SME Server

SAIL v4.0.0-43 on SME 8 with Asterisk compiled, EXTLEN fix

Offline apmuthu

  • *
  • 244
  • +0/-0
SAIL v4.0.0-43 on SME 8 with Asterisk compiled, EXTLEN fix
« on: February 28, 2013, 07:00:33 PM »
Compiled asterisk and dahdi complete along with libpri from scratch on a freshly yummed SME 8 with all the devel libs.
Since a "make install" does not provide any rpms and entries in the rpm database, SAIL fails to install. Only a "--nodeps" forces it to install.

Extension length in the System -> Globals -> Extension Length menu is not being allowed to be edited even when there are no extensions created.

An earlier post referred to a template expansion from the SME CLI - is that the preferred method?

The actual error is at line 334 in /opt/sark/php/sarkglobal/view.php where the logic is inverted. Lines 333-340:
Code: [Select]
   $this->myPanel->aLabelFor('extlen');
   if ( $extensions ) {     
      $this->myPanel->selected = $global['EXTLEN'];
      $this->myPanel->popUp('EXTLEN', array('3','4'));
   }   
    else {
      echo '<input type="text" name="EXTLEN" size="1" style = "background-color: lightgrey" readonly="readonly" id="EXTLEN" value="' . $global['EXTLEN'] . '"  />' . PHP_EOL;
    }
should be
Code: [Select]
   $this->myPanel->aLabelFor('extlen');
   if ( ! $extensions ) {     
      $this->myPanel->selected = $global['EXTLEN'];
      $this->myPanel->popUp('EXTLEN', array('3','4'));
   }   
    else {
      echo '<input type="text" name="EXTLEN" size="1" style = "background-color: lightgrey" readonly="readonly" id="EXTLEN" value="' . $global['EXTLEN'] . '"  />' . PHP_EOL;
    }

This problem appears to have come when code was converted from Perl in SAIL v3.1.1-22 (/opt/sark/www/cgi-bin/sarkglobals.pl) to PHP in SAIL v4.0.0-43 (/opt/sark/php/sarkglobal/view.php) with the "unless" Perl Statement being an inverted logic of the PHP's "if" statement. The corresponding lines 914-930 in SAIL v3.1.1-22's /opt/sark/www/cgi-bin/sarkglobals.pl that stands correct are:

Code: [Select]
      print SarkSubs::aLabelFor('extlen');
      unless (@Extensions) {
        print $q->popup_menu (
                    -name     => 'EXTLEN',
                    -values  => ['3','4'],
                    -default  => $extlen,
                        -style    => "Color: $hashColorDefaults{EXTLEN}",
                -size     => 1);
      }
      else {
        print $q->textfield (
                    -name     => 'EXTLEN',
                    -default  => $extlen,
                        -readonly =>'readonly',
                        -style    =>'background-color: lightgrey',
                -size     => 1);
      }

It will hence be pertinent to check all conversions from "unless" to "if" from SAIL v3.1.1 to SAIL 4.0.0.

« Last Edit: March 01, 2013, 05:06:31 AM by apmuthu »

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: SAIL v4.0.0-43 on SME 8 with Asterisk compiled, EXTLEN fix
« Reply #1 on: March 01, 2013, 10:19:15 AM »
Good work Ap.muthu

Yes, you must use --nodeps if you compile asterisk.  Don't think there is any alternative to this. 

fixed the bug you spotted in svn

Best

S

Offline apmuthu

  • *
  • 244
  • +0/-0
Re: SAIL v4.0.0-43 on SME 8 with Asterisk compiled, EXTLEN fix
« Reply #2 on: March 01, 2013, 11:23:07 AM »
Attempting to compile Asterisk 1.8 on a fully yummed SME8 resulted in a dahdi-complete issue where the following patch had to be applied to the source before compilation succeeded:
Code: [Select]
--- drivers/dahdi/xpp/xdefs.h    (revision 6837)
+++ drivers/dahdi/xpp/xdefs.h    (Working Copy)
@@ -145,10 +145,12 @@
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
-/* Also don't define this for later RHEL >= 5.2 . hex_asc is from the
- * same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch
- * as is the bool typedef. */
-#if LINUX_VERSION_CODE != KERNEL_VERSION(2,6,18)  || !  defined(hex_asc)
+/* Also don't define this for later RHEL >= 5.2. */
+#if defined(RHEL_RELEASE_CODE) && defined(RHEL_RELEASE_VERSION)
+#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 3)
+typedef int            bool;
+#endif
+#else
 typedef int            bool;
 #endif
 #endif

SME 8 -> fully yummed -> Build RPMs -> DAHDI/LibPRI/Asterisk Sources Compiled with all options needed (any SAIL minimum that is not in the defaults?) -> SAIL 4 RPMS
 
Please list the sequence that would be necessary for such an install. Currently I am going in an iterative process - it will save the community a lot of time so that we can concentrate on debugging the actual SAIL code.
 
SME8 kernel is now on 348 whereas SAIL Asterisk DAHDI rpms are at 308-4 and Digium repos are at 308-24. Hence to get to Asterisk 1.8.20-1 with the safest latest kernel we will need to hand compile the dahdi drivers. Digium does not hand out the kmod-dahdi-linux-fw* src rpms to rebuild them for the newer kernel. Using a fake kernel rpm is one soultion besides the --justdb option.
 
Fake kernel src spec file:
Code: [Select]
Summary: dummy kernel-archpackage
Name: kernel-%_host_cpu
Version: 2.6.18
Release: 308.24.1.el5
License: public domain
Group: System Environment/kernel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: kernel = %version-%release
%description
Dummy package
%prep
%build
%install
%files
%changelog
* Fri Feb 8 2013 Andrew Ford <A.Ford@ford-mason.co.uk>
- Initial build.

 
« Last Edit: March 01, 2013, 05:05:28 PM by apmuthu »