[asterisk-bugs] [Asterisk 0012007]: Asterisk 1.4 AMI Originate does not sufficiently set CDR(accountcode) on the first call leg

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Apr 2 15:00:05 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12007 
====================================================================== 
Reported By:                amessina
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12007
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.17 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             02-15-2008 15:45 CST
Last Modified:              04-02-2008 15:00 CDT
====================================================================== 
Summary:                    Asterisk 1.4 AMI Originate does not sufficiently set
CDR(accountcode) on the first call leg
Description: 
Using Asterisk 1.4.17 and:

Using the AMI as follows (numbers hidden for privacy; Channel number and
Exten ARE different):
Action: Originate
Channel: Local/1NXXNXXXXXX at outbound/n
Context: outbound
Exten: 1NXXNXXXXXX
Priority: 1
Account: 12345
Async: True

With the following (initial) part of my dialplan:
[outbound]
exten => _1NXXNXXXXXX,1,Macro(outbound,${EXTEN})

[macro-outbound]
exten => s,1,NoOp(Accountcode is: ${CDR(accountcode)})
exten => s,n,NoOp(Attempting to call ${ARG1} from ${MACRO_CONTEXT} using
account code ${CDR(accountcode)})
exten =>
s,n,Set(ARRAY(CALLERID(num),num,enum-num,enum-domain)="${CDR(accountcode)},${ARG1},+${ARG1},e164.org")

I get the following results (numbers hidden for privacy):
== Parsing '/etc/asterisk/manager.conf': Found
== Manager 'directory' logged on from 127.0.0.1
== Manager 'directory' logged off from 127.0.0.1
-- Executing [1NXXNXXXXXX at outbound:1]
Macro("Local/1NXXNXXXXXX at outbound-a6ab,2", "outbound|1NXXNXXXXXX") in new
stack
-- Executing [s at macro-outbound:1]
NoOp("Local/1NXXNXXXXXX at outbound-a6ab,2", "Accountcode is: ") in new stack
-- Executing [s at macro-outbound:2] NoOp("Local/1NXXNXXXXXX at outbound,2",
"Attempting to call 1NXXNXXXXXX from outbound using account code ") in new
stack
-- Executing [s at macro-outbound:3] Set("Local/1NXXNXXXXXX at outbound-a6ab,2",
"ARRAY(CALLERID(num)|num|enum-num|enum-domain)="|1NXXNXXXXXX|+1NXXNXXXXXX|e164.org"")
in new stack

You can see that the CDR(accountcode) variable is not available at call
time, for some reason, but it is available when I do "core show channels
verbose" during the call and it is correctly placed in the (MySQL) CDR
*AFTER* the call completes.
====================================================================== 

---------------------------------------------------------------------- 
 qwell - 04-02-08 15:00  
---------------------------------------------------------------------- 
Patch attached.  With this patch, the CDR accountcode gets set on the
source channel.

The question is whether it is correct to do so or not. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-02-08 15:00  qwell          Note Added: 0084957                          
======================================================================




More information about the asterisk-bugs mailing list