[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
Fri Feb 15 18:43:55 CST 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:              02-15-2008 18:43 CST
====================================================================== 
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.
====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 02-15-08 18:43  
---------------------------------------------------------------------- 
What happens if you use a channel other than the Local channel? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-15-08 18:43  Corydon76      Note Added: 0082350                          
======================================================================




More information about the asterisk-bugs mailing list