[asterisk-dev] Origianate and CDR

Andrey Solovjov solovjov at mcn.ru
Mon Feb 19 09:58:55 MST 2007


Hi all.
Sorry if this shouldn't be in developers list.
I use manager Originate command for our outbound call center. I use it 
in a little bit strange way. First I call to an agent. So I have in 
Channel field SIP/103 (device used by an agent). Then when agent answers 
another phone number is dialed, for example 123456. The problem is that 
if agent  answers such call always has status ANSWERED in CDR. Even if 
123456 is busy or hasn't been answered.
In asterisk 1.2.x I used ResetCDR function before Dial command. For example:
exten => 123456,1,ResetCDR()
exten => 123456,n,Dial(Zap/g1/123456).
As a result I had true status of the call.
In asterisk 1.4 ResetCDR doesn't work for me. The status is always NO 
ANSWER if I use ResetCDR and ANSWER if I don't use ResetCDR. We've 
decided to look what has changed in channel.c and found out what causes 
such status. Such call has flag OUTGOING and can't be answered so CDR 
can't be changed. It's seen from the function ast_answer:
/* You can't answer an outbound call */
        if (ast_test_flag(chan, AST_FLAG_OUTGOING)) {
                ast_channel_unlock(chan);
                return 0;
        }

As a result ast_cdr_function isn't used.
When I comment this statement I get normal call status as I had in 1.2.x.
What does it mean OUTGOING? What are the consequences of removing this 
if statement from the code?
Asterisk 1.4.x behaviour is different from 1.2.x. What is correct bahaviour?
Thanks for your answers and sorry for my English.
Andrew Solovyev.


More information about the asterisk-dev mailing list