Asterisk 1.8 package



  • @xbaha:

    can you update these files in pfsense packages (web-gui packages)

    Try that using pkg_add on console fist. I 'll try to publish new version including asterisk-gui too.



  • @marcelloc:

    @xbaha:

    can you update these files in pfsense packages (web-gui packages)

    Try that using pkg_add on console fist. I 'll try to publish new version including asterisk-gui too.

    sorry, pkg_add gave lots of errors, i dlded all dependencies packages, is there an argument i should add with pkg_add ?




  • hi,marcelloc:
    Maybye you missed the libpri-1.4.12.tbz and unixODBC-2.3.1.tbz file
    see the following:

    [2.0.1-RELEASE][root@pfSense.localdomain]/root(81): pkg_add asterisk18-1.8.12.0.tbz 
    pkg_add: could not find package libpri-1.4.12 !
    [2.0.1-RELEASE][root@pfSense.localdomain]/root(85): pkg_add -f asterisk18-1.8.12.0.tbz  
    pkg_add: could not find package libpri-1.4.12  (proceeding anyway)
    ===> Creating users and/or groups.
    Creating group 'asterisk' with gid '931'.
    Creating group 'dahdi' with gid '843'.
    Creating user 'asterisk' with uid '931'.
    Adding user 'asterisk' to group 'dahdi'.
    pkg_add: can't open dependency file '/var/db/pkg/libpri-1.4.12/+REQUIRED_BY'!
    dependency registration is incomplete
    pkg_add: warning: package 'asterisk18-1.8.12.0' requires 'unixODBC-2.3.1', but 'unixODBC-2.3.0_1' is installed
    


  • learnin9,

    I've pushed the missing libpri to my repo, try to reinstall.

    this message:
    pkg_add: warning: package 'asterisk18-1.8.12.0' requires 'unixODBC-2.3.1', but 'unixODBC-2.3.0_1' is installed
    says that you have unixODBC-2.3.0_1 version installed, you need to uninstall this versioin to use unixODBC-2.3.1.

    att,
    Marcello Coutinho



  • marcelloc:
      I did not find the unixODBC-2.3.1.tbz file,so i have to install the unixODBC-2.3.0_1.tbz file
      Lots for thanks for your hard work.I will reinstall the asterisk packages.



  • libpri might be the last thing needed on an embedded system. The feature will probably be rarely used if at all.



  • Marcelloc, Thanks for the hard work at creating the Asterisk package for us. Having a go at adding the Asterisk package via the 'Package' option through the GUI on a fresh x86 PF2.01 install. It seemed to install fine with no errors but under 'services' it shows Asterisk to be stopped and despite many attempts it won't start via the PF Web interface. Hardware and software SIP clients unable to connnect seem to support the fact it's not running. Is this symptom common? Is there a way to try starting Asterisk from a shell connection or a process to reveal a bit more detail on why it's not starting? I haven't rebooted the box since installing the Asterisk…do I need to or should I restart the web configurator? This is my first foray into Asterisk since my failed attempt at trying to rig up Freeswitch/FusionPBX with PF2.01 and the service won't start symptom may just be my own ignorance on how Asterisk operates.
    Thanks



  • try to start asterisk on console, maybe you need to unselect some modules.



  • What would be the command to start the Asterisk daemon from a shell…wasn't quite certain and "/etc/init.d/asterisk start" returned a command not found.



  • /usr/local/etc/rc.d/asterisk



  • Commenting out some of the modules did it, the daemon started and looks like it's running via the GUI now. Wonder if it was because the default extensions.conf and sip.conf contained references to demo interfaces that I didn't have? There's no telephony cards on the board…yet. SIP phones still aren't showing up but I can have a go at those now that I know the daemon is running. Thanks again Marcelloc.



  • I downgraded to 2.0.1 just to install this!  :)

    Is there any tutorial on how to initially set it up?  (I am coming from Windows and Axon PBX)

    ..or asterisk-gui?  Trying that out first.

    EDIT:

    I fetched http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/i386/packages-8.1-release/All/asterisk-gui-2.0.4_4.tbz

    Tried to add it but I get:

    pkg_add: could not find package openldap-client-2.4.23 !
    pkg_add: could not find package perl-5.10.1_1 !
    pkg_add: could not find package libltdl-2.2.6b !
    pkg_add: could not find package wget-1.12_1 !
    pkg_add: could not find package libgcrypt-1.4.5_1 !
    pkg_add: could not find package postgresql-client-8.2.17_1 !

    EDIT 2:

    fetched the missing packages then pkg_add asterisk-gui-2.0.4_4.tbz it said it installed in /usr/local and gave me a url to go to but not working.



  • 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.



  • 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!!!



  • 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"
    


  • 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  :-/




  • 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



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



  • 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...



  • 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
    
    


  • 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...



  • @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



  • @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



  • @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?



  • 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.



  • @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.



  • @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
    
    


  • (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)



  • @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..



  • 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).



  • 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



  • 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…



  • @tempest69:

    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…

    Yup, it has the (!)

    
    [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
    
    

    Removing the (!) now to see if it works…

    (tick...tock...tick...tock...)

    Hmmm!  That seems to have done something...it's now /tmp/astdb
    Maybe add to the installer the removal of (!)
    Wonder if I can set it to /usr/local/db/asterisk now....

    EDIT:

    I left it at /tmp ...   here is my log: (cleared it before starting asterisk)

    
    [Jul 22 11:08:19] NOTICE[62646] cdr.c: CDR simple logging enabled.
    [Jul 22 11:08:19] NOTICE[62646] loader.c: 207 modules will be loaded.
    [Jul 22 11:08:19] NOTICE[62646] res_odbc.c: res_odbc loaded.
    [Jul 22 11:08:19] NOTICE[62646] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
    [Jul 22 11:08:20] NOTICE[62646] config.c: Registered Config Engine curl
    [Jul 22 11:08:20] NOTICE[62646] res_config_ldap.c: No directory user found, anonymous binding as default.
    [Jul 22 11:08:20] ERROR[62646] res_config_ldap.c: No directory URL or host found.
    [Jul 22 11:08:20] ERROR[62646] res_config_ldap.c: Cannot load LDAP RealTime driver.
    [Jul 22 11:08:20] ERROR[62646] res_config_sqlite.c: unable to open database: /var/lib/asterisk/sqlite.db
    
    

    I know I forced a pkg… openldap-client-2.4.23.tbz  So that could be causing my "ldap" errors.  Going reinstall pfsense 2.0.1 and then install the asterisk pkg to get rid of that error...

    After about a minute it started showing in Status / Asterisk and added this to the log:

    
    [Jul 22 11:09:35] ERROR[62646] res_config_pgsql.c: PostgreSQL RealTime: Failed to connect database asterisk on 127.0.0.1:
    [Jul 22 11:09:35] WARNING[62646] res_config_pgsql.c: PostgreSQL RealTime: Couldn't establish connection. Check debug.
    [Jul 22 11:09:35] NOTICE[62646] config.c: Registered Config Engine pgsql
    [Jul 22 11:09:35] NOTICE[62646] config.c: Registered Config Engine odbc
    [Jul 22 11:09:35] NOTICE[62646] chan_skinny.c: Configuring skinny from skinny.conf
    [Jul 22 11:09:35] NOTICE[62646] cdr_radius.c: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf.
    [Jul 22 11:09:35] NOTICE[62646] cdr_sqlite.c: This module has been marked deprecated in favor of using cdr_sqlite3_custom.
    [Jul 22 11:09:35] WARNING[62646] cel_pgsql.c: CEL pgsql config file missing global section.
    [Jul 22 11:09:35] NOTICE[62646] cel_radius.c: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf.
    [Jul 22 11:09:35] NOTICE[62646] cel_tds.c: cel_tds has no global category, nothing to configure.
    [Jul 22 11:09:35] WARNING[62646] cel_tds.c: cel_tds module had config problems; declining load
    [Jul 22 11:09:36] WARNING[62646] chan_unistim.c: Your OS does not support IP_PKTINFO, you must set public_ip.
    [Jul 22 11:09:36] ERROR[62646] res_clialiases.c: res_clialiases configuration file 'cli_aliases.conf' not found
    [Jul 22 11:09:36] NOTICE[62646] pbx_ael.c: Starting AEL load process.
    [Jul 22 11:09:36] NOTICE[62646] pbx_ael.c: AEL load process: parsed config file name '/usr/local/etc/asterisk/extensions.ael'.
    [Jul 22 11:09:36] NOTICE[62646] pbx_ael.c: AEL load process: checked config file name '/usr/local/etc/asterisk/extensions.ael'.
    [Jul 22 11:09:36] NOTICE[62646] pbx_ael.c: AEL load process: compiled config file name '/usr/local/etc/asterisk/extensions.ael'.
    [Jul 22 11:09:36] NOTICE[62646] pbx_ael.c: AEL load process: merged config file name '/usr/local/etc/asterisk/extensions.ael'.
    [Jul 22 11:09:36] NOTICE[62646] pbx_ael.c: AEL load process: verified config file name '/usr/local/etc/asterisk/extensions.ael'.
    
    


  • @m4f1050
    I have also some messages about ldap and other .conf files missing, i think it's due to a lot of modules being loaded (autoload module as default?)… It can be solved by not loading the modules that we don't use in our configuration (not a bug, it's normal that the standard installation use autoload of modules)
    I'm not in production with asterisk but i will in a short time and i'm going to tweak my installation and the .conf files to not load the modules that i do not use.
    if you have this message just after a call :
    Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : No such file or directory
    go to see :
    http://forum.pfsense.org/index.php/topic,47210.msg274214.html#msg274214

    @marcelloc
    is it normal that the /usr/local/etc/asterisk/asterisk.conf files comes with "directories" at the beginning ?
    Generaly the (!) is used for template purpose in sip.conf but it seems to be problematic when used in asterisk.conf…



  • @tempest69:

    @m4f1050
    I have also some messages about ldap and other .conf files missing, i think it's due to a lot of modules being loaded (autoload module as default?)… It can be solved by not loading the modules that we don't use in our configuration (not a bug, it's normal that the standard installation use autoload of modules)
    I'm not in production with asterisk but i will in a short time and i'm going to tweak my installation and the .conf files to not load the modules that i do not use.
    if you have this message just after a call :
    Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : No such file or directory
    go to see :
    http://forum.pfsense.org/index.php/topic,47210.msg274214.html#msg274214

    Yeah, I noticed it kept showing the errors.  Please let me know when you configure your asterisk, I would love to see the config files (removing any personal information of course.)

    @tempest69:

    @marcelloc
    is it normal that the /usr/local/etc/asterisk/asterisk.conf files comes with "directories" at the beginning ?
    Generaly the (!) is used for template purpose in sip.conf but it seems to be problematic when used in asterisk.conf…

    Wonder if we can run a script that replaces values (and stores a temp config file on i.e. /tmp) then have asterisk read from this /tmp/.conf file?  We can then use other symbols, i.e. replace the (!) with [!] and have the script translate it to (!) or compile asterisk to look for something else?  (Is it asterisk the one doing the conf file reading?)



  • Hello,

    Just installed Asterisk packages on pfSense 2.0.1. I can't find the GUI for it. Is there a GUI for it? It would be great if the description for each package tells you which menu the newly installed package goes under. If there is no GUI, the community available tool is the status_asterisk.php file?

    Thanks,



  • It's on status menu.

    If you can't see it, maybe you need to reinstall the package.



  • I see it upon re-install.

    Thanks



  • @tempest69:

    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)

    Replying to my self.
    To execute all sort of asterisk CLI command, we just have to type it in the browser as a link :
    https://MyPfsense_Url/asterisk_cmd.php ==> will execute the default command "core show sttings"
    and
    https://MyPfsense_Url/asterisk_cmd.php?cmd=module+show ==> Will execute "module show"
    and
    https://MyPfsense_Url/asterisk_cmd.php?cmd=core+show+help ==> Will execute "core show help" giving the list off available CLI commands…
    (not all commands cause it seems to display a limited numbers of characters...)




Log in to reply