I have arduino uno and shield sim 900 which I use for emergency cases. It calls certain number by holding the key for ten seconds. But the problem is if the number I am calling doesn't answer or rejects the call, I have to hold that key again for 10 seconds to cancel the call. Arduino recognizes the call as an active one. And if that other side picks up I have to hold for 10 seconds to end call. I need someone who will make sure that the call will automatically end if the other side ends the call, rejects it or ignores it, so I don't have to hold the key every time to end it. I'll pay for that service.
VIBER, WHATSUPP, FACEBOOK....
#include "SIM900.h"
#include <SoftwareSerial.h>
#include "call.h"
#define ACTIVE LOW
const int ledPin = 13; // the number of the LED pin
CallGSM call;
boolean started = false;
int buttonState = 1;
const int buttonPin = 7; // the number of the pushbutton pin
boolean calling = false;
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
digitalWrite(buttonPin, HIGH);
if (gsm.begin(9600))
{
Serial.println("\nstatus=READY");
started = true;
}
else
Serial.println("\nstatus=IDLE");
}
void loop()
{
unsigned int timer = 0;
while(digitalRead(buttonPin) == ACTIVE){
timer++;
delay(1000);
if(timer > 10) break;
}
buttonState = digitalRead(buttonPin);
if (buttonState == ACTIVE && timer > 10) {
if (calling)
{
digitalWrite(ledPin, LOW);
calling = false;
call.HangUp();
delay(1000);
} else
{
calling = true;
digitalWrite(ledPin, HIGH);
delay(1000);
call.Call("number"); "number"
;
}
}
}