Hi Guys,
Just wanted to report a bug which I believe is still present even on the latest code on git.
it is related to this bug
http://www.asterisk2billing.org/cgi-bin ... ticket/837 and the fix presented.
If customer A has restricted numbers set, and customer B has restricted numbers set, then you both sets of restricted numbers applied to both customers. The fix in ticket 837 resolved that.
BUT,
if you have removeinterprefix set (i.e. remove 00 before matching rate), then the behaviour, even after the fix in ticket 837 was still broken,
original code from 837 fix
$QUERY = "SELECT * FROM cc_restricted_phonenumber WHERE id_card='".$this->id_card."' AND '".$this->destination."' LIKE number";
if ($this->removeinterprefix) {
$QUERY .= "
OR '". $this -> apply_rules ($this->destination)."' LIKE number;
it breaks after the
OR statement and forgets (again) to check card id.
The code I am proposing:
$QUERY = "SELECT * FROM cc_restricted_phonenumber WHERE (id_card='".$this->id_card."' AND '".$this->destination."' LIKE number)";
if ($this->removeinterprefix) {
$QUERY .= "
OR (id_card='".$this->id_card."' AND '". $this -> apply_rules ($this->destination)."' LIKE number)";
I will test this later, but I believe it will fix this issue.