[asterisk-bugs] [JIRA] (ASTERISK-23046) Custom CDR fields set during a GoSUB called from app_queue are not inserted

Rusty Newton (JIRA) noreply at issues.asterisk.org
Tue Jan 21 21:11:03 CST 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=214286#comment-214286 ] 

Rusty Newton commented on ASTERISK-23046:
-----------------------------------------

It looks like with both cdr_csv and cdr_custom you can set the CDR variable userfield on both Party A and Party B and it will store both values for the field (semi-colon-delimited), like: "ISetThisOnTheCALLINGChannel;ISetThisOnTheCalledChannel"

{noformat}
"","6002","602","from-internal","""6002"" <6002>","SIP/6002-00000013","SIP/6001-00000014","Queue","support,,,,30,,my-queue-macro","2014-01-22 01:16:13","2014-01-22 01:16:15","2014-01-22 01:16:17",3,1,"ANSWERED","DOCUMENTATION","1390353373.28","ISetThisOnTheCALLINGChannel;ISetThisOnTheCalledChannel"
{noformat}

With cdr_custom, in Asterisk 12, if you set newly defined custom fields on Party A and Party B, they'll both show up on the CDR record printed to Master.csv if the mapping includes those fields in cdr_custom.conf. like:

{noformat}
"""6002"" <6002>","6002","602","from-internal","SIP/6002-00000023","SIP/6001-00000024","Queue","support,,,,30,,,submytest","2014-01-21 19:50:50","2014-01-21 19:50:51","2014-01-21 19:50:52","1","0","ANSWERED","DOCUMENTATION","","1390355450.52",";ISetThisOnTheCalledChannel",35,"something1","something2"
{noformat}

The field holding something1 was set before the macro or gosub was called, and something2 was set after. That is, something1 was set on the calling channel and something2 set on the called channel.

I'm not sure why they are not working in Denis' INSERT. 


@Denis, what database backend and CDR connector module are you using?

Are the custom fields printing to your file defined in cdr_custom.conf correctly?

                
> Custom CDR fields set during a GoSUB called from app_queue are not inserted
> ---------------------------------------------------------------------------
>
>                 Key: ASTERISK-23046
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23046
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/cdr_custom, CDR/General
>    Affects Versions: 11.7.0
>         Environment: CentOS 6.5, MySQL
>            Reporter: Denis Pantsyrev
>            Severity: Minor
>
> When I use the dialplan below, the additional field "mambo" and standard field "userfield" are filled with data, but additional field "userfield2" is not!
> All additional fields are present in DB. Not only "userfield2" is not filled with data, but all additional fields in GoSUB context.
> Dialplan I used:
> {noformat}
> [test]
> exten => 400,1,Answer
>  same => n,Set(CDR(mambo)=Mambo)
>  same => n,Queue(test,,,,,,,subEtt)
>  same => n,Hangup
> [subEtt]
> exten => s,1,Set(CDR(userfield)=Field_1)
>  same => n,NoOP(${CDR(userfield)})
>  same => n,Set(CDR(userfield2)=Field_2)
>  same => n,NoOP(${CDR(userfield2)})
>  same => n,Return()
> {noformat} 
> My logs show:
> {noformat}
> testpc*CLI> core set verbose 9
> Set remote console verbosity to 9
>   == Using SIP RTP CoS mark 5
>     -- Executing [400 at test:1] Answer("SIP/333-00000004", "") in new stack
>        > 0x7f320801cb50 -- Probation passed - setting RTP source address to 192.168.1.49:4008
> -- Executing [400 at test:2] Set("SIP/333-00000004", "CDR(mambo)=Mambo") in new stack
> -- Executing [400 at test:3] Queue("SIP/333-00000004", "test,,,,,,,subEtt") in new stack
>     -- Started music on hold, class 'default', on SIP/333-00000004
>   == Using SIP RTP CoS mark 5
>     -- SIP/333-00000005 is ringing
>     -- SIP/333-00000005 answered SIP/333-00000004
>     -- Stopped music on hold on SIP/333-00000004
>     -- SIP/333-00000005 Internal Gosub(subEtt,s,1) start
>     -- Executing [s at subEtt:1] Set("SIP/333-00000005", "CDR(userfield)=Field_1") in new stack
>     -- Executing [s at subEtt:2] NoOp("SIP/333-00000005", "Field_1") in new stack
>     -- Executing [s at subEtt:3] Set("SIP/333-00000005", "CDR(userfield2)=Field_2") in new stack
>     -- Executing [s at subEtt:4] NoOp("SIP/333-00000005", "Field_2") in new stack
>     -- Executing [s at subEtt:5] Return("SIP/333-00000005", "") in new stack
>   == Spawn extension (test, 400, 1) exited non-zero on 'SIP/333-00000005'
>     -- SIP/333-00000005 Internal Gosub(subEtt,s,1) complete GOSUB_RETVAL=
>     -- Remotely bridging SIP/333-00000004 and SIP/333-00000005
>        > [INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,userfield,mambo,uniqueid,linkedid,sequence) VALUES ({ ts '2013-12-18 09:03:50' },'"333" <333>','333','400','test','SIP/333-00000004','SIP/333-00000005','Queue','test,,,,,,,subEtt',1,1,'ANSWERED',3,'Field_1','Mambo','1387343030.4','1387343030.4','6')]
>   == Spawn extension (test, 400, 3) exited non-zero on 'SIP/333-00000004'
> {noformat} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list