No cdr when dialstatus is CANCEL

hello dear friends
i have a big problem. my inbound calls go to an agi file and then from agi i send call to dialplan by :
$agi->exec(“Dial LOCAL/8083@from-internal,g”);

but when caller hangup exactly when want to dial , status of dial become “CANCEL”
and there is no cdr event on ami and no cdr in my Master.conf and mysql cdr table :

app_dial.c: Caller hung up before dial.
res_agi.c: inbound-logger.php,096366: DialStatus: CANCEL

why asterisk dont have cdr in this case??
please help me to solve that.

Does the call ever go through as you expect and generate good CDRs ?

Is the unanswered=yes option configured in /etc/asterisk/cdr.conf ?

Can you add a call to ForkCDR() application in your AGI before the caller hangup – so, well before the Dial() ?

thanks for kind help.
i set unanswered=yes but when calls comes to agi , i answer them all by :
$agi = new AGI();
$agi->answer();

about forkcdr() if i add it before dial, in case of successfull call , it will raise 2 same cdr, that is not ok with my senario.
can i add forkcdr() after dial ? with check of dialstatus like below :

            $agi->exec("DIAL LOCAL/".$queue."@from-internal,,g");
            $dial_stat = $agi->get_variable("DIALSTATUS");
            $dial_stat = $dial_stat['data'];
            $agi->verbose("DialStatus: ".$dial_stat);

if ( $dial_stat == ‘CANCEL’) {
$agi->exec(“ForkCDR()”);
}

please help me solve that,

If the AGI has answered them the status is ANSERED. and the caller is ujnable to use CANCEL.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.