Asterisk no Iomega Storcenter IX2-200


Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
First and foremost, I take no credit for any of this post’s content. I am really just taking what others have done (which I have links to bellow) and am putting it on my blog for a personal reference and hopefully the small changes that I made to their guides will help someone somewhere.


Link: http://www.nslu2-linux.org/wiki/Optware/Asterisk
Slim Example modules.conf: http://www.voip-info.org/wiki/index.php?page_id=1531
More Asterisk config:  http://blog.wains.be/category/nslu2/ 
Guia para Configurações do Asterisk:  http://astbook.asteriskdocs.org/ 
Esse sim vale a pena ler: http://ozlabs.org/~cyeoh/asterisk/

Primeiramente acesse o equipamento com uma sessão SSH.

Ative esta opção no site do seu equipamento na página abaixo:

Utilizando o putty ou terminal do linux: 
ssh root@192.168.1.13

Usuário: root
Senha: soho + a senha do admin

Instale os aplicativos optware com o comando ipkg, configurando do seguinte forma ((já vem pré instalado):
cat <<EOF > /etc/ipkg.conf 
src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable 
src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable 
EOF

Atualize com o comando:
ipkg update

Liste as opções com o comando:
ipkg list

Ou acesse os sites:

E instale o que quiser com o comando abaixo:
ipkg install <nome do app>


O pacote optware a ser instalado é o pacote abaixo:
Package: asterisk Version: 1.2.24-1 Depends: openssl,ncurses,libcurl Conflicts: asterisk14 Section: util Architecture: arm Maintainer: Corneliu Doban <corneliu_doban@yahoo.com> MD5Sum: 9c5b93177cd0613169e40050403480a6 Size: 9743405 Filename: asterisk_1.2.24-1_arm.ipk Source: http://ftp.digium.com/pub/asterisk/releases//asterisk-1.2.24.tar.gz Description: Open Source VoIP PBX System
E o pacote:
Package: asterisk-sounds Version: 1.2.1-1 Section: misc Architecture: arm Maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com> MD5Sum: 5aa7f752a7f2f7129a7def70932a55ba Size: 3223476 Filename: asterisk-sounds_1.2.1-1_arm.ipk Source: http://downloads.digium.com/pub/asterisk/old-releases/asterisk-sounds-1.2.1.tar.gz Description: Supplementary asterisk-sounds.

Vamos tentar configurar o asterisk
ipkg install asterisk
ipkg -force-overwrite install asterisk-sounds


Resultado:
Installing asterisk (1.2.24-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/asterisk_1.2.24-1_arm.ipk
Installing libcurl (7.21.7-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libcurl_7.21.7-1_arm.ipk
Installing zlib (1.2.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/zlib_1.2.5-1_arm.ipk
Configuring asterisk
Configuring libcurl
Configuring zlib
Successfully terminated.

TODO:

If you have just installed and configured Asterisk, you can try running it for the first time in console mode with some debugging applied with this command:

   /opt/sbin/asterisk -vvvc 

Use the command "stop now" to shut down Asterisk from the CLI console.

If run with no arguments, Asterisk is launched as a daemon process:

   /opt/sbin/asterisk 

You can get a CLI console to an already-running daemon by typing:

   /opt/sbin/asterisk -r 

on the same computer on which Asterisk is running. More than one console CLI can connect to Asterisk simultaneously.

You can list all the available CLI commands by entering "help", or get information on a particular command by entering "help <command>".

To start asterisk at boot time, create a script whose name starts with S[number][number] in /opt/etc/init.d/ that executes asterisk:

   /opt/etc/init.d # cat S99asterisk
   #!/bin/sh

   if [ -f /opt/var/run/asterisk.pid ] ; then
     kill `cat /opt/var/run/asterisk.pid`
   else
     killall asterisk
   fi

   rm -f /opt/var/run/asterisk.pid

   umask 077

   /opt/sbin/asterisk


Lista de comando CLI:
help
                        !  Execute a shell command
               abort halt  Cancel a running halt
            add extension  Add new extension into context
            add ignorepat  Add new ignore pattern
               cdr status  Display the CDR status
             database del  Removes database key/value
         database deltree  Removes database keytree/values
             database get  Gets database value
             database put  Adds/updates database value
            database show  Shows database contents
         database showkey  Shows database contents
            debug channel  Enable debugging on a channel
              debug level  Set global debug level
            dnsmgr reload  Reloads the DNS manager configuration
            dnsmgr status  Display the DNS manager status
             dont include  Remove a specified include from context
        extensions reload  Reload extensions and *only* extensions
                     help  Display help list, or specific help on a command
               iax2 debug  Enable IAX debugging
            iax2 jb debug  Enable IAX jitterbuffer debugging
            iax2 no debug  Disable IAX debugging
         iax2 no jb debug  Disable IAX jitterbuffer debugging
      iax2 no trunk debug  Disable IAX trunk debugging
           iax2 provision  Provision an IAX device
      iax2 prune realtime  Prune a cached realtime lookup
              iax2 reload  Reload IAX configuration
          iax2 set jitter  Sets IAX jitter buffer
          iax2 show cache  Display IAX cached dialplan
       iax2 show channels  Show active IAX channels
       iax2 show firmware  Show available IAX firmwares
       iax2 show netstats  Show active IAX channel netstats
           iax2 show peer  Show details on specific IAX peer
          iax2 show peers  Show defined IAX peers
   iax2 show provisioning  Show iax provisioning
       iax2 show registry  Show IAX registration status
          iax2 show stats  Display IAX statistics
          iax2 show users  Show defined IAX users
        iax2 test losspct  Set IAX2 incoming frame loss percentage
         iax2 trunk debug  Enable IAX trunk debugging
          include context  Include context in other context
                init keys  Initialize RSA key passcodes
                     load  Load a dynamic module by name
      local show channels  Show status of local channels
            logger reload  Reopens the log files
            logger rotate  Rotates and reopens the log files
     logger show channels  List configured log channels
         moh classes show  List MOH classes
           moh files show  List MOH file-based classes
               moh reload  Music On Hold
         no debug channel  Disable debugging on a channel
                   reload  Reload configuration
         remove extension  Remove a specified extension
         remove ignorepat  Remove ignore pattern from context
       restart gracefully  Restart Asterisk gracefully
              restart now  Restart Asterisk immediately
  restart when convenient  Restart Asterisk at empty call volume
                rtp debug  Enable RTP debugging
             rtp debug ip  Enable RTP debugging on IP
             rtp no debug  Disable RTP debugging
                set debug  Set level of debug chattiness
              set verbose  Set level of verboseness
        show applications  Shows registered dialplan applications
         show application  Describe a specific dialplan application
        show audio codecs  Shows audio codecs
             show channel  Display information on a specific channel
            show channels  Display information on channels
        show channeltypes  Show available channel types
              show codecs  Shows codecs
               show codec  Shows a specific codec
     show config mappings  Show Config mappings (file names to config engines)
            show dialplan  Show dialplan
            show features  Lists configured features
        show file formats  Displays file formats
           show functions  Shows registered dialplan functions
            show function  Describe a specific dialplan function
               show hints  Show dialplan hints
        show image codecs  Shows image codecs
       show image formats  Displays image formats
                show keys  Displays RSA key information
             show license  Show the license(s) for this copy of Asterisk
     show manager command  Show a manager interface command
    show manager commands  List manager interface commands
   show manager connected  Show connected manager interface users
             show modules  List modules and info
        show modules like  List modules and info
         show parkedcalls  Lists parked calls
            show switches  Show alternative switches
         show translation  Display translation matrix
              show uptime  Show uptime information
             show version  Display version info
       show version files  Show versions of files used to build Asterisk
        show video codecs  Shows video codecs
     show voicemail users  List defined voicemail boxes
     show voicemail zones  List zone message formats
            show warranty  Show the warranty (if any) for this copy of Asterisk
                sip debug  Enable SIP debugging
             sip debug ip  Enable SIP debugging on IP
           sip debug peer  Enable SIP debugging on Peername
              sip history  Enable SIP history
             sip no debug  Disable SIP debugging
           sip no history  Disable SIP history
               sip notify  Send a notify packet to a SIP peer
       sip prune realtime  Prune cached Realtime object(s)
  sip prune realtime peer  Prune cached Realtime peer(s)
  sip prune realtime user  Prune cached Realtime user(s)
               sip reload  Reload SIP configuration
        sip show channels  Show active SIP channels
         sip show channel  Show detailed SIP channel info
         sip show domains  List our local SIP domains.
         sip show history  Show SIP dialog history
           sip show inuse  List all inuse/limits
         sip show objects  Show all SIP object allocations
            sip show peer  Show details on specific SIP peer
           sip show peers  Show defined SIP peers
        sip show registry  Show SIP registration status
        sip show settings  Show SIP global settings
   sip show subscriptions  Show active SIP subscriptions
           sip show users  Show defined SIP users
            sip show user  Show details on specific SIP user
              soft hangup  Request a hangup on a given channel
          stop gracefully  Gracefully shut down Asterisk
                 stop now  Shut down Asterisk immediately
     stop when convenient  Shut down Asterisk at empty call volume
                   unload  Unload a dynamic module by name

Arquivos de configuração alterados:
/opt/etc/asterisk/modules.conf
/opt/etc/asterisk/rtp.conf
/opt/etc/asterisk/sip.conf
/opt/etc/asterisk/extensions.conf
/opt/etc/asterisk/iax.conf
/opt/etc/asterisk/indications.conf

PS: Seu firewall deve permitir a porta UDP 5060-5061 e sequencia UDP 10000-10020 (de acordo com /opt/etc/asterisk/rtp.conf) para o seu Iomega se quiser permitir chamadas externas via sip.



Para tornar o optware um serviço que se inicia automaticamente quando o NAS for reiniciado, precisa alterar a imagem original da seguinte forma:

mknod -m0660 /dev/loop3 b 7 3
chown root.disk /dev/loop3 
mkdir /tmp/apps 
mount -o loop /boot/images/apps /tmp/apps
cp /tmp/apps/usr/local/cfg/sohoProcs.xml /tmp/apps/usr/local/cfg/sohoProcs.xml.original
nano /tmp/apps/usr/local/cfg/sohoProcs.xml 

Inclua um novo <Program> dentro de <Group Level=”1″>:
<Program Name="init-opt.sh" Path="/opt/etc/init-opt.sh"> 
       <SysOption Restart="-1"/> 
</Program>
 
umount /tmp/apps 
rm /dev/loop3

Crie o script abaixo:

tee /opt/etc/init-opt.sh <<EOF
#!/bin/sh
rm /opt/var/log/boot
if [ -d /opt/etc/init.d ]; then
for f in /opt/etc/init.d/S* ; do
#[ -x $f ] && $f start
$f start | tee -a /opt/var/log/boot
done
fi
EOF
chmod +x /opt/etc/init-opt.sh
mkdir /opt/var/log



O URL específico do gadget não foi encontrado



ċ
asterisk_1_2_sample_slug_config.tar.gz
(36k)
Ademar Arvati Filho,
26 de nov de 2011 22:09
Comments