Summary: | ASTERISK-09017: CDR variables are not used correctly after a FORKCDR | ||
Reporter: | Loic Didelot (voipgate) | Labels: | |
Date Opened: | 2007-03-15 04:19:43 | Date Closed: | 2011-06-07 14:03:20 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | A ForkCDR should duplicate the cdr record but after a fork reads and write to cdr variables (accountcode, userfield) should only apply to the seconde, duplicated cdr record. WRITE acctions are applied correctly. But trying to read a cdr variable after having changed them after a forkcdr gives out the value of the first record. This is not correct. So the problem appears when using a CDR variable which has been changed after a ForkCDR. ****** ADDITIONAL INFORMATION ****** Test dialplan: [ Context 'CUSTOMER' created by 'pbx_config' ] 'test' => 1. Set(CDR(accountcode)=account-before-fork) [pbx_config] 2. Set(CDR(userfield)=userfield-before-fork) [pbx_config] 3. ForkCDR() [pbx_config] 4. NOOP(Accountcode ${CDR(accountcode)}) [pbx_config] 5. NOOP(Userfield ${CDR(userfield)}) [pbx_config] 6. Set(CDR(accountcode)=account-after-fork) [pbx_config] 7. Set(CDR(userfield)=userfield-after-fork) [pbx_config] 8. NOOP(Accountcode ${CDR(accountcode)}) [pbx_config] 9. NOOP(Userfield ${CDR(userfield)}) [pbx_config] CLI output: -- Executing [test@CUSTOMER:1] Set("IAX2/ldidelot-2", "CDR(accountcode)=account-before-fork") in new stack -- Executing [test@CUSTOMER:2] Set("IAX2/ldidelot-2", "CDR(userfield)=userfield-before-fork") in new stack -- Executing [test@CUSTOMER:3] ForkCDR("IAX2/ldidelot-2", "") in new stack -- Executing [test@CUSTOMER:4] NoOp("IAX2/ldidelot-2", "Accountcode account-before-fork") in new stack -- Executing [test@CUSTOMER:5] NoOp("IAX2/ldidelot-2", "Userfield userfield-before-fork") in new stack -- Executing [test@CUSTOMER:6] Set("IAX2/ldidelot-2", "CDR(accountcode)=account-after-fork") in new stack -- Executing [test@CUSTOMER:7] Set("IAX2/ldidelot-2", "CDR(userfield)=userfield-after-fork") in new stack -- Executing [test@CUSTOMER:8] NoOp("IAX2/ldidelot-2", "Accountcode account-before-fork") in new stack -- Executing [test@CUSTOMER:9] NoOp("IAX2/ldidelot-2", "Userfield userfield-before-fork") in new stack So as you see the last NOOP's on priority 8 and 9 should output userfield-after-fork and account-after-fork. But they do not | ||
Comments: | By: Loic Didelot (voipgate) 2007-03-15 04:30:49 I reported this bug months ago and it had been fixed. But now it reappears: http://bugs.digium.com/view.php?id=7689 By: Serge Vecher (serge-v) 2007-03-15 08:42:15 voipgate: you've been around a while to know that one needs to reopen the issue if it reappears instead of reporting a new one. Please do that in the future. Thanks. By: Joshua C. Colp (jcolp) 2007-03-15 08:46:04 What branch of Asterisk? If trunk are you using the option I described in 7689? Was this working earlier? By: Loic Didelot (voipgate) 2007-03-15 08:47:13 Im on 1.4. By: Joshua C. Colp (jcolp) 2007-03-15 09:16:57 Use the l option when reading the data in, it will pull the last record instead of the first. Example: NOOP(Userfield ${CDR(userfield|l)}) Note the |l - this works in my testing. By: Loic Didelot (voipgate) 2007-03-15 09:25:48 Oooh man I feel really sorry. It works in 1.4. Thanks. By: Joshua C. Colp (jcolp) 2007-03-15 09:26:54 Configuration issue. Kaboom! |