[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
Thu Apr 24 14:35:15 CDT 2008


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12007 
====================================================================== 
Reported By:                amessina
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   12007
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
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-24-2008 14:35 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.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-24-08 14:35  Corydon76      Status                   ready for testing =>
assigned
04-24-08 14:35  Corydon76      Assigned To               => Corydon76       
======================================================================




More information about the asterisk-bugs mailing list