Hot to force Asterisk to write date in UTF-8 charset? The 2019 Stack Overflow Developer Survey...
Problems with Ubuntu mount /tmp
Why does the Event Horizon Telescope (EHT) not include telescopes from Africa, Asia or Australia?
Make it rain characters
Does Parliament need to approve the new Brexit delay to 31 October 2019?
Difference between "generating set" and free product?
Did God make two great lights or did He make the great light two?
Can undead you have reanimated wait inside a portable hole?
The variadic template constructor of my class cannot modify my class members, why is that so?
What is special about square numbers here?
What is this lever in Argentinian toilets?
Match Roman Numerals
Wolves and sheep
Does Parliament hold absolute power in the UK?
How did passengers keep warm on sail ships?
Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?
Keeping a retro style to sci-fi spaceships?
Typeface like Times New Roman but with "tied" percent sign
What information about me do stores get via my credit card?
Relations between two reciprocal partial derivatives?
Scientific Reports - Significant Figures
Simulating Exploding Dice
How can I protect witches in combat who wear limited clothing?
Is every episode of "Where are my Pants?" identical?
How should I replace vector<uint8_t>::const_iterator in an API?
Hot to force Asterisk to write date in UTF-8 charset?
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Asterisk and x100p - Error: wcfxo: Out of space to write register 05 with 0aSSH connection using putty: using charset “UTF-8” instead of “ANSI_X3.4-1968”?Missing parts of utf-8 charset in urxvt with VcXsrvWhere to find libmyodbc5.so library after mysql-connector-odbc installation?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
CentOS Linux release 7.6.1810 (Core)
Kernel: localhost.localdomain 5.0.7-1.el7.elrepo.x86_64
MariaDB: Ver 15.1 Distrib 10.4.4-MariaDB, for Linux (x86_64) using readline 5.1
Asterisk: 16.3.0 built by root
unixODBC 2.3.1
mysql-connector-odbc 8.0.15-1
I made a connection between my Asterisk and MariaDB to store cdr and cel data.
Connection is ok and Asterisk can write into db.
I want to use cyrillic cid_name
, so I try to set UTF-8 charset anywhere.
But now, if I make test call, Asterisk writes cid_name
to db as ISO-8859-1, not as UTF-8 data. Why? And how can I fix this?
CLI:
MariaDB [asteriskcdrdb]> select * from cel;
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
The correct cyrillic view will be like that:
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | сатана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | сатана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
I think this is caused by Asterisk. May be it writes ISO-8859-1 by default, despite of DB's charset? I dont' know. There are no charset settings inside Asterisk.
DB settings:
Some mysql vars:
MariaDB [(none)]> SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
cat /etc/my.cnf
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
init_connect = 'SET character_set_system = utf8mb4'
init_connect = 'SET character_set_connection = utf8mb4'
init_connect = 'SET character_set_database = utf8mb4'
init_connect = 'SET character_set_results = utf8mb4'
init_connect = 'SET collation_database = utf8mb4_unicode_ci'
init_connect = 'SET collation_connection = utf8mb4_unicode_ci'
init_connect = 'SET NAMES utf8mb4'
# This group is read both both by the client and the server
# use it for options that affect everything
[client-server]
# include all files from the config directory
!includedir /etc/my.cnf.d
There are no collisions in /etc/my.cnf.d
ODBC configs:
cat /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
[MySQL-asterisk-conf]
Description=MySQL connection to 'asterisk' conf db
driver=MySQL
server=localhost
database=asterisk
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
cat /etc/odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver64=/usr/lib64/libmyodbc8w.so
Setup64=/usr/lib64/libodbcmyS.so
FileUsage=1
[MySQL ODBC 8.0 Unicode Driver]
Driver=/usr/lib64/libmyodbc8w.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
[MySQL ODBC 8.0 ANSI Driver]
Driver=/usr/lib64/libmyodbc8a.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
Asterisk configs:
cat /etc/asterisk/cel_odbc.conf
[cel]
connection=asteriskcdrdb
loguniqueid=yes
table=cel
charset=utf8mb4
[general]
cat /etc/asterisk/cel.conf
[general]
enable=yes
apps=all
events=ALL
dateformat = %F %T
[manager]
[radius]
cat /etc/asterisk/res_odbc.conf
[asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
[asterisk-conf]
enabled=>yes
dsn=>MySQL-asterisk-conf
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
linux mysql voip asterisk odbc
add a comment |
CentOS Linux release 7.6.1810 (Core)
Kernel: localhost.localdomain 5.0.7-1.el7.elrepo.x86_64
MariaDB: Ver 15.1 Distrib 10.4.4-MariaDB, for Linux (x86_64) using readline 5.1
Asterisk: 16.3.0 built by root
unixODBC 2.3.1
mysql-connector-odbc 8.0.15-1
I made a connection between my Asterisk and MariaDB to store cdr and cel data.
Connection is ok and Asterisk can write into db.
I want to use cyrillic cid_name
, so I try to set UTF-8 charset anywhere.
But now, if I make test call, Asterisk writes cid_name
to db as ISO-8859-1, not as UTF-8 data. Why? And how can I fix this?
CLI:
MariaDB [asteriskcdrdb]> select * from cel;
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
The correct cyrillic view will be like that:
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | сатана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | сатана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
I think this is caused by Asterisk. May be it writes ISO-8859-1 by default, despite of DB's charset? I dont' know. There are no charset settings inside Asterisk.
DB settings:
Some mysql vars:
MariaDB [(none)]> SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
cat /etc/my.cnf
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
init_connect = 'SET character_set_system = utf8mb4'
init_connect = 'SET character_set_connection = utf8mb4'
init_connect = 'SET character_set_database = utf8mb4'
init_connect = 'SET character_set_results = utf8mb4'
init_connect = 'SET collation_database = utf8mb4_unicode_ci'
init_connect = 'SET collation_connection = utf8mb4_unicode_ci'
init_connect = 'SET NAMES utf8mb4'
# This group is read both both by the client and the server
# use it for options that affect everything
[client-server]
# include all files from the config directory
!includedir /etc/my.cnf.d
There are no collisions in /etc/my.cnf.d
ODBC configs:
cat /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
[MySQL-asterisk-conf]
Description=MySQL connection to 'asterisk' conf db
driver=MySQL
server=localhost
database=asterisk
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
cat /etc/odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver64=/usr/lib64/libmyodbc8w.so
Setup64=/usr/lib64/libodbcmyS.so
FileUsage=1
[MySQL ODBC 8.0 Unicode Driver]
Driver=/usr/lib64/libmyodbc8w.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
[MySQL ODBC 8.0 ANSI Driver]
Driver=/usr/lib64/libmyodbc8a.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
Asterisk configs:
cat /etc/asterisk/cel_odbc.conf
[cel]
connection=asteriskcdrdb
loguniqueid=yes
table=cel
charset=utf8mb4
[general]
cat /etc/asterisk/cel.conf
[general]
enable=yes
apps=all
events=ALL
dateformat = %F %T
[manager]
[radius]
cat /etc/asterisk/res_odbc.conf
[asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
[asterisk-conf]
enabled=>yes
dsn=>MySQL-asterisk-conf
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
linux mysql voip asterisk odbc
add a comment |
CentOS Linux release 7.6.1810 (Core)
Kernel: localhost.localdomain 5.0.7-1.el7.elrepo.x86_64
MariaDB: Ver 15.1 Distrib 10.4.4-MariaDB, for Linux (x86_64) using readline 5.1
Asterisk: 16.3.0 built by root
unixODBC 2.3.1
mysql-connector-odbc 8.0.15-1
I made a connection between my Asterisk and MariaDB to store cdr and cel data.
Connection is ok and Asterisk can write into db.
I want to use cyrillic cid_name
, so I try to set UTF-8 charset anywhere.
But now, if I make test call, Asterisk writes cid_name
to db as ISO-8859-1, not as UTF-8 data. Why? And how can I fix this?
CLI:
MariaDB [asteriskcdrdb]> select * from cel;
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
The correct cyrillic view will be like that:
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | сатана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | сатана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
I think this is caused by Asterisk. May be it writes ISO-8859-1 by default, despite of DB's charset? I dont' know. There are no charset settings inside Asterisk.
DB settings:
Some mysql vars:
MariaDB [(none)]> SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
cat /etc/my.cnf
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
init_connect = 'SET character_set_system = utf8mb4'
init_connect = 'SET character_set_connection = utf8mb4'
init_connect = 'SET character_set_database = utf8mb4'
init_connect = 'SET character_set_results = utf8mb4'
init_connect = 'SET collation_database = utf8mb4_unicode_ci'
init_connect = 'SET collation_connection = utf8mb4_unicode_ci'
init_connect = 'SET NAMES utf8mb4'
# This group is read both both by the client and the server
# use it for options that affect everything
[client-server]
# include all files from the config directory
!includedir /etc/my.cnf.d
There are no collisions in /etc/my.cnf.d
ODBC configs:
cat /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
[MySQL-asterisk-conf]
Description=MySQL connection to 'asterisk' conf db
driver=MySQL
server=localhost
database=asterisk
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
cat /etc/odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver64=/usr/lib64/libmyodbc8w.so
Setup64=/usr/lib64/libodbcmyS.so
FileUsage=1
[MySQL ODBC 8.0 Unicode Driver]
Driver=/usr/lib64/libmyodbc8w.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
[MySQL ODBC 8.0 ANSI Driver]
Driver=/usr/lib64/libmyodbc8a.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
Asterisk configs:
cat /etc/asterisk/cel_odbc.conf
[cel]
connection=asteriskcdrdb
loguniqueid=yes
table=cel
charset=utf8mb4
[general]
cat /etc/asterisk/cel.conf
[general]
enable=yes
apps=all
events=ALL
dateformat = %F %T
[manager]
[radius]
cat /etc/asterisk/res_odbc.conf
[asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
[asterisk-conf]
enabled=>yes
dsn=>MySQL-asterisk-conf
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
linux mysql voip asterisk odbc
CentOS Linux release 7.6.1810 (Core)
Kernel: localhost.localdomain 5.0.7-1.el7.elrepo.x86_64
MariaDB: Ver 15.1 Distrib 10.4.4-MariaDB, for Linux (x86_64) using readline 5.1
Asterisk: 16.3.0 built by root
unixODBC 2.3.1
mysql-connector-odbc 8.0.15-1
I made a connection between my Asterisk and MariaDB to store cdr and cel data.
Connection is ok and Asterisk can write into db.
I want to use cyrillic cid_name
, so I try to set UTF-8 charset anywhere.
But now, if I make test call, Asterisk writes cid_name
to db as ISO-8859-1, not as UTF-8 data. Why? And how can I fix this?
CLI:
MariaDB [asteriskcdrdb]> select * from cel;
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | �а�ана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
The correct cyrillic view will be like that:
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+--------------------------+---------+---------+-----------+----------+-------+---------+------------------+------+------+---------+------------+---------+-----------------+----------+-------------+---------------+---------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2019-04-12 09:56:05 | сатана | 123 | | | | 123 | public | SIP/123-00000000 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.0 | 1555052165.0 | | | NULL | |
| 2 | CHAN_START | 2019-04-12 09:56:05 | сатана | | | | | s | public | SIP/123-00000001 | NULL | NULL | NULL | NULL | | | 3 | | 1555052165.2 | 1555052165.0 | | | NULL | |
I think this is caused by Asterisk. May be it writes ISO-8859-1 by default, despite of DB's charset? I dont' know. There are no charset settings inside Asterisk.
DB settings:
Some mysql vars:
MariaDB [(none)]> SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
cat /etc/my.cnf
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
init_connect = 'SET character_set_system = utf8mb4'
init_connect = 'SET character_set_connection = utf8mb4'
init_connect = 'SET character_set_database = utf8mb4'
init_connect = 'SET character_set_results = utf8mb4'
init_connect = 'SET collation_database = utf8mb4_unicode_ci'
init_connect = 'SET collation_connection = utf8mb4_unicode_ci'
init_connect = 'SET NAMES utf8mb4'
# This group is read both both by the client and the server
# use it for options that affect everything
[client-server]
# include all files from the config directory
!includedir /etc/my.cnf.d
There are no collisions in /etc/my.cnf.d
ODBC configs:
cat /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
[MySQL-asterisk-conf]
Description=MySQL connection to 'asterisk' conf db
driver=MySQL
server=localhost
database=asterisk
Port=3306
Socket=/var/lib/mysql/mysql.sock
Charset=utf8
FOUND_ROWS=1
BIG_PACKETS=1
UseUnicode=True
cat /etc/odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver64=/usr/lib64/libmyodbc8w.so
Setup64=/usr/lib64/libodbcmyS.so
FileUsage=1
[MySQL ODBC 8.0 Unicode Driver]
Driver=/usr/lib64/libmyodbc8w.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
[MySQL ODBC 8.0 ANSI Driver]
Driver=/usr/lib64/libmyodbc8a.so
SETUP=/usr/lib64/libmyodbc8S.so
UsageCount=1
Asterisk configs:
cat /etc/asterisk/cel_odbc.conf
[cel]
connection=asteriskcdrdb
loguniqueid=yes
table=cel
charset=utf8mb4
[general]
cat /etc/asterisk/cel.conf
[general]
enable=yes
apps=all
events=ALL
dateformat = %F %T
[manager]
[radius]
cat /etc/asterisk/res_odbc.conf
[asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
[asterisk-conf]
enabled=>yes
dsn=>MySQL-asterisk-conf
pooling=>no
limit=>1
pre-connect=>yes
username=>asteriskdb
password=>asteriskdb
linux mysql voip asterisk odbc
linux mysql voip asterisk odbc
asked yesterday
РодинкаРодинка
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Fixed by changing mysql-connector-odbc 8.0.15-1 to mariadb 3.1 connector.
Have no idea what's wrong with mysql connector.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1424586%2fhot-to-force-asterisk-to-write-date-in-utf-8-charset%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Fixed by changing mysql-connector-odbc 8.0.15-1 to mariadb 3.1 connector.
Have no idea what's wrong with mysql connector.
add a comment |
Fixed by changing mysql-connector-odbc 8.0.15-1 to mariadb 3.1 connector.
Have no idea what's wrong with mysql connector.
add a comment |
Fixed by changing mysql-connector-odbc 8.0.15-1 to mariadb 3.1 connector.
Have no idea what's wrong with mysql connector.
Fixed by changing mysql-connector-odbc 8.0.15-1 to mariadb 3.1 connector.
Have no idea what's wrong with mysql connector.
answered yesterday
РодинкаРодинка
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1424586%2fhot-to-force-asterisk-to-write-date-in-utf-8-charset%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown