[asterisk-bugs] [Asterisk 0014085]: Userfield not updating when the call is answered, if not answered it updates properly
Asterisk Bug Tracker
noreply at bugs.digium.com
Thu Mar 19 07:07:23 CDT 2009
A NOTE has been added to this issue.
======================================================================
http://bugs.digium.com/view.php?id=14085
======================================================================
Reported By: unservices
Assigned To: mnicholson
======================================================================
Project: Asterisk
Issue ID: 14085
Category: Applications/app_cdr
Reproducibility: always
Severity: major
Priority: normal
Status: ready for testing
Asterisk Version: 1.4.22
Regression: No
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2008-12-15 19:58 CST
Last Modified: 2009-03-19 07:07 CDT
======================================================================
Summary: Userfield not updating when the call is answered, if
not answered it updates properly
Description:
Have a call coming through a SIP trunk. Extensions.conf is on realtime
mode, which goes to mysql extensions table and rings the SIP extension. At
the same context of extensions.conf I also have the 'h' extension, so that
a small script could run at the end to calculate the call cost after it's
completed, storing in the userfield. The script is running on the 'h'
extension with deadagi, so that it would allow to run after the call is
hangup.
Since it was not working, I made it quite simple just storing the numbers
1234 in the userfield once the script runs, nothing else. If the call comes
and the extension does not answer (no answer cdr result), the userfield
gets updated. But if the extension answers the call, upon hangup the
userfield simply does not get updated. Interesting to see is that with
debug in the console I see the agi script setting up the userfield for 1234
as expected, but it never gets saved into the database. It seems that the
script runs, but it's loosing the reference on where to update.
More interesting is that the same script / config runs with no problems
with the asterisk version 1.2 - which I'm trying to update to 1.4.22 so
that would have patches, better call quality, etc.
Obviously I have clonned the hard disk and am testing on a side server, so
that the main one is not affected... But really want to solve this asap
because the old box is giving me problems.
======================================================================
----------------------------------------------------------------------
(0101965) andrebarbosa (reporter) - 2009-03-19 07:07
http://bugs.digium.com/view.php?id=14085#c101965
----------------------------------------------------------------------
I'm using the workaround that agx suggested (thanks man!).
I've an [hangupedcalls] context,
exten = h,1,SET(TMPACCOUNTCODE=${SHARED(ACCOUNTCODE)})
exten = h,n,GotoIf($["${TMPACCOUNTCODE}" != ""]?accountcode)
exten = h,n,SET(TMPACCOUNTCODE=${SHARED(ACCOUNTCODE,${BRIDGEPEER})})
exten = h,n,GotoIf($["${TMPACCOUNTCODE}" != ""]?accountcode:exit)
exten = h,n(accountcode),Set(CDR(accountcode)=${TMPACCOUNTCODE})
exten = h,n(exit),Verbose(${CDR(accountcode)})
exten = h,n,ResetCDR(w)
exten = h,n,NoCDR
exten = h,n,Hangup
I also have to use SHARED variables, because in my scenario, AccountCode
can be written either by the caller or callee.
Using asterisk 1.23.1 with func shared ported by Tilghman
Issue History
Date Modified Username Field Change
======================================================================
2009-03-19 07:07 andrebarbosa Note Added: 0101965
======================================================================
More information about the asterisk-bugs
mailing list