[Home]

Summary:ASTERISK-19407: Set CDR variable ignored on record created after after ForkCDR
Reporter:Private Name (falves11)Labels:
Date Opened:2012-02-20 11:34:36.000-0600Date Closed:2013-09-23 21:23:29
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_cdr
Versions:1.8.9.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:RHEL 6.2Attachments:( 0) asterisk-bug.txt
Description:I added some extra fields to my CDR table, and it does work when Asterisk starts, for instance , If I do a "Set(CDR(myfield)=XX)", and then I do a ResetCDR(w), it does insert the extra information correctly. However, if I do ForkCDR(e), then  any "Set(CDR(myfield)=XX)" followed by ResetCDR(w) after that will ignore the extra fields to the table. This is wrong, since we need a new record, but using with the current table definition.
This happens regarding the driver used. I tested with cdr_odbc, cdr_mysql and cdr_adaptive_odbc. So it is a core issue.
Comments:By: Private Name (falves11) 2012-02-20 11:47:36.545-0600

This is the proof, and I tried ForkCDR(), ForkCDR(e), ForkCDR(v), etc. The new field is called "codclient". As you can see, after the ForkCDR, I do set the CDR(codclient) value again, but it is ignored when the SQL command is executed.

-- Executing [17274907253@sipserver:3] Set("SIP/208.78.160.44-0000000c", "CDR(codclient)=99") in new stack
[Feb 20 12:45:03] DEBUG[32117]: pbx.c:4230 pbx_extension_helper: Launching 'ResetCDR'
   -- Executing [17274907253@sipserver:4] ResetCDR("SIP/208.78.160.44-0000000c", "w") in new stack
[Feb 20 12:45:03] DEBUG[32117]: cdr_mysql.c:339 mysql_log: Inserting a CDR record.
[Feb 20 12:45:03] DEBUG[32117]: cdr_mysql.c:342 mysql_log: SQL command as follows: INSERT INTO cdr (`calldate`,`src`,`dst`,`duration`,`billsec`,`disposition`,`amaflags`,`uniqueid`,`codclient`) VALUES ('2012-02-20 12:45:03','7274907253','17274907253','0','0','ANSWERED','3','PPD-1329759903.12','99')
      > [INSERT INTO cdr (calldate,src,dst,duration,billsec,disposition,amaflags,uniqueid,codclient) VALUES ({ ts '2012-02-20 12:45:03' },'7274907253','17274907253',0,0,'ANSWERED',3,'PPD-1329759903.12',99)]
[Feb 20 12:45:03] DEBUG[32117]: res_odbc.c:1036 odbc_release_obj2: odbc_release_obj2(0x839d58) called (obj->txf = (nil))
[Feb 20 12:45:03] DEBUG[32117]: pbx.c:4230 pbx_extension_helper: Launching 'ForkCDR'
   -- Executing [17274907253@sipserver:5] ForkCDR("SIP/208.78.160.44-0000000c", "e") in new stack
[Feb 20 12:45:03] DEBUG[32117]: pbx.c:4230 pbx_extension_helper: Launching 'Set'
   -- Executing [17274907253@sipserver:6] Set("SIP/208.78.160.44-0000000c", "CDR(codclient)=100") in new stack
[Feb 20 12:45:03] DEBUG[32117]: pbx.c:4230 pbx_extension_helper: Launching 'ResetCDR'
   -- Executing [17274907253@sipserver:7] ResetCDR("SIP/208.78.160.44-0000000c", "w") in new stack
      > [INSERT INTO cdr (calldate,src,dst,duration,billsec,disposition,amaflags,uniqueid) VALUES ({ ts '2012-02-20 12:45:03' },'7274907253','17274907253',0,0,'NO ANSWER',3,'PPD-1329759903.12')]
[Feb 20 12:45:03] DEBUG[32117]: res_odbc.c:1036 odbc_release_obj2: odbc_release_obj2(0x839d58) called (obj->txf = (nil))
[Feb 20 12:45:03] DEBUG[32117]: pbx.c:4230 pbx_extension_helper: Launching 'Hangup'
   -- Executing [17274907253@sipserver:8] Hangup("SIP/208.78.160.44-0000000c", "") in new stack


By: Matt Jordan (mjordan) 2012-02-20 17:07:59.589-0600

Rather then having it inline in the comments, can you attach the DEBUG log illustrating the issue?  The log should illustrate all portions of the dialplan that led up to this occurring.

By: Private Name (falves11) 2012-02-20 17:13:55.785-0600

As requested.

By: Frederic Van Espen (frederic.ve) 2012-12-20 10:30:57.691-0600

We are encountering this issue as well on the latest release of asterisk: 1.8.19.0

By: Private Name (falves11) 2013-09-23 21:23:29.815-0500

Closed due to giving up