views:

169

answers:

1

Hi guys, my landline phone is connected to my computer. Now in my asp.net website there is a textbox and a button . i filled a telephone number in the textbox and on button click i want that a call get connected to the no. in the textbox through my landline phone.

Is there any workaround for this in .net framework??

Thanks and best regards....

Prateek

A: 

If it's connected to a MODEM in your computer you might be able to use .NET Serial Port communication to talk to the modem to get it to dial for you. Look at the Serial communication classes and your modem manual.

System.IO.Ports contains a class called SerialPort which you can use like this ...

        var sp = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);

        sp.ReadTimeout = 5000;
        sp.NewLine = "" + (char)13;
        sp.WriteTimeout = 5000;
        sp.DtrEnable = true;
        sp.RtsEnable = true;
        sp.Handshake = Handshake.None;

        sp.Open();

        SerialPort.DataReceived += new SerialDataReceivedEventHandler(SerialDataReceivedEventHandler);

Now you can send the appropriate autodial commands to the modem (ATDT ...) and you can create an event handler 'SerialDataReceivedEventHandler' to receive messages back from the modem.

Hightechrider
thanks for your reply.... but can you please tell me exactly how can i communicate to my modem through .net???
Prateek Singh
I updated the answer with more detail on how to use the .NET classes I mentioned.
Hightechrider
See also http://meta.stackoverflow.com/questions/5234/accepting-answers-what-is-it-all-about
Hightechrider