Hi Guys,
I modified the a2billing to forward A2billing DID incoming call after it is failed on VoIP phone to be transfered to a chosen forward number.
however if the forward failed after N seconds .
However I don't know why it is not working,
I placed it under the function : function call_did($agi, &$RateEngine, $listdestination){
between these codes:
Code:
//# Ooh, something actually happend!
if ($dialstatus == "BUSY") {
$answeredtime=0;
$agi-> stream_file('prepaid-isbusy', '#');
// FOR FOLLOWME IF THERE IS MORE WE PASS TO THE NEXT ONE OTHERWISE WE NEED TO LOG THE CALL MADE
if (count($listdestination)>$callcount) continue;
} elseif ($this->dialstatus == "NOANSWER") {
$answeredtime=0;
$agi-> stream_file('prepaid-noanswer', '#');
// FOR FOLLOWME IF THERE IS MORE WE PASS TO THE NEXT ONE OTHERWISE WE NEED TO LOG THE CALL MADE
if (count($listdestination)>$callcount) continue;
} elseif ($dialstatus == "CANCEL") {
$answeredtime=0;
// FOR FOLLOWME IF THERE IS MORE WE PASS TO THE NEXT ONE OTHERWISE WE NEED TO LOG THE CALL MADE
if (count($listdestination)>$callcount) continue;
} elseif ($dialstatus == "ANSWER") {
$this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[A2Billing] DID call friend: dialstatus : $dialstatus, answered time is ".$answeredtime." \n");
} elseif (($dialstatus == "CHANUNAVAIL") || ($dialstatus == "CONGESTION")) {
$answeredtime=0;
// FOR FOLLOWME IF THERE IS MORE WE PASS TO THE NEXT ONE OTHERWISE WE NEED TO LOG THE CALL MADE
if (count($listdestination)>$callcount) continue;
} else{
$agi-> stream_file('prepaid-noanswer', '#');
// FOR FOLLOWME IF THERE IS MORE WE PASS TO THE NEXT ONE OTHERWISE WE NEED TO LOG THE CALL MADE
if (count($listdestination)>$callcount) continue;
}
voicemail:
Code:
if (($dialstatus =="CHANUNAVAIL") || ($dialstatus == "CONGESTION") ||($dialstatus == "NOANSWER") )
{
// The following section will send the caller to VoiceMail with the unavailable priority.
$did_number = "u".$this->destination;
$this -> write_log("[STATUS] CHANNEL UNAVAILABLE - DIVERT TO VOICEMAIL ($did_number)");
$agi-> exec(VoiceMail,$did_number);
}
if (($dialstatus =="BUSY") )
{
// The following section will send the caller to VoiceMail with the busy priority.
$did_number = "b".$this->destination;
$this -> write_log("[STATUS] CHANNEL UNAVAILABLE - DIVERT TO VOICEMAIL ($did_number)");
$agi-> exec(VoiceMail,$did_number);
}
//end of mod