none
How to get audio stream from GSM modem RRS feed

  • Question

  •  am working on a IoT Project with a GSM Module. What i am trying to achieve is you can insert your SIM in the GSM Modem and if you receive  Phone call it will automatically forward the call to an APP (Connected to a server and listen to a PORT) and from APP you can answer the call.

    i am using ATDnnnnnnn; (To dial number)

    I hope i have explained the concept.

    I am sharing the Code below.

    private const string SERIAL_PORT_NAME = "COM3";

    private static SerialPort _modemConnection;

                

     _modemConnection = new SerialPort(SERIAL_PORT_NAME)
                {
                    // 19200 baud, most modems will accept everything
                    // from 9600 up to 115200
                    BaudRate = 19200,
                    // 99% of the time the port connection will be
                    //8 Data bits
                    DataBits = 8,
                    // NO partiy
                    Parity = Parity.None,
                    // and 1 stop bit. Check your modem manual if
                    // this doesn't work
                    StopBits = StopBits.One
                };
                _modemConnection.Open();

     _modemConnection.DataReceived += new SerialDataReceivedEventHandler(data_received);

      private void data_received(object sender, SerialDataReceivedEventArgs e)
            {
                sp = (SerialPort)sender;
                //string indata = sp.ReadExisting();
                int x = sp.BytesToRead;
                buffer = new byte[x];
                sp.Read(buffer, 0, x);
               //TRYING TO READ CALL AUDIO STREAM 
             
            }

    Thanks in Advance.

    Wednesday, May 22, 2019 6:58 AM

All replies