|
|
Dia
Premium Account
Registration Date: 03.03.2006
Posts: 1443
|
|
|
06.10.2008 19:26 |
|
mko
Registration Date: 01.01.1970
Posts:
|
|
|
07.10.2008 00:17 |
|
Dia
Premium Account
Registration Date: 03.03.2006
Posts: 1443
|
|
|
07.10.2008 21:13 |
|
mko
Registration Date: 01.01.1970
Posts:
|
|
RE: our own contactsdatabase |
|
Diafora, this is the php code on my server...
im uploading de database to a colocation server right now... when its done i send you the test url.
<?
$callernum = $_GET['callerid'];
if (substr($callernum, 0, 4) == "0031") $callernum = "0".substr($callernum, 4);
if (substr($callernum, 0, 2) == "31") $callernum = "0".substr($callernum, 2);
if (substr($callernum, 0, 3) == "+31") $callernum = "0".substr($callernum, 3);
// No caller-id?
if ($result_cid == "" && ($callernum == "" ))
$result_cid = "Anoniem";
if ($result_cid == "") {
$host = "localhost"; //locatie van de MySQL server
$username = "xxxxxxxxx"; //gebruikersnaam van de MySQL server
$password = "xxxxxxxxxxxxxx"; //wachtwoord van de MySQL server
$database = "xxxxxxxxxxxxxxx"; //database die aangesproken moet worden
$lnk = mysql_connect($host,$username,$password) or die(mysql_error()); //connecteren met de server
mysql_select_db($database,$lnk) or die(mysql_error()." [".$database."]"); //selecteren van de database
$query = "select * from white_subscriber where phone = '$callernum'";
$result = mysql_query($query) or die(mysql_error());
if ($row = mysql_fetch_array($result))
$result_cid = "".$row["lastname"]." ".$row["firstname"]."";
// posibliities :
// title varchar(40)
// firstname varchar(12
// infix varchar(40)
// lastname varchar(12
// streetname varchar(64)
// housenumber varchar(24)
// postalcode varchar(9)
// city varchar(80)
// phone varchar(20)
}
// Not in my database
if ($result_cid == "") {
$result_cid = "$callernum";
}
echo($result_cid);
?>
This post has been edited 1 time(s), it was last edited by mko on 10.10.2008 at 01:34.
|
|
08.10.2008 12:45 |
|
i-p
Super Moderator
Registration Date: 14.01.2006
Posts: 4775
|
|
|
10.10.2008 13:09 |
|
mko
Registration Date: 01.01.1970
Posts:
|
|
RE: our own contactsdatabase |
|
thanks for the great solution i'll try it out....
works great, thank you for this option.
i'll see a new field in the future:
inbound routing / trunk name/ below options :
cid name resolve url : ....... (example: http://www.google.com/search?q=phonebook: )
update 20-10-08 02:07 :
everything worked fine for a couple of days, but today it doesnt work anymore ??
did you changed someting ?
my (example)html output =
Zitat: |
<html>
<head>
<title>Private Search Systeem</title>
</head>
<body>
<td>Me Tester<td>
</body>
</html> |
|
and my extensions.con / ext-did looks like :
Zitat: |
exten => s,1,SetVar(FROM_DID=s)
exten => s,2,SetVar(FAX_RX=disabled)
exten => s,3,PrivacyManager
exten => s,4,SetVar(DIAL_OPT=m)
exten => s,5,SetVar(REV=http://www.xxxxxxx.xx/nrtoname.php?callerid=)
exten => s,6,GotoIfTime(13:30-17:00|mon|*|*?aa_2,s,1
exten => s,7,GotoIfTime(09:00-17:00|tue-fri|*|*?aa_2,s,1
exten => s,8,Goto(aa_1,s,1)
exten => _X.,1,Goto(ext-did,s,1)
|
|
update : 21-10-2008 10:00 : everything seems to work again
This post has been edited 10 time(s), it was last edited by mko on 21.10.2008 at 09:59.
|
|
15.10.2008 02:03 |
|
mat
Registration Date: 01.01.1970
Posts:
|
|
|
24.01.2009 00:48 |
|
|
|
|
|
|
|