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