I am trying to save cdr data in database. But not saving destination number. because I have 10 destination number and I need to identify destination number.
This is my CLI showed log information
-- Executing [s@dmse_IVR:7] Set("PJSIP/registrar-00000000", "DESTINATION_NUMBER=0112xxxxx") in new stack
-- Executing [s@dmse_IVR:8] Set("PJSIP/registrar-00000000", "ODBC_WRITE("773xxxxx" <0773xxxxx>, 0773xxxxx, '0112xxxxx', dmse_IVR, PJSIP/registrar-00000000, , Set, DESTINATION_NUMBER=0112xxxxx, 0, 0, NO ANSWER, DOCUMENTATION, , 1709636250.0, 1709636250.0, )") in new stack
[Mar 5 16:27:30] WARNING[35023][C-00000001]: pbx_variables.c:1164 pbx_builtin_setvar: Please avoid unnecessary spaces on variables as it may lead to unexpected results ('ODBC_WRITE("773xxxxx" <0773xxxxx>, 0773xxxxx, '0112xxxxx', dmse_IVR, PJSIP/registrar-00000000, , Set, DESTINATION_NUMBER' set to '0112xxxxx, 0, 0, NO ANSWER, DOCUMENTATION, , 1709636250.0, 1709636250.0, )').
And this is my Extension code
; Use DIALED_NUMBER directly to set DESTINATION_NUMBER
same => n,Set(DESTINATION_NUMBER=${DIALED_NUMBER})
; Insert call details into the database including the destination number
same => n,Set(ODBC_WRITE(${CDR(clid)}, ${CDR(src)}, '${DESTINATION_NUMBER}', ${CDR(dcontext)}, ${CDR(channel)}, ${CDR(dstchannel)}, ${CDR(lastapp)}, ${CDR(lastdata)}, ${CDR(duration)}, ${CDR(billsec)}, ${CDR(disposition)}, ${CDR(amaflags)}, ${CDR(accountcode)}, ${CDR(uniqueid)}, ${CDR(linkedid)}, ${CDR(userfield)}))
But my database stored following data only
| 129 | 2024-03-05 16:27:30 | "773xxxxx" <0773xxxxx> | 0773xxxxx | s | NULL | testing | PJSIP/registrar-00000000 | NULL | BackGround | welcomedmse | 12 | 12 | ANSWERED | 3 | NULL | 1709636250.0 | NULL | 1709636250.0 |
| 130 | 2024-03-05 16:27:30 | "773xxxxx" <0773xxxxx> | 0773xxxxx | s | NULL | testing | PJSIP/registrar-00000000 | | BackGround | welcomedmse | 12 | 12 | ANSWERED | 3 | | NULL | | 1709636250.0 |
+-----+---------------------+--------------------------+---------------+---------------+--------------------+----------------------+--------------------------+------------------------+---------------+-------------------------------------------------+----------+---------+-------------------+----------+-------------------+---------------+----------------------------+----------------+
and this is my cdr table description
MariaDB [asterisk]> desc cdr;
+--------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| calldate | datetime | YES | | NULL | |
| clid | varchar(80) | YES | | NULL | |
| src | varchar(80) | YES | | NULL | |
| dst | varchar(80) | YES | | NULL | |
| destination_number | varchar(80) | YES | | NULL | |
| dcontext | varchar(80) | YES | | NULL | |
| channel | varchar(80) | YES | | NULL | |
| dstchannel | varchar(80) | YES | | NULL | |
| lastapp | varchar(80) | YES | | NULL | |
| lastdata | varchar(80) | YES | | NULL | |
| duration | int(11) | YES | | NULL | |
| billsec | int(11) | YES | | NULL | |
| disposition | varchar(45) | YES | | NULL | |
| amaflags | int(11) | YES | | NULL | |
| accountcode | varchar(20) | YES | | NULL | |
| linkedid | varchar(32) | YES | | NULL | |
| userfield | varchar(255) | YES | | NULL | |
| uniqueid | varchar(32) | YES | | NULL | |
+--------------------+--------------+------+-----+---------+----------------+
how fix this issue???