<span style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt">My "h" extension is in the same context as my Dial commands. Here is a cut back version of the code.<br />
The cause_code value is never stored in the mysql databae even when set in the "h" extension or the<br />
when set in "rc-ANSWER' OR "doDialStd" <br />
<br />
[macro-OBD-DoOutboundDial]<br />
exten => s,1,Macro(${ARG1})<br />
exten => s,n,Set(CALLERID(name)=${siteDefaultCIDName})<br />
exten => s,n,Set(CALLERID(number)=${siteDefaultCIDNumber})<br />
exten => s,n,SipAddHeader(X-interNetGR-linetype:${gbl_ibclinetype})<br />
exten => s,n,SipAddHeader(X-interNetGR-actlineid:${gbl_actlineid})<br />
exten => s,n,Set(GROUP()=${siteGrpLineCount})<br />
exten => s,n,Set(c_DialArg=${ARG2})<br />
exten => s,n,Set(c_DialExten=${MACRO_EXTEN})<br />
exten => s,n,GoSub(DoLineCountCheck,1)<br />
exten => s,n,GotoIf($[${siteOverLineCount}=1]?OverLineCount,1)<br />
exten => s,n,GosubIf($["${c_DialExten}"="${siteDirSer}"]?OverLineCount,1)<br />
exten => s,n,GosubIf($["${c_DialExten}"="411"]?nofeature,1)<br />
exten => s,n,GosubIf($["${siteUseE164}"="1"]?doDialE164,1:doDialStd,1)<br />
exten => s,n,Goto(rc-${DIALSTATUS},1) <br />
exten => s,n,Busy(60)<br />
exten => s,n,Hangup()<br />
<br />
exten => h,1,NoOp(Cause Code = ${HANGUPCAUSE})<br />
exten => h,n,Set(CDR(cause_code)=${HANGUPCAUSE})<br />
exten => h,n,Goto(rc-${DIALSTATUS},1)<br />
<br />
exten => doDialStd,1,NoOp(Calling Using No E164)<br />
exten => doDialStd,n,Macro(OBD-CheckOutboundNumber,${c_DialArg}${c_DialExten})<br />
exten => doDialStd,n,Dial(${siteDefaultOutboundTrunk}/${c_DialArg}${c_DialExten},120,ge${siteDialOptionsPublic})<br />
exten => doDialStd,n,Set(CDR(cause_code)=${HANGUPCAUSE})<br />
exten => doDialStd,n,Return<br />
<br />
<p>exten => rc-ANSWER,1,NoOp(Do Return ANSWER)<br />
exten => rc-ANSWER,n,Set(CDR(cause_code)=${HANGUPCAUSE})<br />
exten => rc-ANSWER,n,Hangup()</p>
<p>exten => rc-BUSY,1,NoOp(Do Return BUSY)<br />
exten => rc-BUSY,n,Busy()<br />
exten => rc-BUSY,n,Hangup()</p>
<p>exten => rc-NOANSWER,1,NoOp(Do Return NOANSWER)<br />
exten => rc-NOANSWER,n,NoOp(Cause Code = ${HANGUPCAUSE})<br />
exten => rc-NOANSWER,n,Hangup()</p>
<br />
<br />
<br />
Any more feed back would be appercaited.<br />
<br />
Bryant<br />
<br />
<div id="divSignature"></div>
<br />
<br />
<span style="font-family: tahoma,arial,sans-serif; font-size: 10pt;"><hr width="100%" size="2" align="center" />
<b>From</b>: "Tilghman Lesher" <tilghman@meg.abyt.es><br />
<b>Sent</b>: Wednesday, December 22, 2010 3:06 PM<br />
<b>To</b>: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com><br />
<b>Subject</b>: Re: [asterisk-users] Possible Bug (Include ${HANGUPCAUSE} in CDR)</span><br />
<br />
On Wednesday 22 December 2010 11:42:33 Bryant Zimmerman wrote:<br />
> Ok I can't get my CDR values to set from the h extension in either 1.6.2<br />
> or 1.8 What is wrong? Here is what I found in the cdr.conf<br />
> <br />
> ; Normally, CDR's are not closed out until after all extensions are<br />
> finished<br />
> ; executing. By enabling this option, the CDR will be ended before<br />
> executing<br />
> ; the "h" extension so that CDR values such as "end" and "billsec" may<br />
> be ; retrieved inside of of this extension. The default value is "no".<br />
> endbeforehexten=no<br />
> <br />
> The default is set to no so why can't I store any CDR values in my h<br />
> extension.<br />
> <br />
> exp..<br />
> exten => h,n,Set(CDR(cause_code)=${HANGUPCAUSE})<br />
> I need the cause code stored.<br />
<br />
Sounds like your "h" extension is in the wrong context. Try including some<br />
information about where you are putting the "h" extension and what includes<br />
you're doing.<br />
<br />
-- <br />
Tilghman<br />
<br />
--<br />
_____________________________________________________________________<br />
-- Bandwidth and Colocation Provided by http://www.api-digital.com --<br />
New to Asterisk? Join us for a live introductory webinar every Thurs:<br />
http://www.asterisk.org/hello<br />
<br />
asterisk-users mailing list<br />
To UNSUBSCRIBE or update options visit:<br />
http://lists.digium.com/mailman/listinfo/asterisk-users<br />
<br /></span>