[asterisk-users] [OT] phpagi help

--[ UxBoD ]-- uxbod at splatnix.net
Sun Apr 4 07:44:20 CDT 2010


----- Original Message -----
> Hi,
> 
> I am attempting to connect to the blacklist database using PHPAgi and
> it always seems to hang. The code snippet I am trying is:
> 
> $r = $agi->get_variable("CALLERID(num)");
> $cidnum = $r["data"];
> if ($cidnum < 1000000000) # No valid callerid.
> { exit(0);
> }
> 
> $r = $agi->database_get("blacklist", "$cidnum");
> if ($r["result"] == 1)
> { $agi->verbose("Call blocked by blacklist.");
> $agi->exec('Set','CDR(userfield)="Blocked call by blacklist"');
> $agi->set_variable("PHONESPAMFILTER", "2");
> } else {
> exit(0); }
> 
> Any ideas ? I have tried searching and looked at some examples and my
> syntax looks correct ?

Always pays to check the bug list ... database_get was missing a \"!
-- 
Thanks, Phil




More information about the asterisk-users mailing list