Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Asterisk 1.8 package

    Scheduled Pinned Locked Moved pfSense Packages
    281 Posts 59 Posters 252.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • marcellocM
      marcelloc
      last edited by

      Asterisk gui need some file changes to work and I did not had time to finish it.

      This current version can be configured only on console/files.

      Treinamentos de Elite: http://sys-squad.com

      Help a community developer! ;D

      1 Reply Last reply Reply Quote 0
      • M
        m4f1050
        last edited by

        I changed manager.conf and http.conf:

        manager.conf:

        enabled=yes
        webenabled=yes
        [admin]
        secret = password
        read = all
        write = all

        http.conf:

        enabled=yes
        enablestatic=yes

        And got it to load and login, but I get an alert:

        The GUI does not have necessary privileges.
        Please check the manager permissions for the user !

        Thanks for your time!!!

        1 Reply Last reply Reply Quote 0
        • marcellocM
          marcelloc
          last edited by

          these are few steps I did to get asterisk-gui working.
          I'm not sure if it is all remain steps.

          mkdir /var/lib
          mkdir /etc/dahdi/
          
          ln -s /usr/local/etc/asterisk /etc/asterisk
          ln -s /usr/local/share/asterisk /var/lib/asterisk
          
          /var/lib/asterisk/gui_backups
          /var/lib/asterisk/sounds/imageupdate
          
          chown -R asterisk /var/lib/asterisk
          chown -R asterisk /usr/local/etc/asterisk
          chown -R asterisk /etc/dahdi
          
          /var/lib/asterisk/static_html/config
          /var/lib/asterisk/scripts
          
          /usr/local/etc/rc.d/asterisk/restart
           asterisk -rx "core set debug 10"
          asterisk -rx "core set verbose 10"
          

          Treinamentos de Elite: http://sys-squad.com

          Help a community developer! ;D

          1 Reply Last reply Reply Quote 0
          • M
            m4f1050
            last edited by

            Cool, will try that.  That's how you got it to load up, but you weren't able to get it to write/update the .conf files, correct?

            EDIT:

            Ok, got it to show up, had to edit index.js to include asterisk/1.8 but it won't save any settings  :-/

            asterisk-gui.jpg
            asterisk-gui.jpg_thumb

            1 Reply Last reply Reply Quote 0
            • T
              tempest69
              last edited by

              Hello,
              what a great package!
              But…
              I'm on nanobsd platform and something seems incorrect :
              the file /usr/local/etc/asterisk/asterisk.conf contain the line "astdbdir => /tmp" ==> this is ok
              But on the gui when i go to status=>asterisk, i see this :

              * Directories
                -------------
                Configuration file:          
                Configuration directory:     /usr/local/etc/asterisk
                Module directory:            /usr/local/lib/asterisk/modules
                Spool directory:             /var/spool/asterisk
                Log directory:               /var/log/asterisk
                Run/Sockets directory:       /var/run/asterisk
                PID file:                    /var/run/asterisk/asterisk.pid
                VarLib directory:            /usr/local/share/asterisk
                Data directory:              /usr/local/share/asterisk
                ASTDB:                       /var/db/asterisk/astdb
                IAX2 Keys directory:         /usr/local/share/asterisk/keys
                AGI Scripts directory:       /usr/local/share/asterisk/agi-bin
              

              astdb is /var/db/asterisk/astdb ==> it's bad!
              It seems that the file /usr/local/etc/asterisk/asterisk.conf is not the one used when asterisk is started.
              And when i look at /usr/local/etc/rc.d/asterisk , i don't see anything that say to use this .conf file (like a -C switch ==> -C /usr/local/etc/asterisk/asterisk.conf in a command_args variable for example)
              Do i have missed something?
              Because i have a lot of "Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory" in my log…

              It would also be nice to have the "module show" command or even better the possibility to type commands (like with the  fivn asterisk management  "command" menu)
              Thank you

              1 Reply Last reply Reply Quote 0
              • marcellocM
                marcelloc
                last edited by

                try to start asterisk on foreground to check what is not loading or missing.

                Treinamentos de Elite: http://sys-squad.com

                Help a community developer! ;D

                1 Reply Last reply Reply Quote 0
                • T
                  tempest69
                  last edited by

                  thanks,

                  stop an restart the service solve the problem (without change to config files)…
                  I will try to see why it was wrong and if the problem reappears...

                  1 Reply Last reply Reply Quote 0
                  • M
                    m4f1050
                    last edited by

                    When I restarted my pfSense the gui was no longer available and I am also getting the db warning…

                    I guess I had created the /var/db/asterisk folders when fiddling with it..  I tried restarting asterisk from pfSense and I still get them.  I even modified the asterisk.conf file (which was pointing to /tmp also) but nothing... :O

                    
                    [Jul 7 10:16:14] WARNING[24915] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • T
                      tempest69
                      last edited by

                      well now i'm getting this message after every call i make (the call work but the history of calls is not updated/empty) :
                      [Jul 7 18:18:57] ERROR[36008] cdr_csv.c: Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : No such file or directory

                      Strange (double // in the path of the file) … something seems corrupted (EDIT: after a search double // seems correct...).
                      Where can i get the list of file created by this package (on startup and/or package installation?)

                      EDIT :could it be that the "Log directory:              /var/log/asterisk" is incorrect for a nanobsd installation ?
                      After creating by hand "/var/log/asterisk/cdr-csv" directory, the message has gone, do these directories get created on asterisk startup or only once on package installation ?

                      i think it's time to re-read all the topics related to asterisk in pfsense in the forum...

                      1 Reply Last reply Reply Quote 0
                      • marcellocM
                        marcelloc
                        last edited by

                        @m4f1050:

                        When I restarted my pfSense the gui was no longer available and I am also getting the db warning…
                        Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : No such file or directory

                        check on asterisk.inc if it's checking/creating the /var/db folder

                        @tempest69:

                        EDIT :could it be that the "Log directory:               /var/log/asterisk" is incorrect for a nanobsd installation ?

                        IIRC, /var is flushed every reboot, so it need to be recreated during package sync/startup

                        Treinamentos de Elite: http://sys-squad.com

                        Help a community developer! ;D

                        1 Reply Last reply Reply Quote 0
                        • T
                          tempest69
                          last edited by

                          @marcelloc:

                          IIRC, /var is flushed every reboot, so it need to me recreated during package sync/startup

                          So, if i understand good, i just need to edit asterisk.inc and add some code to create the directories (like "mkdir -p /var/log/asterisk/cdr-csv" in the sync_package_asterisk() function) ?
                          thank you

                          1 Reply Last reply Reply Quote 0
                          • rcfaR
                            rcfa
                            last edited by

                            @marcelloc:

                            IIRC, /var is flushed every reboot, so it need to me recreated during package sync/startup

                            Is that supposed to be a good thing?

                            1 Reply Last reply Reply Quote 0
                            • marcellocM
                              marcelloc
                              last edited by

                              there is a type on that post,

                              So it needs to be recreated during package sync/startup/boot as it's a memory file system on nanobsd.

                              Treinamentos de Elite: http://sys-squad.com

                              Help a community developer! ;D

                              1 Reply Last reply Reply Quote 0
                              • rcfaR
                                rcfa
                                last edited by

                                @marcelloc:

                                there is a type on that post,

                                So it needs to be recreated during package sync/startup/boot as it's a memory file system on nanobsd.

                                OK, I wasn't aware this was about nanobsd… Missed that part somehow.

                                1 Reply Last reply Reply Quote 0
                                • M
                                  m4f1050
                                  last edited by

                                  @marcelloc:

                                  @m4f1050:

                                  When I restarted my pfSense the gui was no longer available and I am also getting the db warning…
                                  Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : No such file or directory

                                  check on asterisk.inc if it's checking/creating the /var/db folder

                                  Nope, it's not creating that on the .inc the .inc file says to replace whatever it's there with /tmp (which I changed it to /usr/local/db/asterisk but it's not taking it..

                                  Here is what it says when I go to Status / Asterisk

                                  
                                  PBX Core settings
                                  -----------------
                                    Version:                     1.8.8.1
                                    Build Options:               LOADABLE_MODULES
                                    Maximum calls:               Not set
                                    Maximum open file handles:   Not set
                                    Verbosity:                   0
                                    Debug level:                 0
                                    Maximum load average:        0.000000
                                    Startup time:                00:44:21
                                    Last reload time:            00:44:30
                                    System:                      FreeBSD/8.1-RELEASE-p5 built by root on i386 2012-01-15 05:07:25 UTC
                                    System name:                 
                                    Entity ID:                   xx:xx:xx:xx:xx:xx
                                    Default language:            en
                                    Language prefix:             Enabled
                                    User name and group:         /
                                    Executable includes:         Disabled
                                    Transcode via SLIN:          Enabled
                                    Internal timing:             Disabled
                                    Transmit silence during rec: Disabled
                                    Generic PLC:                 Enabled
                                  
                                  * Subsystems
                                    -------------
                                    Manager (AMI):               Enabled
                                    Web Manager (AMI/HTTP):      Enabled
                                    Call data records:           Enabled
                                    Realtime Architecture (ARA): Disabled
                                  
                                  * Directories
                                    -------------
                                    Configuration file:          
                                    Configuration directory:     /usr/local/etc/asterisk
                                    Module directory:            /usr/local/lib/asterisk/modules
                                    Spool directory:             /var/spool/asterisk
                                    Log directory:               /var/log/asterisk
                                    Run/Sockets directory:       /var/run/asterisk
                                    PID file:                    /var/run/asterisk/asterisk.pid
                                    VarLib directory:            /usr/local/share/asterisk
                                    Data directory:              /usr/local/share/asterisk
                                    ASTDB:                       /var/db/asterisk/astdb
                                    IAX2 Keys directory:         /usr/local/share/asterisk/keys
                                    AGI Scripts directory:       /usr/local/share/asterisk/agi-bin
                                  
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    tempest69
                                    last edited by

                                    (asterisk package with nanobsd installation)
                                    the problem :

                                    Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : No such file or directory
                                    

                                    has been solved with the shellcmd package, i have created 3 shellcmd :

                                    mkdir /var/log/asterisk && chmod 0766 /var/log/asterisk 	shellcmd 	
                                    mkdir /var/log/asterisk/cdr-csv && chmod 0766 /var/log/asterisk/cdr-csv 	shellcmd 	
                                    chown -R asterisk:wheel /var/log/asterisk 	shellcmd 
                                    
                                    

                                    It is hardcoded but the message has gone… and now i can see the call history until a reboot.
                                    But now i would like to make things persistent :
                                    1/ to copy a saved Master.csv (and eventualy astdb) on startup to /var/log/asterisk/cdr-csv/Master.csv
                                    using shellcmd seems the best solution (but it would be more accurate to do this on service startup?)
                                    2/ to save Master.csv (an eventually astdb) from memory to my sdcard periodicaly (every day?)
                                    using cron package seems the best solution
                                    3/ to save Master.csv (an eventually astdb) from memory to my sdcard on shutdown or asterisk service stop
                                    NO idea on how to do it...

                                    is it a good solution or am i completly wrong?

                                    I'm very happy with pfsense/asterisk and I'm planing to migrate my (little) asterisk server (dockstar + debian lenny+asterisk 1.6) to my pfsense box !

                                    @m4f1050 : you should try to edit asterisk.conf and modify by hand the directories to /tmp (on nanobsd of course)

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      m4f1050
                                      last edited by

                                      @tempest69:

                                      @m4f1050 : you should try to edit asterisk.conf and modify by hand the directories to /tmp (on nanobsd of course)

                                      Just tried…  updated asterisk.conf back to /tmp, restarted service = no go, reloaded sip and other option = no go, restarted service again = no go...  Im baffled..

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        tempest69
                                        last edited by

                                        You can try to start asterisk from the shell prompt (/usr/local/sbin/asterisk) and then see what happens…
                                        look at the contents of asterisk.conf before and after starting asterisk : it should not change, because the changes in asterisk.conf are made only one time or when reinstalling-refreshing-resyncing ?- the package(someone correct me if i'm wrong).
                                        If it work then it could be a problem with file permission (because when you start it from shell it start as root).
                                        After that if you try to start/stop from the gui then you will have permissions problems (from gui it starts as asterisk) so you should reboot (or make some chown/chmod to files/directories created in /tmp and /var/log).

                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          m4f1050
                                          last edited by

                                          I stopped asterisk from GUI.  Edited the asterisk.conf file and put /tmp for the astdb file, ssh'd and started asterisk, checked back the file and it was still /tmp.

                                          On status/asterisk from GUI it still shows:  /var/db/asterisk/astdb

                                          1 Reply Last reply Reply Quote 0
                                          • T
                                            tempest69
                                            last edited by

                                            What is the content of your asterisk.conf (/usr/local/etc/asterisk/asterisk.conf)?
                                            Do you have this at the beginning?

                                            [directories]
                                            astetcdir => /usr/local/etc/asterisk
                                            astmoddir => /usr/local/lib/asterisk/modules
                                            astvarlibdir => /usr/local/share/asterisk
                                            astdbdir => /tmp
                                            astkeydir => /usr/local/share/asterisk
                                            astdatadir => /usr/local/share/asterisk
                                            astagidir => /usr/local/share/asterisk/agi-bin
                                            astspooldir => /tmp
                                            astrundir => /var/run/asterisk
                                            astlogdir => /var/log/asterisk
                                            

                                            I remember that when i edit this file i see that the first line  was
                                            directories  and not [directories]
                                            so i changed it…

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.