Categories
Asterisk Database Linux

Asterisk + ODBC + Mysql

The latest versions of the Asterisk PBX server connect to the Mysql database server by using ODBC. In this tutorial, I will show you how to set this up.

My test environment is CentOS Linux released on 7.9.2009, Asterisk 16.16.0, unixODBC 2.3.1, and Mysql Community Server 8.

I am taking for granted that you already have your Mysql installed and running. If you have not taken this step yet, you should use a tutorial like this one.

1 – Install the Unix ODBC:

# yum -y install unixODBC

2 – Download the official Mysql library connector from: https://dev.mysql.com/downloads/connector/odbc/

# wget https://cdn.mysql.com//Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.23-linux-glibc2.12-x86-64bit.tar.gz

Decompress the package in /usr/local directory or wherever you like.

# tar -zxvf mysql-connector-odbc-8.0.23-linux-glibc2.12-x86-64bit.tar.gz -C /usr/local

3 – Edit the file /etc/odbcinst.ini and insert the following code block:

[MySQL_ANSI]
Driver=/usr/local/mysql-odbc/lib/libmyodbc8a.so
sageCount=1

4 – Edit the file /etc/odbc.ini and create your connection:

[asterisk-connector]
Description = MySQL connection
Driver = MySQL_ANSI
Database = asterisk
Server = 127.0.0.1
Port = 3306

5 – Now, you must configure your Asterisk to use the connection. The file which contains that information is /etc/asterisk/res_odbc.conf

[asterisk]
enabled => yes
dsn => asterisk-connector
username => user
password => secret
pre-connect => yes
max_connections => 100

6 – Finally, make sure that Asterisk is using the ODBC module, take a look at the file /etc/asterisk/modules.conf and find the following line:

preload => res_odbc.so

If you have any questions, please use the comment box below.

Categories
Database Linux

Running Mysql queries using Login Profile

The newest versions of the Mysql server, such as the 8, presents the following message when users try to use the database password in the command line:

# mysql -u root -p"password" -e "show databases"

mysql: [Warning] Using a password on the command line interface can be insecure.

In order to prevent this warning message, you just need to create a password profile, in this example we going to create one called “local”:

# mysql_config_editor set --login-path=local \
--host=localhost --port=3306 \
--socket=/var/lib/mysql/mysql.sock \
--user=root --password

Now, you can easily run queries without providing the password, just use the “local” profile:

# /usr/bin/mysql --login-path=local -h localhost -e "show databases"

Categories
Essay

The fashion trap

Annually, fashion tendencies may change many times. These days, it is hard for an ordinary person to recognize the latest fashion trends from the season. From my perspective, people should care less about these trends, and save their money buying what makes them feel good. This essay will discuss the topic in detail.

Firstly, it is almost impossible to follow such an enormous quantity of fashion trends. Globalization has made it harder since western countries come to play the capitalist game. In addition, social networking has been increasing the exchange between cultures as people have never experienced this before. An American teenager, for example, might see in her mobile phone what is trending in Japan and South Africa simultaneously. Because of this, the decision of what to follow has become extremely difficult.

There is no doubt that following the latest fashion tendencies requires deep pockets. For those who want to wear a dress of the same brand that they saw on a television advertisement, they must pay top dollar to put their hands on this product. Therefore, if I were a regular worker – specifically living in developing countries – I would not spend a big cut of my budget on these articles. There are many other ways to use money more prudently. For instance, they can buy what was fashionable in the last season for half of the price.

In summary, I would recommend people to avoid the fashion trap as much as they can. It is important to take into account that the marketing industry is always trying to persuade us to buy those products. People should think about what their priorities are before buying such goods.

Categories
Essay

Computers versus workers

In recent years, the majority of businesses have relied on computers when it comes to their operational processes. While some people argue that these machines are a burden, I think that computer-based devices can be extremely useful to process all sorts of data, but operating such machines requires high-skilled workers.

The amount of information that individuals and companies must deal with every day is enormous. In fact, gadgets are more accessible and user-friendly today than ever before. This increase of usage tends to elevate the number of data spread worldwide. Without the assistance of computers, companies cannot tackle some issues related to finances, marketing, production and logistics. Just computers can provide not only storage capacity, but also accuracy to deal with complex numbers and codes.

On the other hand, the technological revolution has left behind countless people who do not know how to command these modern machines. Developing countries, for example, are not even able to provide their citizens with the minimal education. Therefore, companies that are established in such places struggle to hire workforce and to maintain their operation. In this scenario, computers are definitely an obstacle which individuals have to overcome if they want to obtain well-paid jobs.

In summary, modern life imposes challenges to everyone, especially for those who live in big cities, that might likely come across computers at some point in their life routine. The more companies adopt computational systems to run their businesses, the more their productivity will increase. As a result, the overall price tags would diminish, allowing people to provide more comfort to their families.

Categories
Essay

What is matter on career’s choice?

Choosing a profession is a tough decision, and it is a moment in which individuals may consider multiple variables. Some people argue that salary is the pivotal element of this choice, and I do believe that this characteristic is still relevant. However, there are other aspects to take into account. This essay will support my point of view in detail.

There is no doubt that getting a well-paid job is the main goal for almost every person. As the cost of living in many places around the world increases, people tend to worry more about their income. Therefore, before picking up a college degree, youngsters should do some research about the average salary of the career they would like to pursue. If they follow the wrong career pathway, they will probably struggle to make ends meet in their adulthood. In order to get the best direction possible, people should be driven by marketing and economic tendencies.

On the other hand, studies have shown that just money does not make people satisfied in the long run. Scholars from all over the world have published studies that prove this theory. Some surveys have revealed that high-paid workers did not mention their income as the main factor of happiness at work. They usually mention other elements that make them feel joyful at work: such as, the environment of the workplace, the friendship that they built with colleagues, and how far their jobs challenge them.

In summary, a six-figure salary provides not only safety but also stability. For those families who can rely on a high-income earning, life could be less stressful. Therefore, to define which work to do for their entire lifespan, people should pay attention to how certain professions look daily to cement their decision.

Categories
Uncategorized

Hello world!

For a long period of time, I wanted to have a personal website where I could share information with my peers and publish some thoughts.

Recently, as I have more spare time, I started working on it.

To me, this space works not only as a technical repository, but also as a place that I can improve my writing skills.

I hope you all enjoy it!