[asterisk-bugs] [JIRA] (ASTERISK-30413) app_queue: UnpauseQueueMember generate generating string invalid in lastapp and lastdata

Sean Bright (JIRA) noreply at issues.asterisk.org
Wed Feb 1 15:00:03 CST 2023


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

Sean Bright updated ASTERISK-30413:
-----------------------------------

    Description: 
After posting to the community, I was asked to create this issue.
As this is the first time, I apologize if this is not the case.

Afert hangup agent loged current error.

{noformat}
same => n,UnpauseQueueMember(,Local/3000 at agent)
{noformat}

I made several changes to test in the odbc driver and also in the database for utf8mb4 and for utf8, I didn’t get any results, I did a log collection, the problem always occurs when I finish the camal call with a logged in agent, thus generating the variable lastdata and lastapp with strange characters.

>>>>>>. Debug full log asterisk <<<<<<

{noformat}
[2023-02-01 14:59:26] DEBUG[292578] res_odbc.c: Reusing ODBC handle 0x7f75f8149bb0 from class ‘asterisk’
[2023-02-01 14:59:26] DEBUG[292578] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[2023-02-01 14:59:26] WARNING[292586] res_odbc.c: SQL Execute returned an error: 22007: [ma-3.1.9][10.5.18-MariaDB-0+deb11u1-log]Incorrect string value: ‘\xDFv0v\007F’ for column asterisk.cdr.lastapp at row 1
[2023-02-01 14:59:26] WARNING[292586] res_odbc.c: SQL Execute error -1!
[2023-02-01 14:59:26] WARNING[292586] cdr_adaptive_odbc.c: cdr_adaptive_odbc: Insert failed on ‘asterisk:cdr’. CDR failed: INSERT INTO cdr (calldate, answer, end, src, dst, dcontext, channel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, linkedid, sequence, callrec) VALUES ({ ts ‘2023-02-01 14:57:43’ }, { ts ‘2023-02-01 14:57:47’ }, { ts ‘2023-02-01 14:59:26’ }, ‘8000’, ‘h’, ‘APPLICATION-20’, ‘PJSIP/8000-00000006’, ‘x�v0v’, ‘p�v0v’, 102, 99, ‘ANSWERED’, 3, ‘8000’, ‘1675274263.18’, ‘1675274263.18’, 6, 1)
[2023-02-01 14:59:26] DEBUG[292586] res_odbc.c: Releasing ODBC handle 0x7f75f8168940 into pool
[2023-02-01 14:59:26] DEBUG[292586] stasis.c: Creating topic. name: channel:1675274366.19, detail:
[2023-02-01 14:59:26] DEBUG[292586] stasis.c: Topic ‘channel:1675274366.19’: 0x7f75d80154e0 created
[2023-02-01 14:59:26] DEBUG[292578] res_config_odbc.c: Parameter 1 (‘id’) = ‘8000’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(start) result is ‘2023-02-01 14:57:43’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(clid) result is ‘“8000 pjsip” <8000>’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(dcontext) result is ‘APPLICATION-20’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(channel) result is ‘PJSIP/8000-00000006’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(dstchannel) result is ‘’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(lastapp) result is ‘x�v0v’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(lastdata) result is ‘p�v0v’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(duration,f) result is ‘102.940045’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(billsec,f) result is ‘99.203213’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(disposition) result is ‘ANSWERED’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(amaflags) result is ‘DOCUMENTATION’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(accountcode) result is ‘8000’
{noformat}

<<<<<< Debug verbose CLI >>>>>

{noformat}
Executing [s at gosub-endagentlogin:5] MYSQL(“PJSIP/8000-00000007”, “Disconnect 1”) in new stack
– Executing [s at gosub-endagentlogin:6] UnpauseQueueMember(“PJSIP/8000-00000007”, “,Local/1999 at queue_agents”) in new stack
– Executing [s at gosub-endagentlogin:7] Return(“PJSIP/8000-00000007”, “”) in new stack
0x7f75d80214d0 - Transitioning CDR for PJSIP/8000-00000007 from state Single to Finalized
0x7f75d80214d0 - Beginning finalize/dispatch for PJSIP/8000-00000007
0x7f75d80214d0 - Dispatching CDR for Party A PJSIP/8000-00000007, Party B
[2023-02-01 15:05:48] WARNING[292586]: res_odbc.c:529 ast_odbc_print_errors: SQL Execute returned an error: 22007: [ma-3.1.9][10.5.18-MariaDB-0+deb11u1-log]Incorrect string value: ‘\xDFv0v\007F’ for column asterisk.cdr.lastapp at row 1
[2023-02-01 15:05:48] WARNING[292586]: res_odbc.c:424 ast_odbc_prepare_and_execute: SQL Execute error -1!
[2023-02-01 15:05:48] WARNING[292586]: cdr_adaptive_odbc.c:766 odbc_log: cdr_adaptive_odbc: Insert failed on ‘asterisk:cdr’. CDR failed: INSERT INTO cdr (calldate, answer, end, src, dst, dcontext, channel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, linkedid, sequence, callrec) VALUES ({ ts ‘2023-02-01 15:03:21’ }, { ts ‘2023-02-01 15:03:26’ }, { ts ‘2023-02-01 15:05:48’ }, ‘8000’, ‘h’, ‘APPLICATION-20’, ‘PJSIP/8000-00000007’, ‘x�v0v’, ‘p�v0v’, 146, 141, ‘ANSWERED’, 3, ‘8000’, ‘1675274601.21’, ‘1675274601.21’, 7, 1)
{noformat}

<<<< File /etc/odbc.ini >>>>

{noformat}
[asterisk]
Driver = MariaDB
Description = MariaDB connection to database
Server = 127.0.0.1
Port = 3306
Database = asterisk
UserName = asterisk
Password = xxxxxxxx
Socket = /var/run/mysqld/mysqld.sock
CharSet = UTF8
{noformat}

<<<<< File /etc/odbcinst.ini >>>>>

{noformat}
[MariaDB]
Driver=libmaodbc.so
Description=MariaDB Connector/ODBC(Unicode)
Threading=0
UsageCount=2
{noformat}

<<<< Mariadb Server version: 10.5.18-MariaDB-0+deb11u1-log Debian 11 >>>

{noformat}
show variables like ‘%coll%’;
±---------------------±----------------+
| Variable_name | Value |
±---------------------±----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
±---------------------±----------------+

show variables like ‘%cha%’;
±------------------------------±---------------------------+
| Variable_name | Value |
±------------------------------±---------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| innodb_change_buffer_max_size | 25 |
| innodb_change_buffering | none |
| session_track_state_change | OFF |

show create database asterisk;
±---------±----------------------------------------------------------------------------------------+
| Database | Create Database |
±---------±----------------------------------------------------------------------------------------+
| asterisk | CREATE DATABASE asterisk /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci */ |

show create table cdr;

| cdr | CREATE TABLE cdr (
calldate datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
answer datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
end datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
clid varchar(80) NOT NULL DEFAULT ‘’,
src varchar(80) NOT NULL DEFAULT ‘’,
dst varchar(80) NOT NULL DEFAULT ‘’,
dcontext varchar(80) NOT NULL DEFAULT ‘’,
channel varchar(80) NOT NULL DEFAULT ‘’,
dstchannel varchar(80) NOT NULL DEFAULT ‘’,
lastapp varchar(80) DEFAULT NULL,
lastdata varchar(80) NOT NULL DEFAULT ‘’,
duration int(10) unsigned NOT NULL DEFAULT 0,
billsec int(10) unsigned NOT NULL DEFAULT 0,
disposition varchar(45) NOT NULL DEFAULT ‘’,
amaflags int(4) unsigned NOT NULL DEFAULT 0,
accountcode varchar(80) DEFAULT NULL,
userfield varchar(255) NOT NULL DEFAULT ‘’,
uniqueid varchar(32) NOT NULL DEFAULT ‘’,
linkedid varchar(32) NOT NULL,
sequence int(10) unsigned NOT NULL,
peeraccount varchar(80) DEFAULT ‘’,
callednum varchar(80) DEFAULT NULL,
carrier varchar(25) DEFAULT NULL,
callrec tinyint(1) DEFAULT NULL,
callfile varchar(150) DEFAULT NULL,
calltype enum(‘in’,‘out’,‘ext’,‘inApp’,‘outApp’,‘transit’) DEFAULT NULL,
sip_out_ip varchar(15) DEFAULT ‘’,
sip_out_useragent varchar(255) DEFAULT ‘’,
hangupcause int(10) unsigned DEFAULT 0,
CONSTRAINT CONSTRAINT_1 CHECK (callrec in (0,1))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci |
±---------±----------------------------------------------------------------------------------------+
{noformat}

  was:
After posting to the community, I was asked to create this issue.
As this is the first time, I apologize if this is not the case.

Afert hangup agent loged current error.

same => n,UnpauseQueueMember(,Local/3000 at agent)

I made several changes to test in the odbc driver and also in the database for utf8mb4 and for utf8, I didn’t get any results, I did a log collection, the problem always occurs when I finish the camal call with a logged in agent, thus generating the variable lastdata and lastapp with strange characters.

>>>>>>. Debug full log asterisk <<<<<<

[2023-02-01 14:59:26] DEBUG[292578] res_odbc.c: Reusing ODBC handle 0x7f75f8149bb0 from class ‘asterisk’
[2023-02-01 14:59:26] DEBUG[292578] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[2023-02-01 14:59:26] WARNING[292586] res_odbc.c: SQL Execute returned an error: 22007: [ma-3.1.9][10.5.18-MariaDB-0+deb11u1-log]Incorrect string value: ‘\xDFv0v\007F’ for column asterisk.cdr.lastapp at row 1
[2023-02-01 14:59:26] WARNING[292586] res_odbc.c: SQL Execute error -1!
[2023-02-01 14:59:26] WARNING[292586] cdr_adaptive_odbc.c: cdr_adaptive_odbc: Insert failed on ‘asterisk:cdr’. CDR failed: INSERT INTO cdr (calldate, answer, end, src, dst, dcontext, channel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, linkedid, sequence, callrec) VALUES ({ ts ‘2023-02-01 14:57:43’ }, { ts ‘2023-02-01 14:57:47’ }, { ts ‘2023-02-01 14:59:26’ }, ‘8000’, ‘h’, ‘APPLICATION-20’, ‘PJSIP/8000-00000006’, ‘x�v0v’, ‘p�v0v’, 102, 99, ‘ANSWERED’, 3, ‘8000’, ‘1675274263.18’, ‘1675274263.18’, 6, 1)
[2023-02-01 14:59:26] DEBUG[292586] res_odbc.c: Releasing ODBC handle 0x7f75f8168940 into pool
[2023-02-01 14:59:26] DEBUG[292586] stasis.c: Creating topic. name: channel:1675274366.19, detail:
[2023-02-01 14:59:26] DEBUG[292586] stasis.c: Topic ‘channel:1675274366.19’: 0x7f75d80154e0 created
[2023-02-01 14:59:26] DEBUG[292578] res_config_odbc.c: Parameter 1 (‘id’) = ‘8000’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(start) result is ‘2023-02-01 14:57:43’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(clid) result is ‘“8000 pjsip” <8000>’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(dcontext) result is ‘APPLICATION-20’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(channel) result is ‘PJSIP/8000-00000006’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(dstchannel) result is ‘’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(lastapp) result is ‘x�v0v’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(lastdata) result is ‘p�v0v’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(duration,f) result is ‘102.940045’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(billsec,f) result is ‘99.203213’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(disposition) result is ‘ANSWERED’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(amaflags) result is ‘DOCUMENTATION’
[2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(accountcode) result is ‘8000’

<<<<<< Debug verbose CLI >>>>>

Executing [s at gosub-endagentlogin:5] MYSQL(“PJSIP/8000-00000007”, “Disconnect 1”) in new stack
– Executing [s at gosub-endagentlogin:6] UnpauseQueueMember(“PJSIP/8000-00000007”, “,Local/1999 at queue_agents”) in new stack
– Executing [s at gosub-endagentlogin:7] Return(“PJSIP/8000-00000007”, “”) in new stack
0x7f75d80214d0 - Transitioning CDR for PJSIP/8000-00000007 from state Single to Finalized
0x7f75d80214d0 - Beginning finalize/dispatch for PJSIP/8000-00000007
0x7f75d80214d0 - Dispatching CDR for Party A PJSIP/8000-00000007, Party B
[2023-02-01 15:05:48] WARNING[292586]: res_odbc.c:529 ast_odbc_print_errors: SQL Execute returned an error: 22007: [ma-3.1.9][10.5.18-MariaDB-0+deb11u1-log]Incorrect string value: ‘\xDFv0v\007F’ for column asterisk.cdr.lastapp at row 1
[2023-02-01 15:05:48] WARNING[292586]: res_odbc.c:424 ast_odbc_prepare_and_execute: SQL Execute error -1!
[2023-02-01 15:05:48] WARNING[292586]: cdr_adaptive_odbc.c:766 odbc_log: cdr_adaptive_odbc: Insert failed on ‘asterisk:cdr’. CDR failed: INSERT INTO cdr (calldate, answer, end, src, dst, dcontext, channel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, linkedid, sequence, callrec) VALUES ({ ts ‘2023-02-01 15:03:21’ }, { ts ‘2023-02-01 15:03:26’ }, { ts ‘2023-02-01 15:05:48’ }, ‘8000’, ‘h’, ‘APPLICATION-20’, ‘PJSIP/8000-00000007’, ‘x�v0v’, ‘p�v0v’, 146, 141, ‘ANSWERED’, 3, ‘8000’, ‘1675274601.21’, ‘1675274601.21’, 7, 1)

<<<< File /etc/odbc.ini >>>>

[asterisk]
Driver = MariaDB
Description = MariaDB connection to database
Server = 127.0.0.1
Port = 3306
Database = asterisk
UserName = asterisk
Password = xxxxxxxx
Socket = /var/run/mysqld/mysqld.sock
CharSet = UTF8

<<<<< File /etc/odbcinst.ini >>>>>

[MariaDB]
Driver=libmaodbc.so
Description=MariaDB Connector/ODBC(Unicode)
Threading=0
UsageCount=2

<<<< Mariadb Server version: 10.5.18-MariaDB-0+deb11u1-log Debian 11 >>>
show variables like ‘%coll%’;
±---------------------±----------------+
| Variable_name | Value |
±---------------------±----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
±---------------------±----------------+

show variables like ‘%cha%’;
±------------------------------±---------------------------+
| Variable_name | Value |
±------------------------------±---------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| innodb_change_buffer_max_size | 25 |
| innodb_change_buffering | none |
| session_track_state_change | OFF |

show create database asterisk;
±---------±----------------------------------------------------------------------------------------+
| Database | Create Database |
±---------±----------------------------------------------------------------------------------------+
| asterisk | CREATE DATABASE asterisk /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci */ |

show create table cdr;

| cdr | CREATE TABLE cdr (
calldate datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
answer datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
end datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
clid varchar(80) NOT NULL DEFAULT ‘’,
src varchar(80) NOT NULL DEFAULT ‘’,
dst varchar(80) NOT NULL DEFAULT ‘’,
dcontext varchar(80) NOT NULL DEFAULT ‘’,
channel varchar(80) NOT NULL DEFAULT ‘’,
dstchannel varchar(80) NOT NULL DEFAULT ‘’,
lastapp varchar(80) DEFAULT NULL,
lastdata varchar(80) NOT NULL DEFAULT ‘’,
duration int(10) unsigned NOT NULL DEFAULT 0,
billsec int(10) unsigned NOT NULL DEFAULT 0,
disposition varchar(45) NOT NULL DEFAULT ‘’,
amaflags int(4) unsigned NOT NULL DEFAULT 0,
accountcode varchar(80) DEFAULT NULL,
userfield varchar(255) NOT NULL DEFAULT ‘’,
uniqueid varchar(32) NOT NULL DEFAULT ‘’,
linkedid varchar(32) NOT NULL,
sequence int(10) unsigned NOT NULL,
peeraccount varchar(80) DEFAULT ‘’,
callednum varchar(80) DEFAULT NULL,
carrier varchar(25) DEFAULT NULL,
callrec tinyint(1) DEFAULT NULL,
callfile varchar(150) DEFAULT NULL,
calltype enum(‘in’,‘out’,‘ext’,‘inApp’,‘outApp’,‘transit’) DEFAULT NULL,
sip_out_ip varchar(15) DEFAULT ‘’,
sip_out_useragent varchar(255) DEFAULT ‘’,
hangupcause int(10) unsigned DEFAULT 0,
CONSTRAINT CONSTRAINT_1 CHECK (callrec in (0,1))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci |
±---------±----------------------------------------------------------------------------------------+


> app_queue: UnpauseQueueMember generate generating string invalid in lastapp and lastdata
> ----------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-30413
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30413
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_adsiprog
>    Affects Versions: 18.15.0
>         Environment: Debian 11
> Asterisk 18.15.0
> Function UnpauseQueueMember()
>            Reporter: Luiz Rogério dos Santos
>            Assignee: Luiz Rogério dos Santos
>
> After posting to the community, I was asked to create this issue.
> As this is the first time, I apologize if this is not the case.
> Afert hangup agent loged current error.
> {noformat}
> same => n,UnpauseQueueMember(,Local/3000 at agent)
> {noformat}
> I made several changes to test in the odbc driver and also in the database for utf8mb4 and for utf8, I didn’t get any results, I did a log collection, the problem always occurs when I finish the camal call with a logged in agent, thus generating the variable lastdata and lastapp with strange characters.
> >>>>>>. Debug full log asterisk <<<<<<
> {noformat}
> [2023-02-01 14:59:26] DEBUG[292578] res_odbc.c: Reusing ODBC handle 0x7f75f8149bb0 from class ‘asterisk’
> [2023-02-01 14:59:26] DEBUG[292578] res_config_odbc.c: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
> [2023-02-01 14:59:26] WARNING[292586] res_odbc.c: SQL Execute returned an error: 22007: [ma-3.1.9][10.5.18-MariaDB-0+deb11u1-log]Incorrect string value: ‘\xDFv0v\007F’ for column asterisk.cdr.lastapp at row 1
> [2023-02-01 14:59:26] WARNING[292586] res_odbc.c: SQL Execute error -1!
> [2023-02-01 14:59:26] WARNING[292586] cdr_adaptive_odbc.c: cdr_adaptive_odbc: Insert failed on ‘asterisk:cdr’. CDR failed: INSERT INTO cdr (calldate, answer, end, src, dst, dcontext, channel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, linkedid, sequence, callrec) VALUES ({ ts ‘2023-02-01 14:57:43’ }, { ts ‘2023-02-01 14:57:47’ }, { ts ‘2023-02-01 14:59:26’ }, ‘8000’, ‘h’, ‘APPLICATION-20’, ‘PJSIP/8000-00000006’, ‘x�v0v’, ‘p�v0v’, 102, 99, ‘ANSWERED’, 3, ‘8000’, ‘1675274263.18’, ‘1675274263.18’, 6, 1)
> [2023-02-01 14:59:26] DEBUG[292586] res_odbc.c: Releasing ODBC handle 0x7f75f8168940 into pool
> [2023-02-01 14:59:26] DEBUG[292586] stasis.c: Creating topic. name: channel:1675274366.19, detail:
> [2023-02-01 14:59:26] DEBUG[292586] stasis.c: Topic ‘channel:1675274366.19’: 0x7f75d80154e0 created
> [2023-02-01 14:59:26] DEBUG[292578] res_config_odbc.c: Parameter 1 (‘id’) = ‘8000’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(start) result is ‘2023-02-01 14:57:43’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(clid) result is ‘“8000 pjsip” <8000>’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(dcontext) result is ‘APPLICATION-20’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(channel) result is ‘PJSIP/8000-00000006’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(dstchannel) result is ‘’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(lastapp) result is ‘x�v0v’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(lastdata) result is ‘p�v0v’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(duration,f) result is ‘102.940045’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(billsec,f) result is ‘99.203213’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(disposition) result is ‘ANSWERED’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(amaflags) result is ‘DOCUMENTATION’
> [2023-02-01 14:59:26] DEBUG[292586] pbx_variables.c: Function CDR(accountcode) result is ‘8000’
> {noformat}
> <<<<<< Debug verbose CLI >>>>>
> {noformat}
> Executing [s at gosub-endagentlogin:5] MYSQL(“PJSIP/8000-00000007”, “Disconnect 1”) in new stack
> – Executing [s at gosub-endagentlogin:6] UnpauseQueueMember(“PJSIP/8000-00000007”, “,Local/1999 at queue_agents”) in new stack
> – Executing [s at gosub-endagentlogin:7] Return(“PJSIP/8000-00000007”, “”) in new stack
> 0x7f75d80214d0 - Transitioning CDR for PJSIP/8000-00000007 from state Single to Finalized
> 0x7f75d80214d0 - Beginning finalize/dispatch for PJSIP/8000-00000007
> 0x7f75d80214d0 - Dispatching CDR for Party A PJSIP/8000-00000007, Party B
> [2023-02-01 15:05:48] WARNING[292586]: res_odbc.c:529 ast_odbc_print_errors: SQL Execute returned an error: 22007: [ma-3.1.9][10.5.18-MariaDB-0+deb11u1-log]Incorrect string value: ‘\xDFv0v\007F’ for column asterisk.cdr.lastapp at row 1
> [2023-02-01 15:05:48] WARNING[292586]: res_odbc.c:424 ast_odbc_prepare_and_execute: SQL Execute error -1!
> [2023-02-01 15:05:48] WARNING[292586]: cdr_adaptive_odbc.c:766 odbc_log: cdr_adaptive_odbc: Insert failed on ‘asterisk:cdr’. CDR failed: INSERT INTO cdr (calldate, answer, end, src, dst, dcontext, channel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, linkedid, sequence, callrec) VALUES ({ ts ‘2023-02-01 15:03:21’ }, { ts ‘2023-02-01 15:03:26’ }, { ts ‘2023-02-01 15:05:48’ }, ‘8000’, ‘h’, ‘APPLICATION-20’, ‘PJSIP/8000-00000007’, ‘x�v0v’, ‘p�v0v’, 146, 141, ‘ANSWERED’, 3, ‘8000’, ‘1675274601.21’, ‘1675274601.21’, 7, 1)
> {noformat}
> <<<< File /etc/odbc.ini >>>>
> {noformat}
> [asterisk]
> Driver = MariaDB
> Description = MariaDB connection to database
> Server = 127.0.0.1
> Port = 3306
> Database = asterisk
> UserName = asterisk
> Password = xxxxxxxx
> Socket = /var/run/mysqld/mysqld.sock
> CharSet = UTF8
> {noformat}
> <<<<< File /etc/odbcinst.ini >>>>>
> {noformat}
> [MariaDB]
> Driver=libmaodbc.so
> Description=MariaDB Connector/ODBC(Unicode)
> Threading=0
> UsageCount=2
> {noformat}
> <<<< Mariadb Server version: 10.5.18-MariaDB-0+deb11u1-log Debian 11 >>>
> {noformat}
> show variables like ‘%coll%’;
> ±---------------------±----------------+
> | Variable_name | Value |
> ±---------------------±----------------+
> | collation_connection | utf8_general_ci |
> | collation_database | utf8_general_ci |
> | collation_server | utf8_general_ci |
> ±---------------------±----------------+
> show variables like ‘%cha%’;
> ±------------------------------±---------------------------+
> | Variable_name | Value |
> ±------------------------------±---------------------------+
> | character_set_client | utf8 |
> | character_set_connection | utf8 |
> | character_set_database | utf8 |
> | character_set_filesystem | binary |
> | character_set_results | utf8 |
> | character_set_server | utf8 |
> | character_set_system | utf8 |
> | character_sets_dir | /usr/share/mysql/charsets/ |
> | innodb_change_buffer_max_size | 25 |
> | innodb_change_buffering | none |
> | session_track_state_change | OFF |
> show create database asterisk;
> ±---------±----------------------------------------------------------------------------------------+
> | Database | Create Database |
> ±---------±----------------------------------------------------------------------------------------+
> | asterisk | CREATE DATABASE asterisk /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci */ |
> show create table cdr;
> | cdr | CREATE TABLE cdr (
> calldate datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
> answer datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
> end datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
> clid varchar(80) NOT NULL DEFAULT ‘’,
> src varchar(80) NOT NULL DEFAULT ‘’,
> dst varchar(80) NOT NULL DEFAULT ‘’,
> dcontext varchar(80) NOT NULL DEFAULT ‘’,
> channel varchar(80) NOT NULL DEFAULT ‘’,
> dstchannel varchar(80) NOT NULL DEFAULT ‘’,
> lastapp varchar(80) DEFAULT NULL,
> lastdata varchar(80) NOT NULL DEFAULT ‘’,
> duration int(10) unsigned NOT NULL DEFAULT 0,
> billsec int(10) unsigned NOT NULL DEFAULT 0,
> disposition varchar(45) NOT NULL DEFAULT ‘’,
> amaflags int(4) unsigned NOT NULL DEFAULT 0,
> accountcode varchar(80) DEFAULT NULL,
> userfield varchar(255) NOT NULL DEFAULT ‘’,
> uniqueid varchar(32) NOT NULL DEFAULT ‘’,
> linkedid varchar(32) NOT NULL,
> sequence int(10) unsigned NOT NULL,
> peeraccount varchar(80) DEFAULT ‘’,
> callednum varchar(80) DEFAULT NULL,
> carrier varchar(25) DEFAULT NULL,
> callrec tinyint(1) DEFAULT NULL,
> callfile varchar(150) DEFAULT NULL,
> calltype enum(‘in’,‘out’,‘ext’,‘inApp’,‘outApp’,‘transit’) DEFAULT NULL,
> sip_out_ip varchar(15) DEFAULT ‘’,
> sip_out_useragent varchar(255) DEFAULT ‘’,
> hangupcause int(10) unsigned DEFAULT 0,
> CONSTRAINT CONSTRAINT_1 CHECK (callrec in (0,1))
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci |
> ±---------±----------------------------------------------------------------------------------------+
> {noformat}



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



More information about the asterisk-bugs mailing list