Using mysql to manage freepbx

hi
I am a bit new to asterisk and learning. while reading the book “Asterisk the definitive guide 5th edition”.
the author uses mysql to manage it instead of the normal conf files. i also want to practice alogn with the author so i have freepbx latest version instaled and when i enter the commands which are working for auther they dont work for me. seems like my pbx is using mariadb and auther is using mysql.

can anyone guide me how do i format commands from author to my freepbx accordingly . i will brush up my db skills too along way. below is from book.

**First, into the ps_endpoints table, we’ll want to add the following:**
**$ mysql -D asterisk -u asterisk -p**
**Let’s review what we have there already (from the previous chapters):**
**mysql> select id,transport,aors,auth,context,disallow,allow from asterisk.ps_endpoints;**
**+--------------+---------------+--------------+--------------+----------+----------+-------+**
**| id | transport | aors | auth | context | disallow | allow |**
**+--------------+---------------+--------------+--------------+----------+----------+-------+**
**| 0000f30A0A01 | transport-udp | 0000f30A0A01 | 0000f30A0A01 | starfish | all | ulaw |**
**| 0000f30B0B02 | transport-udp | 0000f30B0B02 | 0000f30B0B02 | starfish | all | ulaw |**
**+--------------+---------------+--------------+--------------+----------+----------+-------+**
**2 rows in set (0.00 sec)**

when i try using this comand i get below error

MariaDB [asterisk]>
MariaDB [asterisk]> mysql> select id,transport,aors,auth,context,disallow,allow from asterisk.ps_endpoints;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘mysql> select id,transport,aors,auth,context,disallow,allow from asterisk.ps_end’ at line 1
MariaDB [asterisk]>

Any suggestion please. Can i make freepbx use same db so i can practice smoothly alogn.

I suspect the book is talking about Asterisk Realtime Architecture. FreePBX doesn’t use that (or maybe makes minimal use of it). ARA has a heavy performance hit, in some areas is poorly supported, and there is some lazy evaluation, which can mean changes are not picked up immediately.

For the most part, FreePBX uses databases as input to what is basically a report generator that generates Asterisk .conf files. However there is also some explicit run time use of databases, for some features.

In general, you should not try to update FreePBX databases except through the GUI or API, and should not rely on their internal structure being stable.

Hi thanks David . I checked the book and it doesnt makes any refrence to ARA. it is doing these changes on local asterisk from local console.

this is from book

We will not use the file for the
actual configuration (we are using the database instead); however, the file is an excel‐
lent reference, and you should keep it near at hand, as it will have the answers to
many questions you may have about parameters.```

If you want to learn real time then don’t start with FreePBX, use pure Asterisk.

1 Like

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