5 Replies - 12358 Views - Last Post: 01 September 2010 - 07:32 PM Rate Topic: -----

#1 Ahmedn1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 23
  • View blog
  • Posts: 556
  • Joined: 04-August 09

Making phone calls using C#

Posted 31 August 2010 - 04:44 PM

Hello DIC heads
I want to learn how to create a desktop application that receives a number then dial it

till the moment, it's been an hour searching Google for useful start point
and all what I found are some very very old topics asking for the same and rare answers

what I learnt that I have to use the TAPI API

I found this article and I think it will do the job
play wave file through modem

I think this is a nice feature to call a number and when he answers a wav or mp3 file plays

but is this really the right start?
i need your opinion before I start working on that because as you see the article is three years old :dozingoff:

another question
I when I start coding I intend to buy a modem for my laptop for testing the application but I think I can use my cell phone as a modem using the bluetooth
right?

I created a similar application that sends SMS through my cell phone connected to a COM port using bluetooth

So, I'm waiting for your opinions
I need to start soon
:)

Is This A Good Question/Topic? 0
  • +

Replies To: Making phone calls using C#

#2 Imdsm  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 103
  • View blog
  • Posts: 362
  • Joined: 21-March 09

Re: Making phone calls using C#

Posted 01 September 2010 - 12:59 AM

One reason you won't find many things on this is because modems and analogue phone calls aren't exactly this 'day and age'. Nowadays we work with VOIP. But there are some things out there, an hour isn't really that long searching.

It sounds to me like you have everything you need in that snippet. Just switch out the mp3 for mic audio.
Was This Post Helpful? 0
  • +
  • -

#3 Ahmedn1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 23
  • View blog
  • Posts: 556
  • Joined: 04-August 09

Re: Making phone calls using C#

Posted 01 September 2010 - 07:34 AM

everything works fine till the call request using this line

SP.Write("ATDT" + 0183862575 + Environment.NewLine);

where SP is a serialport object

when this line executes the number appears on my cell phone screen and is dialed
but a message "Check Operator services" appears and the call is cut

why is that happening

Although I'm sending SMS through the same phone using

SP.PortName = cboPort.Text;
            SP.BaudRate = 9600;
            SP.Parity = Parity.None;
            SP.DataBits = 8;
            SP.StopBits = StopBits.One;
            SP.RtsEnable = true;
            SP.DtrEnable = true;
            SP.Encoding.GetEncoder();
            SP.ReceivedBytesThreshold = 1;
            SP.NewLine = Environment.NewLine;
            try
            {
                SP.Open();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            SP.Write("AT" + Environment.NewLine);
            Thread.Sleep(500);
            SP.Write("AT+CMGF=1" + Environment.NewLine);//This line can be removed if your modem will always be in Text Mode...
            Thread.Sleep(500);

            SP.Write("AT+CMGS=" + (char)34 + TxtNumber.Text + (char)34 + Environment.NewLine);//ok here
            Thread.Sleep(1000);
            SP.Write(TxtMessage.Text + (char)26);
            Thread.Sleep(2000);

            MessageBox.Show("Message Sent");
            SP.Close();



and it sends perfect
Was This Post Helpful? 0
  • +
  • -

#4 Ahmedn1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 23
  • View blog
  • Posts: 556
  • Joined: 04-August 09

Re: Making phone calls using C#

Posted 01 September 2010 - 07:45 AM

View PostImdsm, on 31 August 2010 - 11:59 PM, said:

One reason you won't find many things on this is because modems and analogue phone calls aren't exactly this 'day and age'. Nowadays we work with VOIP. But there are some things out there, an hour isn't really that long searching.

It sounds to me like you have everything you need in that snippet. Just switch out the mp3 for mic audio.


so how can I use VOIP to make phone calls ?
I don't want code
just the way and I'll search about it
Was This Post Helpful? 0
  • +
  • -

#5 Imdsm  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 103
  • View blog
  • Posts: 362
  • Joined: 21-March 09

Re: Making phone calls using C#

Posted 01 September 2010 - 08:44 AM

VOIP is entirely different, that's Voice Over I P - VOIP :)

http://en.wikipedia....ternet_Protocol

This post has been edited by Imdsm: 01 September 2010 - 08:44 AM

Was This Post Helpful? 0
  • +
  • -

#6 Ahmedn1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 23
  • View blog
  • Posts: 556
  • Joined: 04-August 09

Re: Making phone calls using C#

Posted 01 September 2010 - 07:32 PM

View PostImdsm, on 01 September 2010 - 07:44 AM, said:

VOIP is entirely different, that's Voice Over I P - VOIP :)

http://en.wikipedia....ternet_Protocol


I read through that
and I understood that VOIP is used to make calls
but how
this article talks in general
I need to know how can I make a call from my PC to a cell phone or landline ?

P.S.: the previous snippet in my original post has worked
I changed some AT commands and I could make the cell phone make a call
but the problem is the other person can't hear the selected wave file when he answers

any ideas ?

This post has been edited by Ahmedn1: 01 September 2010 - 07:50 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1