PHP phone call with voice 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
sopinon
Forum Newbie
Posts: 3
Joined: Sun Nov 07, 2004 1:16 pm

PHP phone call with voice modem?

Post by sopinon »

Hi there,

is it possible to make a phone call using php and a voice modem?

The php script should connect by a voice modem, and play a wav file or something like this. It would be perfect if the php script also alows acknowledgements like: "If you carry about it please press 1", "If you don't have time, please press 2" and so on...

Exists a class for this application?

Greets from Switzerland
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

That type of application I doubt exists in PHP as PHP requires the script to be parsed before any output.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

well, there is something like http://www.voicexml.org.

you could use PHP to generate/interprete the xml that is needed for such an IVR
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Well, I don't see why PHP couldn't at least make the call since you can open serial ports with it. As for understanding responses, it would take an extension to a sound lib of some sort no? If I'm not mistaken, there is an EAsound extension for PHP. I could be wrong. Check PECL.

Another possibility may be other sound command line tools.

But oh well...., just thinkin' out my butt.

8O
sopinon
Forum Newbie
Posts: 3
Joined: Sun Nov 07, 2004 1:16 pm

Post by sopinon »

Ok, I've tried to find something to open a serial connection to a voice modem.

This is all I've found:

Code: Select all

<?php
   `mode com1: BAUD=9600 PARITY=N data=8 stop=1 xon=off`;
   $fp = fopen ("COM1:", "w+");
   if (!$fp) {
       echo "Uh-oh. Port not opened.";
   } else {
       $e = chr(27);
       $string  = $e . "A" . $e . "H300";
       $string .= $e . "V100" . $e . "XL1SATO";
       $string .= $e . "Q1" . $e . "Z";
       echo $string;
       fputs ($fp, $string );
       fclose ($fp);
   }
?>
But how can i dial a Number? Which string do i need? And is this String depending on the type of the Modem?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

[google]"at command list"[/google]
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Code: Select all

ATDnumber_to_dial
sopinon
Forum Newbie
Posts: 3
Joined: Sun Nov 07, 2004 1:16 pm

Post by sopinon »

Weirdan wrote:[google]"at command list"[/google]
hmmmm....

it's very hard to find an example for a simple connection... Have anyone of you, already made something like this?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

it's just ages ago that i did that kind of things... those days, mirc had a bug, so one could send COM1 ath0 or stuff like that ;)

a little websearch on "calling modem at dt example" returns enough samples, not?
Post Reply