Page 1 of 1
making a PHP modem dialer and recorder
Posted: Fri Jan 21, 2005 3:53 am
by Adesso
Hey all..
I just gave up trying to decrypt a working version of a dialer that uses PHP to make a phone call and saves the recording of the call to a MP3 file..
In theory this seems rather simple..
Anybody know How I can get started with the dialing bit..
I know PHP rather well, and modem AT command.. but i am not sure how to get PHP to tell the modem what to do.. ?
Some guidance would be great . The system will be for Linux box running Apache..
Posted: Fri Jan 21, 2005 4:59 am
by timvw
ah, a presume in *nix a modem is just a device like any other....
so open /dev/ttyS0 or wherever the modem is... and write the commands into it

i presume reading/listening is exactly the same?
might want to have a look at vgetty and /var/spool/voice too...
Posted: Sat Jan 22, 2005 3:58 am
by Adesso
Thanks for the reply, I will have a look at this vgetty and voice part as it will need to be part of the solution... I have managed to get the modem to work, but it has proved a bit more troublesome as it is a Connecant HSF modem. I finally got the *nix Driver for it but still have a bit of a tuff time getting the modem to respond via a normal fwrite... minicom works fine though..
I am guessing that I have to somehow get PHP to write via the driver to the modem or something.
The driver links the device to /dev/modem .... but PHP writing is still a problem... It could also be that the chr(13) that I send does not really have the same meaning a s Enter has in minicom... but Iĺl keep updating here as I move along ..
Posted: Sat Jan 22, 2005 10:17 am
by timvw
the first problem you (probably) will experience: you (well, the webserver that is executing the php script) don't have read/write access to the /dev/ttyS0 device.
In most linux systems it is sufficient to add the www-data/nobody user to the dialup group. But i don't have a magic ball though

Posted: Tue Jan 25, 2005 6:03 am
by Adesso
Well timvw
I am having weird problems with this puppy.
Minicom opens the port no problem from /dev/modem which is a sym link to /dev/ttySHSF0 ... So from that you can figure out that this is a internal Modem. The driver seems to work fine but I can't get PHP to open the same port...
My apache server is running as User:apache and Group:admin but the device is only for root. So I go and change the group file to have the root group contain admin.. but no luck... then I look for your dialup group and nothing either..
So in the dev dir I have
ttySHSF0 belongs to root and group uucp 241, ?????
needless to say PHP can't open the port.. but this uucp 241, group is really puzzeling me... it's not in the group file. Then I start playing around with the udev conf and see some permission file ... but this does nothing either...
It can't be that tuff to open a modem port via PHP can it.. ? If minicom can do it.. why can't I
Any suggestions ?