Asterisk

From The Neuros Technology Wiki

Jump to: navigation, search

Contents

[edit] Building Asterisk (Open Source PBX) for the Neuros OSD

Three Major Tasks:

  • Install the toolchain
  • Build the required libraries
  • Asterisk Compilation Instructions

Kind Notice:

If you find this page is broken, please inform suma, sumasuma in the #neuros irc channel. or you can email me to, gbpnkans at gmail dot com.

[edit] Toolchain Install

  • Download the Toolchain tarball from this location. [Tarballs]
I downloaded to the /opt directory, since mostly I personally keep the toolchains in this location.

[kans@localhost /opt]$ wget http://svn.neurostechnology.com/tarballs/neuros-osd.tar.bz2
[kans@localhost /opt]$ tar xvfj neuros-osd.tar.bz2
[kans@localhost /opt]$ mv neuros-osd OSD

Now the toolchain is setup.

[edit] Build the Required Libraries

 Asterisk is dependent of certain libraries to build a complete module. I kindly request the toolchain maintainer
 to add these standard libraries to the toolchain, which removes the burden of rebuilding by everyone. Once the
 libraries are included in the toolchain, you can remove this step.

The libraries which I compiled are,

  • curl
  • ncurses
  • termcap
  • zlib
  • ssl

Build the libraries with the prefix to the toolchain installed location.

./configure --build=i686-linux --host=arm-linux  --prefix=/opt/OSD/neuros-bsp/toolchain/arm-linux

[edit] Building Asterisk

[edit] Asterisk 1.2

1. Add the toolchain bin path to the PATH VARIABLE.

 export PATH=/opt/OSD/neuros-bsp/toolchain/bin:$PATH

2. Goto the asterisk source directory. 3. Edit the Makefile with the following values,

CROSS_COMPILE=/opt/OSD/neuros-bsp/toolchain/bin/arm-linux-
CROSS_COMPILE_BIN=/opt/OSD/neuros-bsp/toolchain/bin/
CROSS_COMPILE_TARGET=/opt/OSD/neuros-bsp/toolchain/arm-linux

CC=$(CROSS_COMPILE)gcc
HOST_CC=gcc
CROSS_ARCH=Linux
CROSS_PROC=arm
# Look for the line in the Makefile,
       AGI_DIR=$(ASTVARLIBDIR)/agi-bin
  endif

Add the below lines, after the above lines(in Makefile),

ASTLIBDIR=./kasterisk/lib
ASTVARLIBDIR=./kasterisk/lib
ASTETCDIR=./kasterisk/etc
ASTSPOOLDIR=./kasterisk/spool
ASTLOGDIR=./kasterisk/log
ASTHEADERDIR=./kasterisk/include/asterisk
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
ASTBINDIR=./kasterisk/usr/bin
ASTSBINDIR=./kasterisk/usr/sbin
ASTVARRUNDIR=./kasterisk/run
ASTMANDIR=./kasterisk/usr/share/man
MODULES_DIR=./kasterisk/rmodules
AGI_DIR=./kasterisk/agi-bin

4. In the asterisk source directory,

     make

5. Now go the Makefile of each subdirectories compiled,

Prepend the following line with .,
$(DESTDIR)$(MODULES_DIR)  need to get as  .$(DESTDIR)$(MODULES_DIR)

6. Now install asterisk

 make install
 make samples <-- will place the sample configuration files in the file directory

[edit] Asterisk 1.4

1. Download the asterisk source 1.4.

2. To the source directory

./configure --build=i686-linux --host=arm-linux  --without-pwlib --without-curl --prefix=/opt/OSD/neuros-bsp/toolchain/arm-linux

3.

# Look for the line in the Makefile,
ifeq ($(ASTDATADIR),)
  ASTDATADIR:=$(ASTVARLIBDIR)
endif

Add the below lines, after the above lines(in Makefile),

ASTETCDIR=./kasterisk/etc
ASTLIBDIR=./kasterisk/lib
ASTVARLIBDIR=./kasterisk/var
ASTSPOOLDIR=./kasterisk/spool
ASTLOGDIR=./kasterisk/log
ASTHEADERDIR=./kasterisk/include
ASTBINDIR=./kasterisk/bin
ASTSBINDIR=./kasterisk/sbin
ASTVARRUNDIR=./kasterisk/var/run
ASTMANDIR=./kasterisk/man
ASTDATADIR:=$(ASTVARLIBDIR)


4. Edit the makeopts file, (For somereason STRIP is not set by the configure,

  change the line of strip as follows,
      STRIP=arm-linux-strip

5. make menuselect

6. Select 'Module Embedding'

                                          [*] 1.  apps
                                          [*] 2.  cdr
                                          [*] 3.  channels
                                          [*] 4.  codecs
                                          [*] 5.  formats
                                          [*] 6.  funcs
                                          [*] 7.  pbx
                                          [*] 8.  res
   Select the applications using space bar.

7. In the mainmenu, select Compiler Flags,

     [*]13. STATIC_BUILD 
       
      Since we are going to do a static build.

8.

     make

9.

     Now go the Makefile of each subdirectories compiled,
Prepend the following line with .,
$(DESTDIR)$(MODULES_DIR)  need to get as  .$(DESTDIR)$(MODULES_DIR)


     make install

Will build asterisk-1.4 for the OSD.

Now the ./kasterisk will be in the asterisk root source directory.

copy the ./kasterisk to your OSD or to a USB thumb drive and execute it in the OSD.

To execute asterisk for both the above compilations,

./kasterisk/sbin/asterisk -vvvvvvvvvvvvvvvvvvgc

will run a console.

To learn more how to run asterisk you can checkout, http://www.asterisk.org

Personal tools