[asterisk-bugs] [JIRA] (ASTERISK-25596) CDR engine dispatching 2 cdrs - one for PartyA and another combined PartyA-PartyB

Pedro Guillem (JIRA) noreply at issues.asterisk.org
Tue Dec 1 02:10:33 CST 2015


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

Pedro Guillem edited comment on ASTERISK-25596 at 12/1/15 2:10 AM:
-------------------------------------------------------------------

As always, Thanks for the prompt reply!.
I will carefully study the link, but a separate CDR for PartyA alone should not be created if the call was connected..  :/


Here is the dialplan (quite simple):

[general]
static=yes
writeprotect=yes

[0]
include => default

[default]
exten => _X.,1,verbose(-----------NORMAL CALL-----------)
include => processcall_normal

[processcall_normal]
exten => _X.,2,Set(PEERIP=${CHANNEL(peerip)})
exten => _X.,n,Set(RECVIP=${CHANNEL(recvip)})

exten => _X.,n,AGI(configurecall.php) ;This script creates some channel variables (routing).. depending on incoming ext and IP

exten => _X.,n,Set(LANGUAGE=ES)
exten => _X.,n,GotoIf($["${ROUTE/size}" = ""]?nobalance)
exten => _X.,n,Set(ROUTE/i=1)

exten => _X.,n,Verbose(--------------------------------------------------)
exten => _X.,n(while),GotoIf($["${ROUTE/size}" < "${ROUTE/i}"]?error) ; Loop trough configured  routes
exten => _X.,n,Verbose(Route ${ROUTE/i}: ${ROUTE/${ROUTE/i}})

;Set custom billing stuff on accountcode field
exten => _X.,n(dial),Set(CHANNEL(accountcode)=${ACC_NO}|${DST/${ROUTE/i}}|LCR|${CARRIER/${ROUTE/i}}|${CALLERID(ani)}|N)
exten => _X.,n(dial),Set(CHANNEL(amaflags)=2)
exten => _X.,n(dial),Set(CHANNEL(clid)=${CALLERID(ani)})
exten => _X.,n(dial),Set(CALLERID(num)=${NEWCID})

exten => _X.,n,Progress()
exten => _X.,n,Set(TIMEOUT(absolute)=3600)
exten => _X.,n,Dial(${ROUTE/${ROUTE/i}},60,g)

;Handle all possible scenarios after dial attempt
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?noanswer)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?fin)
exten => _X.,n,Goto(tryagain)

;Loop to next route
exten => _X.,dial+101(tryagain),Set(ROUTE/i=$[${ROUTE/i} + 1])
exten => _X.,n,Goto(while)      

exten => _X.,n(error),Congestion
exten => _X.,n(fin),HangUp
exten => _X.,n(noanswer),Busy

exten => _X.,n,HangUp


was (Author: pguillem):
As always, Thanks for the prompt reply!.
I will carefully study the link, but a separate CDR for PartyA alone should not be created..  :/


Here is the dialplan (quite simple):

[general]
static=yes
writeprotect=yes

[0]
include => default

[default]
exten => _X.,1,verbose(-----------NORMAL CALL-----------)
include => processcall_normal

[processcall_normal]
exten => _X.,2,Set(PEERIP=${CHANNEL(peerip)})
exten => _X.,n,Set(RECVIP=${CHANNEL(recvip)})

exten => _X.,n,AGI(configurecall.php) ;This script creates some channel variables (routing).. depending on incoming ext and IP

exten => _X.,n,Set(LANGUAGE=ES)
exten => _X.,n,GotoIf($["${ROUTE/size}" = ""]?nobalance)
exten => _X.,n,Set(ROUTE/i=1)

exten => _X.,n,Verbose(--------------------------------------------------)
exten => _X.,n(while),GotoIf($["${ROUTE/size}" < "${ROUTE/i}"]?error) ; Loop trough configured  routes
exten => _X.,n,Verbose(Route ${ROUTE/i}: ${ROUTE/${ROUTE/i}})

;Set custom billing stuff on accountcode field
exten => _X.,n(dial),Set(CHANNEL(accountcode)=${ACC_NO}|${DST/${ROUTE/i}}|LCR|${CARRIER/${ROUTE/i}}|${CALLERID(ani)}|N)
exten => _X.,n(dial),Set(CHANNEL(amaflags)=2)
exten => _X.,n(dial),Set(CHANNEL(clid)=${CALLERID(ani)})
exten => _X.,n(dial),Set(CALLERID(num)=${NEWCID})

exten => _X.,n,Progress()
exten => _X.,n,Set(TIMEOUT(absolute)=3600)
exten => _X.,n,Dial(${ROUTE/${ROUTE/i}},60,g)

;Handle all possible scenarios after dial attempt
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?tryagain)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?noanswer)
exten => _X.,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?fin)
exten => _X.,n,Goto(tryagain)

;Loop to next route
exten => _X.,dial+101(tryagain),Set(ROUTE/i=$[${ROUTE/i} + 1])
exten => _X.,n,Goto(while)      

exten => _X.,n(error),Congestion
exten => _X.,n(fin),HangUp
exten => _X.,n(noanswer),Busy

exten => _X.,n,HangUp

> CDR engine dispatching 2 cdrs - one for PartyA and another combined PartyA-PartyB
> ---------------------------------------------------------------------------------
>
>                 Key: ASTERISK-25596
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25596
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/General
>    Affects Versions: 13.6.0
>         Environment: Linux Debian-Jessie (64bit). Compiled from source. Default cdr.conf (from make samples).
>            Reporter: Pedro Guillem
>            Assignee: Unassigned
>            Severity: Critical
>
> Normally Asterisk creates a single CDR per call (for both bridged legs). 
> For some reason, its creating two cdrs per call.
> This happens when i upgrade from 1.4 to 13.6. I know there are a lot of changes in 8 years, but this one (if its indeed a change in the cdr engine) is totally meaningless. Why on earth would anyone want 2 cdr records for the same call?
> The first cdr that is being dispached is the PartyA (incoming) CDR. It logs almost empty data, with no dstchannel offcourse. I assume its the state of the PartyA alone after Hagnup().
> '19591652', '2015-11-29 21:03:02', '<900100>', '900100', '57XXXXXXXXX', 'default', 'SIP/162.XX-XX-XX-00000000', '', 'Hangup', 'rated', '', '0', '', '0', '0', 'ANSWERED', '0', '200121', 'Ether1-1448848954.0', '57XXXXXXX', '00', NULL, '0', NULL
> Second CDR is the ONLY desired CDR, which includes relevant information regarding the combined PartyA-PartyB transaction. (Note this one includes the duration, billsec, dstchannel and the bridged call data)
> '19591651', '2015-11-29 21:02:34', '<900100>', '900100', '57XXXXXXXX', 'default', 'SIP/162.XX.XX.XX-00000000', 'SIP/vox-00000001', 'Dial', 'rated', '', '0', '20200', '28', '20', 'ANSWERED', '0', '200121', 'Ether1-1448848954.0', '57XXXXXXX', '0', '0', '67', NULL
> I tried setting "unanswered=no" in cdr.conf, but the outcome is the same if the call is answered. The engine logs 2 records instead of one.
> Werid. Please share some light on what needs to be changed in order to produce ONE single cdr record per call.. NOT an independent CDR for  PartyA and a separate one for the bridged call.
> I must insist the relevant CDR is the bridged output.. not the PartyA incoming channel.
> Best regards, and thanks for any hints.
> Pedro



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



More information about the asterisk-bugs mailing list