How to get Caller Id info from a modem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ozmodiar
Forum Commoner
Posts: 35
Joined: Sat Jun 01, 2002 6:29 am
Location: Dublin, Ireland

How to get Caller Id info from a modem

Post by ozmodiar »

Does any one know how to get Caller Id information from a modem using php? :? Specifically the telephone number of the caller. I need this to search a DB table for client information.
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

more than likely, you'll just have to find an external script that does that and just run it/grab the output in a PHP script...

PHP is a web scripting language - it was never really made to be heavy on the file system side of things...
ozmodiar
Forum Commoner
Posts: 35
Joined: Sat Jun 01, 2002 6:29 am
Location: Dublin, Ireland

Post by ozmodiar »

I thought that might be the case. :cry: .

Thanks anyway.

How would you run an external script using php and how would you grab the result in a php script?
User avatar
James Pelow
Site Admin
Posts: 51
Joined: Sat Jun 01, 2002 5:28 am
Location: Killiney, Co. Dublin, Ireland
Contact:

Post by James Pelow »

Seeing as we're talking about Modems I'm going to take for example a PPP connection and getting info on that. It's a crude example but you could refine it.

Code: Select all

<?php

// The shell command.
exec("ps auxww | grep "pppd"", $pppd_info);

$array = explode (" ", $pppd_info);


$count = count($array);

for ($i = 0; $count > $i; $i++); {
echo ($arrayї$i] . " ");
}

?>
I'm assuming you're using a unix/linux OS if you're not I wouldn't have a clue how to do it.

Where are you in Dublin? I'm in Killiney myself.

-James Pelow
ozmodiar
Forum Commoner
Posts: 35
Joined: Sat Jun 01, 2002 6:29 am
Location: Dublin, Ireland

Post by ozmodiar »

Thanks. Thats exactly what I was looking for.

I'm in Blanchardstown.
Post Reply