Question

I have done all call dialling part and it works. Now I need to play recorded sound or microphone in put sound through phone.I just need to know how can I pass the audio to the dongle and send it through the call.

this is my working code for dialling phone number

SerialPort port = new SerialPort();
port.Open();
string t = port.ReadExisting();
Thread.Sleep(100);

string cmd = "ATD";
string phoneNumber = "071********";
port.WriteLine(cmd + phoneNumber + ";\r");


port.Close();
Was it helpful?

Solution

For your modem, you have 3 COM port available. One is for sending AT command, the second one is for sending data (voice data), and the last one is for monitoring the asynchronous status change.

When you place a call (with ATD), you'll have to wait for "^CONN: 1, 0" on the monitoring port.

Then you need a sound source with 8KHz, 16 bit signed, 1 channel. Write 320 bytes of this source on the data port, each 20ms.

You'll also read 320 bytes of data from this port, each 20ms for the other side speaking.

When you get "^CEND: ...", then the call is terminated.

Beware of few catch however. You'll get "^CONN: 1, 0" even if the other side rejected you call. So, try to read data from the data port first to check if the other side is still there after a ^CONN message.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top