[Home]

Summary:ASTERISK-27167: No data in custom cdr field in database when it set via Gosub
Reporter:Denis Pantsyrev (StuxForce)Labels:
Date Opened:2017-08-01 07:16:38Date Closed:2017-08-09 09:32:37
Priority:MinorRegression?
Status:Closed/CompleteComponents:CDR/cdr_adaptive_odbc
Versions:11.25.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 7 (3.10.0-514.16.1.el7.x86_64)Attachments:( 0) debug_v9_d9.txt
( 1) debug.txt
Description:I have dialplan below. Phone 7777 call to 8888, 8888 answer.
At the moment of the answer the subAnswer is executed, but there is no data in cdr field "cstfld" while in "userfield" it presense. Debug file in attach below.

{code:title=sip.conf|borderStyle=solid}
[7777]
type=friend
host=dynamic
secret=7777
context=buh
callerid="ExtUser" <7777>

[8888]
type=friend
host=dynamic
secret=8888
context=ato
callerid="OneUser" <8888>
{code}
{code:title=extensions.conf|borderStyle=solid}
[buh]
exten => h,1,NoOP
exten => _XXXX,1,NoOP
same => n,Dial(SIP/${EXTEN},20,tirU(subAnswer))
same => n,Hangup

[ato]
include => buh

[subAnswer]
exten => s,1,NoOP
same => n,Set(CDR(userfield)=${CDR(userfield)}:${CALLERID(num)})
same => n,Set(CDR(cstfld)=${CDR(cstfld)}:${CALLERID(num)})
same => n,Return()
{code}
{code:title=cdr_adaptive_odbc.conf|borderStyle=solid}
[first]
connection=asterisk
table=cdr
alias start => calldate
{code}
{code:title=res_odbc.conf|borderStyle=solid}
[asterisk]
enabled => yes
dsn => asterisk-connector
username => asterisk
password => Pa$$w0rd
pre-connect => yes
idlecheck => 3600
{code}
{code:title=database|borderStyle=solid}
CREATE TABLE `cdr` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`calldate` 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) NOT NULL DEFAULT '',
`lastdata` VARCHAR(80) NOT NULL DEFAULT '',
`duration` INT(11) NOT NULL DEFAULT '0',
`billsec` INT(11) NOT NULL DEFAULT '0',
`disposition` VARCHAR(45) NOT NULL DEFAULT '',
`amaflags` INT(11) NOT NULL DEFAULT '0',
`accountcode` VARCHAR(20) NOT NULL DEFAULT '',
`userfield` VARCHAR(255) NOT NULL DEFAULT '',
`uniqueid` VARCHAR(32) NOT NULL DEFAULT '',
`linkedid` VARCHAR(32) NOT NULL DEFAULT '',
`sequence` VARCHAR(32) NOT NULL DEFAULT '',
`peeraccount` VARCHAR(32) NOT NULL DEFAULT '',
`cstfld` VARCHAR(1024) NOT NULL,
PRIMARY KEY (`id`),
INDEX `calldate` (`calldate`),
INDEX `channel` (`channel`),
INDEX `dst` (`dst`),
INDEX `accountcode` (`accountcode`),
INDEX `uniqueid` (`uniqueid`),
INDEX `userfield` (`userfield`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
{code}

But these code works fine:
{code:title=extensions.conf|borderStyle=solid}
[buh]
exten => h,1,NoOP
exten => _XXXX,1,NoOP
same => n,Set(CDR(cstfld)=${CDR(cstfld)}:${CALLERID(num)})
same => n,Dial(SIP/${EXTEN},20,tirU(subAnswer))
same => n,Hangup
{code}
Comments:By: Asterisk Team (asteriskteam) 2017-08-01 07:16:40.442-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Denis Pantsyrev (StuxForce) 2017-08-01 07:23:15.678-0500

Debug for ASTERISK-27167

By: Rusty Newton (rnewton) 2017-08-02 16:36:15.413-0500

What logging levels did you have enabled along with DEBUG?

Can you capture another log with warning,error,notice,verbose,debug, both verbose and debug each turned up to 5 or above?

Thanks!

By: Denis Pantsyrev (StuxForce) 2017-08-03 01:02:15.139-0500

bq. What logging levels did you have enabled along with DEBUG?
I used debug level turned up to 9 (core set debug 9, console => warning,error,notice,debug)

New log (console => warning,error,notice,verbose,debug) with debug and verbose levels turned up to 9 in attached file (debug_v9_d9.txt)

Thanks!

By: Benjamin Keith Ford (bford) 2017-08-08 13:35:45.927-0500

[~StuxForce], I've tested both scenarios and can see the cstfld being populated. I see that you also created this issue ASTERISK-27183 - I've tested both scenarios there as well and get the same results as you. Before moving forward with that issue (since these two are similar), is this one (ASTERISK-27167) still not working for you?

By: Denis Pantsyrev (StuxForce) 2017-08-09 04:13:23.827-0500

[~bford], I'm using asterisk 11 in production, but i saw that its EOL in 2 months. So I start planing migration to 13 branch. I saw that in 13 branch its really the cstfld field is being populated, but something strange. So I was create this issue ASTERISK-27183
I think that you can close this issue (ASTERISK-27167) and work with (ASTERISK-27183)
Thanks!

By: Benjamin Keith Ford (bford) 2017-08-09 09:32:17.023-0500

Thanks Denis. I'm going to close this issue out and we will work with the other two issues you have reported since the root cause seems to be the same.