Search code examples
arduinocallgsmat-command

Is there any way to ring multiple phone number at once using arduino and gsm module?


Is there any way to ring multiple phone numbers at once using Arduino and gsm module? I check everywhere on the internet and haven't found anything useful. I tried using the below code, but it only rings the first number. I need to ring 3 numbers at once. Later I'm going to connect this with another code and make the calls happen when the sensor detects something.

#include <SoftwareSerial.h>
SoftwareSerial mySerial(11, 10); 

void setup()
{
  mySerial.begin(9600);
  Serial.begin(9600);

  Serial.println("Initializing..."); 
}


void loop()
{
  if(Serial.available() > 0)
  switch (Serial.read())
  {
     case 'c':
    MakeCall1();
    break;

     case 'x':
    HangCall();
    break;
    }
if (mySerial.available() > 0)
    Serial.write(mySerial.read());
}

 void MakeCall1()
{
  mySerial.println("ATD +ZZxxxxxxxxx;");
  Serial.println("Calling 1");
  delay(1000);
  mySerial.println("ATD +ZZxxxxxxxxx;");
  Serial.println("Calling 2");
  delay(1000);
  mySerial.println("ATD +ZZxxxxxxxxx;");
  Serial.println("Calling 3");
  delay(1000);

  delay(1000); 
  }

    void HangCall()
{
  mySerial.println("ATH; ");
  delay(1000);
  Serial.println("Cut call ");
  delay(1000); 
  }

Any help would be greatly appreciated. Thanks


Solution

  • TL; DR

    No you can't with an arduino.

    Explanation

    Because of the nature of Arduino, you can't really write asynchronous code that executes concurrently so your only life-saver would either be that your GSM module had a built-in AT command for expressively doing so; or wiring several GSM modules to the arduino and leaving AT commands to each of them. Still that would be one after the other and not really at the same time.

    Another solution would be to actually send a signal to a remote server of some kind and have the server perform several calls at the same time through VoIP