I never get ANSWERED disposition

Hi everyone!

I need to record the duration of the calls while they are up, but billsec is always null, and I think is because I never get ANSWERED as disposition even if the calls are made with no problems, and they are obviously answered.

Does anyone now if there is any configuration I must change or something???



I forgot to say that this happens with outbound calls, when the call is inbound and the Answer() command is performed, I get the ANSWERED disposition.


The ANSWERED disposition itself is not very useful, see http://bugs.digium.com/view.php?id=13794#94669.

You should get an answered time for the outgoing call when ast_answer is called. Details of when ast_answer is called depend on the technology in use. E.g., for SIP, it is when the peer responds OK to the invite.

I believe the above is correct for 1.6.0 and probably late 1.4.x versions, but you didn’t identify the version.

Failing to get an answered time on 1.6.0 tends to indicate that you have done something non-trivial in the dialplan, that causes you to lose the key CDR, or that the call really wasn’t answered (e.g. only received in band call progress indications, such as SIT and a message from the network, or some implementations of the freephone concept).

Hi david,

I really don’t know what else to do, im making outbound calls using a voip provider and need those timings for the billing. I am testing with a sip phone but i also get no answer. im using asterisk 1.4. my dialplan is very simple:


exten => s,1,WaitForSilence(1250,2)
exten => s,n,Playback(message)
exten => s,n,Hangup()

these are my cdrs:

[color=blue]org.asteriskjava.manager.event.CdrEvent[dateReceived=Wed Nov 05 12:30:09 CAT 2008,privilege=‘call,all’,endtime=‘2008-11-05 12:29:24’,destinationchannel=‘null’,userfield=‘null’,starttimeasdate=‘Wed Nov 05 12:29:05 CAT 2008’,timestamp=‘null’,billableseconds=‘0’,endtimeasdate=‘Wed Nov 05 12:29:24 CAT 2008’,lastdata=‘null’,accountcode=‘0766107xxx’,answertimeasdate=‘null’,src=‘null’,disposition=‘NO ANSWER’,callerid=‘Edgars’,starttime=‘2008-11-05 12:29:05’,answertime=‘null’,destination=‘s’,uniqueid=‘1225880945.22’,lastapplication=‘Hangup’,duration=‘19’,amaflags=‘DOCUMENTATION’,destinationcontext=‘outbound’,channel=‘IAX2/voipconnect-11849’,systemHashcode=10054858][/color]

hope these info gives you some clues…

It wasn’t clear what you meant by outbound. I assumed a normal phone call. You are not making the outbound call with the dialplan; you are only involving the dialplan after you have made the outbound call.

Your problem will be related to whatever mechanism you used to create the channel that is running the dialplan. It has presumably marked the channel up without calling ast_cdr_answered. That may well be a bug, but its not in an area of Asterisk which it would benefit me to explore at the moment.

you can poll “core show channels” and the status will go to “Bridged” when the other party answers. You could do a “quick and dirty” Perl script to check for this and update your database.

I don’t believe the channels ever get bridged. I assume that was what they meant at first, but now I think they are using something like AMI Originate to make a call, unfortunately, probably for tele-marketing.

are you using CDR? if so, what does that show?

The CDRs have already been provided (in blue) further up the thread.

The duration right after hangup is what you need. That should be the length of the answered call in seconds.

I have the end time and start time, that’s the duration of the call from dial to hungup. but the problem is i don’t have the answer time, and end - answer is the time the call is up, and time for billing (billsec).

I’ve been testing some more, and the only way I get the ANSWERED disposition (and billsec, answertime etc…) is using the commands dial() for outbound and answer() for inbound. Even using .call files in the /var/spool/asterisk/outgoing doesn’t work. I don’t know if i made it clear but im originating the calls with manager api.

im afraid this application is some kind of telemarketing… for political campaigns. not the best use of asterisk, i know… hope to start doing more interesting stuff after :smile:

If you are getting this on 1.4.22, 1.6.0, or relevant SVN HEAD versions for 1.4, 1.6 or TRUNK, I think you probably have a bug. However, if I were personally reporting it, I would want to check the code to understand why ast_cdr_answered wasn’t being called.

There are definitely issues to do with the notification of answer events to the CDR subsystem, e.g. see: http://bugs.digium.com/view.php?id=13794, although those cases do produce some attempt at an answered time.

Hi David,

I found an issue (8221) in the asterisk bug tracker, that is very similar to mine, the user commited the solution in some repository, and I have the tag (59486) but I don’t know where to download it from. can you please help me with this?


I think the basic problem is that CDRs are a mess for non-trivial cases. Unfortunately there is only a limited amount of time I can spend even on our CDR problems.

To analyse this one I’d have to understand what DISA is doing then analyze what is happening in your case. However, I would note that the fix for that one tends towards making calls appear answered. That particular issue is closed with a fix (some get closed because the reporter goes away).

For anyone else trying to answer, it would help to be clear exactly how you are triggering the call process, e.g. AMI Originate or call files.