<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/2041/1/7/_/styles/combined.css?spaceKey=AST&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+on+%28Open%29Solaris">Asterisk on (Open)Solaris</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~bklang">Ben Klang</a>
    </h4>
        <br/>
                         <h4>Changes (3)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >to find the following section: <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">~pp~</span> <span class="diff-added-words"style="background-color: #dfd;">{code}</span> <br></td></tr>
            <tr><td class="diff-unchanged" ># Define standard directories for various platforms <br># These apply if they are not redefined in asterisk.conf <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >  ASTMANDIR=/opt/asterisk/man <br>else <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">~/pp~</span> <span class="diff-added-words"style="background-color: #dfd;">{code}</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>Note that, despite the comment, these definitions have build-time and run-time implications.  Make sure you <br>make these changes BEFORE you build! <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">%</span>h4.</span> FAX support with SpanDSP <br></td></tr>
            <tr><td class="diff-unchanged" >I have been able to get this to work reliably.  If you are running Asterisk 1.6 note [Ticket 16342|https://issues.asterisk.org/view.php?id=16342] if <br>you do not install SpanDSP to the default locations (/usr/include and /usr/lib).  T.38 FAX over SIP works <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="Asteriskon%28Open%29Solaris-AsteriskonSolaris10andOpenSolaris"></a>Asterisk on Solaris 10 and OpenSolaris</h2>

<h6><a name="Asteriskon%28Open%29Solaris-Onthispage"></a>On this page</h6>
<div>
<ul>
    <li><a href='#Asteriskon%28Open%29Solaris-AsteriskonSolaris10andOpenSolaris'>Asterisk on Solaris 10 and OpenSolaris</a></li>
<ul>
    <li><a href='#Asteriskon%28Open%29Solaris-Digium%27sSupportStatus'>Digium's Support Status</a></li>
    <li><a href='#Asteriskon%28Open%29Solaris-BuildNotes'>Build Notes</a></li>
<ul>
    <li><a href='#Asteriskon%28Open%29Solaris-Prerequisites'>Prerequisites</a></li>
    <li><a href='#Asteriskon%28Open%29Solaris-LDAPdependencies'>LDAP dependencies</a></li>
    <li><a href='#Asteriskon%28Open%29Solaris-Makefilelayouts'>Makefile layouts</a></li>
    <li><a href='#Asteriskon%28Open%29Solaris-FAXsupportwithSpanDSP'>FAX support with SpanDSP</a></li>
</ul>
    <li><a href='#Asteriskon%28Open%29Solaris-Gotchas'>Gotchas</a></li>
<ul>
    <li><a href='#Asteriskon%28Open%29Solaris-Runtimeissues'>Runtime issues</a></li>
    <li><a href='#Asteriskon%28Open%29Solaris-Buildissues'>Build issues</a></li>
</ul>
</ul>
</ul></div>

<h3><a name="Asteriskon%28Open%29Solaris-Digium%27sSupportStatus"></a>Digium's Support Status</h3>

<p>According to the README file from 1.6.2: "Asterisk has also been 'ported' and reportedly runs properly on other<br/>
operating systems as well, including Sun Solaris, Apple's Mac OS X, Cygwin,<br/>
and the BSD variants."  Digium's developers have also been doing a good job of addressing build and run-time<br/>
issues encountered with Asterisk on Solaris.</p>

<h3><a name="Asteriskon%28Open%29Solaris-BuildNotes"></a>Build Notes</h3>

<h4><a name="Asteriskon%28Open%29Solaris-Prerequisites"></a>Prerequisites</h4>

<p>The following packages are recommend for building Asterisk 1.6 and later on OpenSolaris:</p>
<ul>
        <li>SUNWlibm (math library)</li>
        <li>gcc-dev (compiler and several dependencies)</li>
        <li>SUNWflexlex (GNU flex)</li>
        <li>SUNWggrp (GNU grep)</li>
        <li>SUNWgsed (GNU sed)</li>
        <li>SUNWdoxygen (optional; needed for "make progdocs")</li>
        <li>SUNWopenldap (optional; needed for res_config_ldap; see below)</li>
        <li>SUNWgnu-coreutils (optional; provides GNU install; see below)</li>
</ul>


<p>Caution: installing SUNW gnu packages will change the default application run when<br/>
the user types 'sed' and 'grep' from /usr/bin/sed to /usr/gnu/bin/sed.  Just be aware of this change,<br/>
as there are differences between the Sun and GNU versions of these utilities.</p>

<h4><a name="Asteriskon%28Open%29Solaris-LDAPdependencies"></a>LDAP dependencies</h4>

<p>Because OpenSolaris ships by default with Sun's LDAP libraries, you must install the<br/>
SUNWopenldap package to provide OpenLDAP libraries.  Because of namespace conflicts,<br/>
the standard LDAP detection will not work.</p>

<p>There are two possible solutions:</p>
<ol>
        <li>Port res_config_ldap to use only the RFC-specified API.  This should allow it to link<br/>
against Sun's LDAP libraries.  The problem is centered around the use of the OpenLDAP-specific<br/>
ldap_initialize() call.  </li>
        <li>Change the detection routines in configure to use OpenSolaris' layout of OpenLDAP.  This seems<br/>
doubtful simply because the filesystem layout of SUNWopenldap is so non-standard.</li>
</ol>


<p>Despite the above to possibilities, there is a workaround to make Asterisk compile with res_config_ldap.</p>

<ul>
        <li>Modify the "configure" script, changing all instances of "-lldap" to "-lldap-2.4".  At the time of this writing<br/>
there are only 4 instances.   This alone will make configure properly detect LDAP headers.  But it will not compile.  You must also...</li>
        <li>When running make, specify the use of the OpenLDAP headers like this:<br/>
"make LDAP_INCLUDE=-I/usr/include/openldap"</li>
</ul>


<h4><a name="Asteriskon%28Open%29Solaris-Makefilelayouts"></a>Makefile layouts</h4>

<p>This has been fixed in Asterisk 1.8 and is no longer an issue.</p>

<p>In Asterisk 1.6 the Makefile overrides any usage of --prefix.  I suspect the assumptions<br/>
are from back before configure provided the ability to set the installation prefix.  Regardless, if you are building on<br/>
OpenSolaris, be aware of this behavior of the Makefile!</p>

<p>If you want to alter the install locations you will need to hand-edit the Makefile.  Search for the string "SunOS"<br/>
to find the following section:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: java; gutter: false"><![CDATA[
# Define standard directories for various platforms
# These apply if they are not redefined in asterisk.conf
ifeq ($(OSARCH),SunOS)
  ASTETCDIR=/etc/asterisk
  ASTLIBDIR=/opt/asterisk/lib
  ASTVARLIBDIR=/var/opt/asterisk
  ASTDBDIR=$(ASTVARLIBDIR)
  ASTKEYDIR=$(ASTVARLIBDIR)
  ASTSPOOLDIR=/var/spool/asterisk
  ASTLOGDIR=/var/log/asterisk
  ASTHEADERDIR=/opt/asterisk/include/asterisk
  ASTBINDIR=/opt/asterisk/bin
  ASTSBINDIR=/opt/asterisk/sbin
  ASTVARRUNDIR=/var/run/asterisk
  ASTMANDIR=/opt/asterisk/man
else
]]></script>
</div></div>

<p>Note that, despite the comment, these definitions have build-time and run-time implications.  Make sure you<br/>
make these changes BEFORE you build!</p>

<h4><a name="Asteriskon%28Open%29Solaris-FAXsupportwithSpanDSP"></a>FAX support with SpanDSP</h4>
<p>I have been able to get this to work reliably.  If you are running Asterisk 1.6 note <a href="https://issues.asterisk.org/view.php?id=16342" class="external-link" rel="nofollow">Ticket 16342</a> if<br/>
you do not install SpanDSP to the default locations (/usr/include and /usr/lib).  T.38 FAX over SIP works<br/>
reliably as well.</p>

<p>There is one build issue with SpanDSP that I need to document (FIXME)</p>

<h3><a name="Asteriskon%28Open%29Solaris-Gotchas"></a>Gotchas</h3>

<h4><a name="Asteriskon%28Open%29Solaris-Runtimeissues"></a>Runtime issues</h4>
<ul>
        <li>WAV and WAV49 files are not written correctly (see <a href="https://issues.asterisk.org/view.php?id=16610" class="external-link" rel="nofollow">Ticket 16610</a>)</li>
        <li>32-bit binaries on Solaris are limited to 255 file descriptors by default.  (see <a href="http://developers.sun.com/solaris/articles/stdio_256.html" class="external-link" rel="nofollow">http://developers.sun.com/solaris/articles/stdio_256.html</a>)</li>
</ul>


<h4><a name="Asteriskon%28Open%29Solaris-Buildissues"></a>Build issues</h4>
<ul>
        <li>bootstrap.sh does not correctly detect OpenSolaris build tools (see <a href="https://issues.asterisk.org/view.php?id=16341" class="external-link" rel="nofollow">Ticket 16341</a>)</li>
        <li>Console documentation is not properly loaded at startup (see <a href="https://issues.asterisk.org/view.php?id=16688" class="external-link" rel="nofollow">Ticket 16688</a>)</li>
        <li>Solaris sed does not properly create AEL parser files (see <a href="https://issues.asterisk.org/view.php?id=16696" class="external-link" rel="nofollow">Ticket 16696</a>; workaround is to install GNU sed with SUNWgsed)</li>
        <li>Asterisk's provided install script, install-sh, is not properly referenced in the makeopts file that is generated during the build.  One workaround is to install GNU install from the SUNWgnu-coreutils package. (See <a href="https://issues.asterisk.org/view.php?id=16781" class="external-link" rel="nofollow">Ticket 16781</a>)</li>
</ul>


<p>Finally, Solaris memory allocation seems far more sensitive than Linux.  This has resulted in the discovery of several previously unknown bugs related to uninitialized variables that Linux handled silently.  Note that this means, until these bugs are found and fixed, you may get segfaults.</p>

<p>At the time of this writing I have had a server up and running reasonably stable.  However, there are large sections of Asterisk's codebase I do not use and likely contain more of these uninitialized variable problems and associated potential segfaults.</p>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+on+%28Open%29Solaris">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=12550288&revisedVersion=3&originalVersion=2">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+on+%28Open%29Solaris?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>