[asterisk-bugs] [JIRA] (ASTERISK-27167) No data in custom cdr field in database when it set via Gosub

Denis Pantsyrev (JIRA) noreply at issues.asterisk.org
Tue Aug 1 07:32:57 CDT 2017


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

Denis Pantsyrev updated ASTERISK-27167:
---------------------------------------

    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}

  was:
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}


> No data in custom cdr field in database when it set via Gosub
> -------------------------------------------------------------
>
>                 Key: ASTERISK-27167
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27167
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/cdr_adaptive_odbc
>    Affects Versions: 11.25.1
>         Environment: CentOS 7 (3.10.0-514.16.1.el7.x86_64)
>            Reporter: Denis Pantsyrev
>            Severity: Minor
>         Attachments: debug.txt
>
>
> 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}



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



More information about the asterisk-bugs mailing list