Question about a function - setsmsdeliverystatus


(Emmanuel Chanson) #1

Hello, maybe Anton will read this:

I would like to understand what is the goal of this code part:

	if ($p_status > 0) {
		for ($c = 0; $c < count($core_config['plugins']['list']['feature']); $c++) {
			core_hook($core_config['plugins']['list']['feature'][$c], 'setsmsdeliverystatus', array(
				$smslog_id,
				$uid,
				$p_status 
			));

inside the function below:

function setsmsdeliverystatus($smslog_id, $uid, $p_status) {
global $core_config;
// $p_status = 0 --> pending
// $p_status = 1 --> sent
// $p_status = 2 --> failed
// $p_status = 3 --> delivered
// _log(“smslog_id:”.$smslog_id." uid:".$uid." p_status:".$p_status, 2, “setsmsdeliverystatus”);
$ok = false;
$db_query = "UPDATE " . DB_PREF . “_tblSMSOutgoing SET c_timestamp=’” . time() . “’,p_update=’” . core_get_datetime() . “’,p_status=’$p_status’ WHERE smslog_id=’$smslog_id’ AND uid=’$uid’”;
if ($aff_id = @dba_affected_rows($db_query)) {
// _log(“saved smslog_id:”.$smslog_id, 2, “setsmsdeliverystatus”);
$ok = true;
if ($p_status > 0) {
for ($c = 0; $c < count($core_config[‘plugins’][‘list’][‘feature’]); $c++) {
core_hook($core_config[‘plugins’][‘list’][‘feature’][$c], ‘setsmsdeliverystatus’, array(
$smslog_id,
$uid,
$p_status
));
}
}
}
return $ok;
}

In case of clickatell plugin gateway what is the function triggered ?