Realtime database, error in registered device

Hello, I tried using sqlite3 as my realtime database. When I tried pjsip show endpoints in asterisk console, it worked and display all data from ps_endpoints, but when I try registered device using zoiper, it show this error.

WARNING[3041]: res_config_sqlite3.c:667 realtime_sqlite3_exec_update_with_handle: Could not execute 'INSERT INTO "ps_contacts" ("id", "via_addr", "qualify_timeout", "call_id", "reg_server", "prune_on_boot", "path", "endpoint", "via_port", "authenticate_qualify", "uri", "qualify_frequency", "user_agent", "expiration_time", "outbound_proxy") VALUES ('1002;@5030b8c089d41249baa414d5ce21e7a1', '192.168.43.1', '3.000000', '9zTv5AKR9xTGVyo-JmngKA..', '', 'no', '', '1002', '51234', 'no', 'sip:1002@192.168.43.1:51234;transport=UDP;rinstance=793200dda4df2d3f', '0', 'Zoiper rv2.10.3.0', '1571234035', '')': attempt to write a readonly database

ERROR[3041]: res_pjsip_registrar.c:764 register_aor_core: Unable to bind contact 'sip:1002@192.168.43.1:51234;transport=UDP;rinstance=793200dda4df2d3f' to AOR '1002'

I tried to find if there are other applications that access the database file, but there is none. Anybody can help ???

Have you checked the ownership and rights of astdb.sqlite3?

I using sqlite3 database from local folder in Documents. Should I still check ownership of astdb.sqlite3 ??? @EkFudrek

Yes, of course. You also need to know under what name Asterisk is running.

You didn’t give any info about how Asterisk was installed. Let’s say the db has root ownership and Asterisk is running as asterisk, then this could be an explanation. You need to provide more information, if you expect concrete help.

this one already solved. I need to change the ownership folder of sqlite3 file. Can you help me solved this one ? Asterisk Realtime, unregistered failed @EkFudrek

Please post the output of “ls -l /astdb.sqlite3”, “grep -n run /asterisk.conf”, and “ps aux | grep asterisk”. You need to substitute with the proper paths.

ownership of astdb.sqlite3

-rwxrwxrwx 1 asterisk asterisk 12288 Okt 17 14:38 astdb.sqlite3

gre -n run /asterisk.conf

10:astrundir => /var/run/asterisk
73:runuser = asterisk ; The user to run as.
74:rungroup = asterisk ; The group to run as.

ps aux | grep asterisk

root 28236 0.0 0.0 21536 972 pts/0 S+ 15:33 0:00 grep --color=auto asterisk.db

fyi : my sqlite3 file name that use in asterisk is asterisk.db located in /home/deadsec/Documents/project/src/database/asterisk.db

Whilst I cannot answer database questions in general, please remove execute permission immediately; there is no legitimate reason for a database file to have execute permission. Also please work out the minimum permission that you actually need, as soon as you get this working

(Although not relevant in your case, some programs will actually refuse to run if you give files exceessive permissions.)

If you neglect David’s security hints, you can do the following to run Asterisk:
chmod root:root astdb.sqlite3
and
chmod 0644 astdb.sqlite3
There are better ways to handle you problem, but that would require checking of a bunch of other things as well.

Without commenting on whether these are the correct owner and group, I think you meant chown, not chmod, for this one.

Yes, I meant chown…

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