[Home]

Summary:ASTERISK-18875: CDR logs doesn't take care of CDR(dest) variable
Reporter:tootai (tootai)Labels:
Date Opened:2011-11-16 04:27:11.000-0600Date Closed:2011-12-30 14:28:54.000-0600
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Applications/app_cdr
Versions:1.8.7.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Linux Ubuntu Server LTS 10.4 Asterisk from packages.asterisk.org/deb No telephony cardAttachments:
Description:Setting variable CDR(dest) doesn't do the job in CDR logs which still stays with original value.

Sample for France:

exten => s,1,Set(CDR(dest)=33123456789) ;CDR in International form
exten => s,n,Dial(SIP/myGW/0123456789)  ;Number in local form

In CDR we will find 0123456789 (local form) insteed of international one. In Asterisk 1.4 or 1.6 it's working perfectly.
Comments:By: Matt Jordan (mjordan) 2011-11-16 14:06:59.896-0600

The CDR destination variable is 'dst', not 'dest'.  See https://wiki.asterisk.org/wiki/display/AST/Function_CDR for a listing of all of the CDR variables supported by the CDR function.  If this was simply a typo and the variable is 'dst' in the CDR function, please us know.

By: tootai (tootai) 2011-11-17 02:49:12.312-0600

It's not a typo, that's the command we use in 1.4 or 1.6 Asterisk version. CDR(dst) is a read only variable, at least in 1.8

By: Matt Jordan (mjordan) 2011-11-17 08:48:01.199-0600

Thanks for the clarification.

By: Matt Jordan (mjordan) 2011-12-16 11:07:53.942-0600

I'm having reproducing the problem in the latest 1.8 branch.  I'm using the following dialplan:

exten => _7XXX,hint,${ext${EXTEN}}
same => 1,NoOp()
same => n,Set(CDR(dest)=1${EXTEN})
same => n,Dial(SIP/${EXTEN},10,tT)
same => n,VoiceMail(${EXTEN}@default,u)
same => n,Hangup()

In cdr_custom.conf, I've configured it to use a column of dest (instead of dst, in this case):

[mappings]
Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dest)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration)})},${CSV_QUOTE(${CDR(billsec)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)}

When dialing 7001, this logs 17001 to the CSV, as expected:

"7003" <7003>,"7003","17001","LocalSets","SIP/7003-00000001","","VoiceMail","7001@default,u","2011-12-16 (etc.)

What CDR backend are you using?  How has the CDR backend been configured?

By: Matt Jordan (mjordan) 2011-12-30 14:28:54.652-0600

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested. Further information can be found at http://www.asterisk.org/developers/bug-guidelines