# Freebsd to dial phone number and



## Just_Johnny (Dec 6, 2008)

Freebsd to dail phone number and play a audio file.  Is this possible?  

I read this from: http://www.freebsd.org/doc/en/books/handbook/dialout.html

-----------------------------------------------------------
How Can I Dial a Phone Number on the Command Line?
Put what is called a â€œgenericâ€ entry in your /etc/remote file. 

For example:

tip115200|Dial any phone number at 115200 bps:
        :dv=/dev/cuad0:br#115200:at=hayesa=none:du:
tip57600|Dial any phone number at 57600 bps:
        :dv=/dev/cuad0:br#57600:at=hayesa=none:du:
------------------------------------------------------------

I guess that explains it pretty clearly how to dial a phone number but how would I play a audio file?   

I'm trying to create a simple alert system that calls me when I server goes down and plays a file (or says something somehow) 

Any advice would be much appreciated.


----------



## Dr_Phoenix (Dec 6, 2008)

Install simple command line player like mpg123:
  #> cd /usr/ports/audio/mpg123 && make install clean && rehash
Put the playmusic line into some script, like:
  mpg123 -q /home/alert.mp3 (-q option disables messages output to console)
To stop playing it is simple to kill process:
  killall mpg123
To change volume from script use:
  mixer vol 70:70

NOTE: Device file /dev/dsp must present and your sound card must be configured. mpg123 player has many other options and features, watch the man page.


----------



## Just_Johnny (Dec 7, 2008)

Cool.  Thank you for the response.  Wouldn't that play the sound out my speakers?


----------



## bsddaemon (Dec 7, 2008)

Sorry, we actually can plug the phone line into modem port, and FreeBSD is able to make call? I never heard about it :S


----------



## Just_Johnny (Dec 7, 2008)

bsddaemon said:
			
		

> Sorry, we actually can plug the phone line into modem port, and FreeBSD is able to make call? I never heard about it :S



Anything else?


----------



## Dr_Phoenix (Dec 7, 2008)

To play music to the line you must plug soundcard output to the phone's microphone input through signal level converter, you can find many simple electrical schemes and circuits in the internet, good luck!


----------



## catphish (Dec 8, 2008)

Do you have a voice modem?

With vgetty, modem::vgetty, and a little perl script it is fairly easy.

http://www.webreference.com/perl/tutorial/14/2.html

If you only have a regular modem, you are limited to good old numeric pages as far as I know.  We used to have some complex coded messages.

You might be able to hack something out with VoIP but that is a lot of software (and possibly hardware).  Another option is email.  We have a system that sends emergency text messages via the carrier's email-to-text gateway to the on-call phone and uses regular email for casual alerts.


----------

