[asterisk-bugs] [JIRA] (ASTERISK-28069) Dropping CDRs records with local languages

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Mon Sep 24 07:35:54 CDT 2018


     [ https://issues.asterisk.org/jira/browse/ASTERISK-28069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Mudgett updated ASTERISK-28069:
---------------------------------------

    Description: 
If in CDR record appears local language Asterisk may corrupt data and fail to write them in database.

How to reproduce:

1. Create context in extensions in the database with some line in local language.
Encoding of database must be UTF-8.
{noformat}
Example (with Russian):
173705
text-machine	dbd54025c33844fbe672835e5960c0b7	NoOp	------------- Text Machine -------------	
1
173706
text-machine	dbd54025c33844fbe672835e5960c0b7	Answer		
2
173707
text-machine	dbd54025c33844fbe672835e5960c0b7	Hangup		
9
173708
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"Уважаемый Иванов Иван Иванович"	
3
173709
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"приглашаем вас пройти профосмотр первого августа"	
4
173710
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"по адресу улица казахстанская, дом номер один, кабинет номер двадцать"	
5
173711
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"При себе иметь удостоверение личности"	
6
173712
text-machine	dbd54025c33844fbe672835e5960c0b7	Wait	5	
7
{noformat}
Since database accept this no special characters in that context exists.

Initiate a call and drop a call to force asterisk write Russian characters in lastapp field in CDR.

You will receive:
{noformat}
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:439 pgsql_log: Failed to insert call detail record into database!
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:440 pgsql_log: Reason: ERROR:  invalid byte sequence for encoding "UTF8": 0xd0 0x20
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:441 pgsql_log: Connection may have been lost... attempting to reconnect.
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:444 pgsql_log: Connection reestablished.
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:452 pgsql_log: HARD ERROR!  Attempted reconnection failed.  DROPPING CALL RECORD!
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:453 pgsql_log: Reason: ERROR:  invalid byte sequence for encoding "UTF8": 0xd0 0x20
{noformat}
Since CDR and context are in the same database - I think this is not database locale settings.
We test it on different 13.XX versions
We test in on PostgreSQL 9.4.XX and 9.6.XX

Byte sequence in error message varies a little, but first byte always 0xd0

  was:
If in CDR record appears local language Asterisk may corrupt data and fail to write them in database.

How to reproduce:

1. Create context in extensions in the database with some line in local language.
Encoding of database must be UTF-8.

Example (with Russian):
173705
text-machine	dbd54025c33844fbe672835e5960c0b7	NoOp	------------- Text Machine -------------	
1
173706
text-machine	dbd54025c33844fbe672835e5960c0b7	Answer		
2
173707
text-machine	dbd54025c33844fbe672835e5960c0b7	Hangup		
9
173708
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"Уважаемый Иванов Иван Иванович"	
3
173709
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"приглашаем вас пройти профосмотр первого августа"	
4
173710
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"по адресу улица казахстанская, дом номер один, кабинет номер двадцать"	
5
173711
text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"При себе иметь удостоверение личности"	
6
173712
text-machine	dbd54025c33844fbe672835e5960c0b7	Wait	5	
7

Since database accept this no special characters in that context exists.

Initiate a call and drop a call to force asterisk write Russian characters in lastapp field in CDR.

You will receive:

[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:439 pgsql_log: Failed to insert call detail record into database!
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:440 pgsql_log: Reason: ERROR:  invalid byte sequence for encoding "UTF8": 0xd0 0x20
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:441 pgsql_log: Connection may have been lost... attempting to reconnect.
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:444 pgsql_log: Connection reestablished.
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:452 pgsql_log: HARD ERROR!  Attempted reconnection failed.  DROPPING CALL RECORD!
[2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:453 pgsql_log: Reason: ERROR:  invalid byte sequence for encoding "UTF8": 0xd0 0x20

Since CDR and context are in the same database - I think this is not database locale settings.
We test it on different 13.XX versions
We test in on PostgreSQL 9.4.XX and 9.6.XX

Byte sequence in error message varies a little, but first byte always 0xd0


> Dropping CDRs records with local languages 
> -------------------------------------------
>
>                 Key: ASTERISK-28069
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28069
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/cdr_pgsql
>    Affects Versions: 13.19.0, 13.23.0, 13.23.1
>         Environment: Debian 3.16.51-2
> psql (PostgreSQL) 9.4.15
>            Reporter: Kirill Nikitin
>            Severity: Minor
>
> If in CDR record appears local language Asterisk may corrupt data and fail to write them in database.
> How to reproduce:
> 1. Create context in extensions in the database with some line in local language.
> Encoding of database must be UTF-8.
> {noformat}
> Example (with Russian):
> 173705
> text-machine	dbd54025c33844fbe672835e5960c0b7	NoOp	------------- Text Machine -------------	
> 1
> 173706
> text-machine	dbd54025c33844fbe672835e5960c0b7	Answer		
> 2
> 173707
> text-machine	dbd54025c33844fbe672835e5960c0b7	Hangup		
> 9
> 173708
> text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"Уважаемый Иванов Иван Иванович"	
> 3
> 173709
> text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"приглашаем вас пройти профосмотр первого августа"	
> 4
> 173710
> text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"по адресу улица казахстанская, дом номер один, кабинет номер двадцать"	
> 5
> 173711
> text-machine	dbd54025c33844fbe672835e5960c0b7	AGI	say.php,"При себе иметь удостоверение личности"	
> 6
> 173712
> text-machine	dbd54025c33844fbe672835e5960c0b7	Wait	5	
> 7
> {noformat}
> Since database accept this no special characters in that context exists.
> Initiate a call and drop a call to force asterisk write Russian characters in lastapp field in CDR.
> You will receive:
> {noformat}
> [2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:439 pgsql_log: Failed to insert call detail record into database!
> [2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:440 pgsql_log: Reason: ERROR:  invalid byte sequence for encoding "UTF8": 0xd0 0x20
> [2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:441 pgsql_log: Connection may have been lost... attempting to reconnect.
> [2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:444 pgsql_log: Connection reestablished.
> [2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:452 pgsql_log: HARD ERROR!  Attempted reconnection failed.  DROPPING CALL RECORD!
> [2018-09-18 19:15:04] ERROR[10904]: cdr_pgsql.c:453 pgsql_log: Reason: ERROR:  invalid byte sequence for encoding "UTF8": 0xd0 0x20
> {noformat}
> Since CDR and context are in the same database - I think this is not database locale settings.
> We test it on different 13.XX versions
> We test in on PostgreSQL 9.4.XX and 9.6.XX
> Byte sequence in error message varies a little, but first byte always 0xd0



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list