Improvements

I’ve been testing the system for 2 weeks now at home, everything I tried worked very well. Only the CDR reports needed some fixing, they were not working yet in the image posted previously. To apply this to your setup run in a root shell:

apt-get install libmysqlclient-dev
cd /usr/src/asterisk-1.8.13.0-rc2/
make menuconfig

In section “Add-ons” select “res config mysql”, “app mysql” and “cdr mysql”. On top of this, select additional sounds in “Core Sound Packages”, “Music On Hold File Packages” and “Extras Sound Packages”. In all 3 sections I’ve selected wav, ulaw, alaw, gsm, and g729 just to be sure. This enables most of the voice messages Asterisk is playing in some occasions.

Then run:

make
make install
amportal restart

11 thoughts on “Improvements

  1. Seeing as there are some smart people around..
    Can anyone say if they can get TLS (secure SIP) working on this?
    If so – in baby steps how did you get it working?

  2. Hi,

    wouldn’t it be better to use freepbx with sqlite and to switch from apache to lighttpd or even nginx?

    BR
    Starvirus

  3. I’ve installed the image but am running into a very strange issue. It’s probably a PEBKAC. I setup FreePBX using the “First Steps” guide by the creators but my two SIP clients keep mysteriously going offline within a few minutes of registering. Any ideas why that would be happening?

    • Nevermind. Got it figured out. Changed the qualify time from 60 to 120. Problem solved.

  4. Re run “make menuconfig” select “Add-ons” right cursor to “—extended—” down cursor to “—deprecated—” then select “app_mysql” and “cdr_mysql” by pressing enter on each selection. Tab to “Save and Exit”. Then run “make” you will now see

    root@raspberrypi:/usr/src/asterisk-1.8.13.0-rc2# make menuconfig
    CC=”cc” CXX=”” LD=”” AR=”” RANLIB=”” CFLAGS=”” make -C menuselect CONFIGURE_SILENT=”–silent” gmenuselect
    make[1]: Entering directory `/usr/src/asterisk-1.8.13.0-rc2/menuselect’
    make[1]: Nothing to be done for `gmenuselect’.
    make[1]: Leaving directory `/usr/src/asterisk-1.8.13.0-rc2/menuselect’
    make[1]: Entering directory `/usr/src/asterisk-1.8.13.0-rc2′
    Unknown value ” found in build_tools/menuselect-deps for NATIVE_ARCH
    menuselect changes saved!
    make[1]: Leaving directory `/usr/src/asterisk-1.8.13.0-rc2′
    root@raspberrypi:/usr/src/asterisk-1.8.13.0-rc2# make
    Generating embedded module rules …
    [CC] app_mysql.c -> app_mysql.o
    [LD] app_mysql.o -> app_mysql.so
    [CC] cdr_mysql.c -> cdr_mysql.o
    [LD] cdr_mysql.o -> cdr_mysql.so
    [LD] abstract_jb.o acl.o alaw.o aoc.o app.o ast_expr2.o ast_expr2f.o asterisk.o astfd.o astmm.o astobj2.o audiohook.o autochan.o autoservice.o bridging.o callerid.o ccss.o cdr.o cel.o channel.o chanvars.o cli.o config.o data.o datastore.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o enum.o event.o features.o file.o fixedjitterbuf.o frame.o framehook.o fskmodem.o global_datastores.o hashtab.o heap.o http.o image.o indications.o io.o jitterbuf.o loader.o lock.o logger.o manager.o md5.o netsock.o netsock2.o pbx.o plc.o poll.o privacy.o rtp_engine.o say.o sched.o security_events.o sha1.o slinfactory.o srv.o ssl.o stdtime/localtime.o strcompat.o strings.o stun.o syslog.o taskprocessor.o tcptls.o tdd.o term.o test.o threadstorage.o timing.o translate.o udptl.o ulaw.o utils.o version.o xml.o xmldoc.o editline/libedit.a db1-ast/libdb1.a -> asterisk
    +——— Asterisk Build Complete ———+
    + Asterisk has successfully been built, and +
    + can be installed by running: +
    + +
    + make install +
    +——————————————-+

    If you look at the compilation output you will see
    app_mysql.so
    and cdr_mysql.so
    get created

    res_config_mysql.so is already there
    check with

    …../asterisk-1.8.13.0-rc2# find | grep res_config_mysql.so
    which should return
    ./addons/res_config_mysql.so

    all 3 are now there so run “make install”

    you can now prove they are in the right place by checking

    root@raspberrypi:/usr/bin# find / * | grep cdr_mysql.so
    /usr/lib/asterisk/modules/cdr_mysql.so
    /usr/src/asterisk-1.8.13.0-rc2/addons/cdr_mysql.so
    root@raspberrypi:/usr/bin# find / * | grep res_config_mysql.so
    /usr/lib/asterisk/modules/res_config_mysql.so
    /usr/src/asterisk-1.8.13.0-rc2/addons/res_config_mysql.so
    root@raspberrypi:/usr/bin#

    and you can see “make install” has placed them all in /usr/lib/asterisk/modules/

    now run “amportal restart”

    then pick up a sip extension and dial *60……. listen to the time…. hang up
    then go to the web app and go to >reports>CDR it should default to your current month…. then hit search… It should return

    Call Detail Record – Search Returned 3 Calls

    Call Date Recording System Src Chan. Source DID App. Dest. Dst. Chan. Disposition Duration Userfield Account
    2012-06-19 01:09:28 1340064568.2 SIP 202 Dial 201 SIP NO ANSWER 00:53
    2012-06-19 01:06:39 1340064399.1 SIP 202 SayUnixTime i ANSWERED 00:06
    2012-06-19 01:04:52 1340064292.0 SIP 202 Wait *60 ANSWERED 00:09

    thats 3 calls I did after “amportal restart” so I think CDR is now working

    enjoy 🙂

  5. I have applied your fixing, but the CDR still doesn’t work. Would you tell me what should I do?
    Thank you for your work!

    • You need to make sure the new modules cdr_mysql.so, res_config_mysql.so and app_mysql.so were successfully built and loaded on asterisk startup. Check the log /var/log/asterisk/full to see if they loaded properly.

    • Mine didn’t work because I did a “make” without a sudo and I think it reset my options. Try it again and if that doesn’t work try “module load cdr_mysql.so” in asterisk cli and see what it says.