Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: wrong field in odbc conf for db connection #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -164,7 +164,7 @@ Next, we'll tell ODBC **which** MySQL database to use. To do this, we'll edit t
[asterisk]
Driver = MySQL
Description = MySQL connection to ‘asterisk’ database
Server = localhost
Servername = localhost
Port = 3306
Database = asterisk
UserName = root
@@ -173,7 +173,10 @@ Socket = /var/run/mysqld/mysqld.sock

```

Take care to use your database access UserName and Password, and not necessarily what's defined in this example.
Keep in mind that the `Servername` parameter should not be confused with `Server` that is invalid.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this isn't true. These examples are for MySQL, where it IS valid. It MAY be invalid for other databases. I think the documentation should be updated to state that different drivers may support different options, and so the MySQL based ones may not be applicable to others.


!!!note
Take care to use your database access UserName and Password, and not necessarily what's defined in this example.

Now, we need to configure Asterisk's ODBC resource, res_odbc, to connect to the ODBC **asterisk** database handle that we just created. res_odbc is configured using the */etc/asterisk/res_odbc.conf** configuration file. There, you'll want:

Original file line number Diff line number Diff line change
@@ -128,13 +128,15 @@ Add the following to /etc/odbc.ini
Description = MySQL connection to 'asterisk' database
Driver = MariaDB
Database = asterisk
Server = localhost
Servername = localhost
Port = 3306
Socket = /var/lib/mysql/mysql.sock

```


!!! note
Keep in mind that the `Servername` parameter should not be confused with `Server` that is invalid.

!!! note
You may want to verify that mysql.sock is actually in the location specific here. It will differ on some systems depending on your configuration.