Hi guys,
I noticed in our setup which we are using followme to forward the call to the user's secondary phone number if the sip phone is not available,
in case the caller cancel the call before (means hangup) before it goes to second phone, it will still dial the user's mobile/landline
for this reason I edit this file: Class.A2Billingdid.php
ORIGINAL:
Code:
if ($this -> callingcard_ivr_authorize($agi, $RateEngine, 0)==1){
// PERFORM THE CALL
$result_callperf = $RateEngine->rate_engine_performcall ($agi, $this -> destination, $this);
if (!$result_callperf) {
$prompt="prepaid-noanswer";
$agi-> stream_file($prompt, '#');
continue;
}
if (($RateEngine->dialstatus == "NOANSWER") || ($RateEngine->dialstatus == "CANCEL") || ($RateEngine->dialstatus == "BUSY") || ($RateEngine->dialstatus == "CHANUNAVAIL") || ($RateEngine->dialstatus == "CONGESTION")) continue;
// INSERT CDR & UPDATE SYSTEM
$RateEngine->rate_engine_updatesystem($this, $agi, $this-> destination, $doibill, 1);
// CC_DID & CC_DID_DESTINATION - cc_did.id, cc_did_destination.id
$QUERY = "UPDATE cc_did SET secondusedreal = secondusedreal + ".$RateEngine->answeredtime." WHERE id='".$inst_listdestination[0]."'";
$result = $this->instance_table -> SQLExec ($this -> DBHandle, $QUERY, 0);
$this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[UPDATE DID: SQL: $QUERY]:[result:$result]");
$QUERY = "UPDATE cc_did_destination SET secondusedreal = secondusedreal + ".$RateEngine->answeredtime." WHERE id='".$inst_listdestination[1]."'";
$result = $this->instance_table -> SQLExec ($this -> DBHandle, $QUERY, 0);
$this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[UPDATE DID_DESTINATION: SQL: $QUERY]:[result:$result]");
// THEN STATUS IS ANSWER
break;
}
to:
Code:
if ($this -> callingcard_ivr_authorize($agi, $RateEngine, 0)==1){
// PERFORM THE CALL
$result_callperf = $RateEngine->rate_engine_performcall ($agi, $this -> destination, $this);
if (!$result_callperf) {
$prompt="prepaid-noanswer";
$agi-> stream_file($prompt, '#');
continue;
}
//in case caller cancelled to call we must drop the call
if (($RateEngine->dialstatus == "CANCEL")) break;
if (($RateEngine->dialstatus == "NOANSWER") || ($RateEngine->dialstatus == "CANCEL") || ($RateEngine->dialstatus == "BUSY") || ($RateEngine->dialstatus == "CHANUNAVAIL") || ($RateEngine->dialstatus == "CONGESTION")) continue;
// INSERT CDR & UPDATE SYSTEM
$RateEngine->rate_engine_updatesystem($this, $agi, $this-> destination, $doibill, 1);
// CC_DID & CC_DID_DESTINATION - cc_did.id, cc_did_destination.id
$QUERY = "UPDATE cc_did SET secondusedreal = secondusedreal + ".$RateEngine->answeredtime." WHERE id='".$inst_listdestination[0]."'";
$result = $this->instance_table -> SQLExec ($this -> DBHandle, $QUERY, 0);
$this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[UPDATE DID: SQL: $QUERY]:[result:$result]");
$QUERY = "UPDATE cc_did_destination SET secondusedreal = secondusedreal + ".$RateEngine->answeredtime." WHERE id='".$inst_listdestination[1]."'";
$result = $this->instance_table -> SQLExec ($this -> DBHandle, $QUERY, 0);
$this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[UPDATE DID_DESTINATION: SQL: $QUERY]:[result:$result]");
// THEN STATUS IS ANSWER
break;
}