[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
Mon Jan 19 10:06:40 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14085 
====================================================================== 
Reported By:                unservices
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   14085
Category:                   Applications/app_cdr
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
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-01-19 10:06 CST
====================================================================== 
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.
====================================================================== 

---------------------------------------------------------------------- 
 (0098126) andrebarbosa (reporter) - 2009-01-19 10:06
 http://bugs.digium.com/view.php?id=14085#c98126 
---------------------------------------------------------------------- 
I think I'm having the same problem:

I have a simple scenario: SIP phone A calls to SIP phone B

After the phone B answers, it presses a dtmf combination that will fire a
dynamic feature that sets the accountcode and userfield

http://pastebin.com/m623123bf

[macro-projectcodes]
exten = s,1,Set(CDR(accountcode)="345")
exten = s,n,Set(CDR(userfield)="345")
exten = s,n,Verbose(${CDR(accountcode)})

After the application ran, I got this output:

ebox*CLI> show channel SIP/barbosa-0827d8f8
 -- General --
           Name: SIP/barbosa-0827d8f8
           Type: SIP
       UniqueID: 1232380100.13
      Caller ID: 500
 Caller ID Name: (N/A)
    DNID Digits: (N/A)
          State: Up (6)
          Rings: 0
  NativeFormats: 0x4 (ulaw)
    WriteFormat: 0x4 (ulaw)
     ReadFormat: 0x4 (ulaw)
 WriteTranscode: No
  ReadTranscode: No
1st File Descriptor: 158
      Frames in: 7708
     Frames out: 7679
 Time to Hangup: 0
   Elapsed Time: 0h2m35s
  Direct Bridge: SIP/504-b6b00c18
Indirect Bridge: SIP/504-b6b00c18
 --   PBX   --
        Context: internal
      Extension: 
       Priority: 1
     Call Group: 6
   Pickup Group: 14
    Application: AppDial
           Data: (Outgoing Line)
    Blocking in: ast_waitfor_nandfds
      Variables:
BRIDGEPEER=SIP/504-b6b00c18
MACRO_DEPTH=0
DIALEDPEERNUMBER=barbosa
SIPCALLID=3958626d050a6047383fa1a507195e7b at 192.168.90.63

  CDR Variables:
level 1: dst=s
level 1: dcontext=internal
level 1: channel=SIP/barbosa-0827d8f8
level 1: lastapp=Verbose
level 1: lastdata=345
level 1: start=2009-01-19 15:48:20
level 1: answer=2009-01-19 15:48:21
level 1: duration=0
level 1: billsec=0
level 1: disposition=ANSWERED
level 1: amaflags=DOCUMENTATION
level 1: accountcode=345
level 1: uniqueid=1232380100.13
level 1: userfield=345

So, I think that the userfield and accountcode are correctly SET.

But, after I hangup the call, I got this cdr record:

"","504","500","internal","""504""
<504>","SIP/504-b6b00c18","SIP/barbosa-0827d8f8","Dial","SIP/barbosa|30|tThH","2009-01-19
15:48:19","2009-01-19 15:48:21","2009-01-19
15:51:00",161,159,"ANSWERED","DOCUMENTATION",""

Neither the accountcode or userfield are updated.

Also notice at the lastapp and lastappdata fields that are not updated. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-19 10:06 andrebarbosa   Note Added: 0098126                          
======================================================================




More information about the asterisk-bugs mailing list