Asterisk billing using cdr+sqlite3 (is there any way to change path for sqlite3 DB?)

Happy new year evryone! :santa:

Openwrt 19.7, Asterisk16+ sqlite3. everything works fine ,i aslo write simple php page for this table (cdr)
By default cvs file and sqlite3 DB stores in
/var/log/asterisk
but! this folder is not in overlay so after reboot it disapeeres all the time!
Is there any way to move database and cvs to overlay so after rebbot it is still there?
i have changed astlogdir => /asterdb/log/asterisk in asterisk.conf but no difference still goes in /var/log/asterisk and after rebbot all erased.
i googled but no luck

Replace file(s) by softlink(s) ?

1 Like

how to do that ?
after start after first call db is created as new
how to make soft link ? i can try it right now
/var/log/asterisk/master.db to /asterdb/log/master.db
my overlay is 8 Gb 40 Mb in use i use f2 fs it is friendly for flash drives. Maybe it is Ok that way?

Stop Asterisk again, move the files, create the softlinks, restart Asterisk.

Remember to add the creation of the softlinks to the devices startup script, or the database will be created empty again.
Don't autostart Asterisk on boot, start it manually, after the links are created

I also hope you put the db on some external storage, or you'll wear out your flash pretty quickly.

1 Like

Maybe it's like the issue described here and what you changed is only used as a template because of "!"?

2 Likes

Oh yes! thank a lot it realy worked !
i just remover (!) from asterisk.config

[directories](!) <--- remove this
astcachedir => /tmp
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /usr/share/asterisk
astagidir => /usr/share/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk

astlogdir => /asterdb/log/asterisk
astsbindir => /usr/sbin

[options]

and now i have everything working the way it is supposed to be!
pls tell me how you ask google this one that you find thuis so quikly ?
i spent whoul new year evening to try to find the solution but i googled hot to change path of /var/log/asterisk
Thanks a lot again ! Happy new year to you ! :evergreen_tree:

I just searched for astlogdir on www.startpage.com and this was the first hit :smiley:

Happy new year

2 Likes

now i am trying to find solution for other problem in Asterisk
it is cvs time stamp
the time is olways in GTM
i have changed setting in cdr.config to

[csv]
usegmtime=no   ; log date/time in GMT.  Default is "no"
loguniqueid=yes  ; log uniqueid.  Default is "no"
loguserfield=yes ; log user field.  Default is "no"
accountlogs=yes  ; create separate log file for each account code. Default is "yes"
;newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence).
                   ; Default is "no".

but still the same times in cvs->sqlite3 is in GTM
googled and startpaged but looks like there is no solution...
the !time in CLI> shows correct time , my local time

Probably you need a proper zoneinfo file for that.

1 Like

My time is GMT+3
what i did is
cp /usr/share/zoneinfo/GMT-3 /etc/localtime
and rebooted
and now evrywhere the time is corect. But i didnt undestand why -3 GMT makes it correct if i live +3 GMT
Thanks for the tip

Sign is intentionally inverted. See https://en.m.wikipedia.org/wiki/Tz_database#Area (from Wikipedia).

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.