I was working with the getvoiceCallStatus() method of the GSM library and was placing calls through the voiceCall() method.
While doing that I realized that the voiceCall() method gets stuck in a loop until the other side answers the call in some way.
That leads me to the question why the getvoiceCallStatus() method even has the ability to return a status called "CALLING" (see: http://arduino.cc/en/Reference/GSMVCSGetVoiceCallStatus ) for the voiceCall() method seems to be the only way to place a call with the library.
Is that a flaw or a work-in-progress of the library or am i overseeing something? Is there a reason for that function?
an example code that should show the problem that i have:
// libraries
#include <GSM.h>
#define PINNUMBER ""
GSM gsmAccess;
GSMVoiceCall vcs;
String remoteNumber = ""; // the number you will call
char charbuffer[20];
void setup()
{
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("Make Voice Call");
boolean notConnected = true;
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized.");
Serial.println("Enter phone number to call.");
}
void loop()
{
while (Serial.available() > 0)
{
char inChar = Serial.read();
// if it's a newline, that means you should make the call:
if (inChar == '\n')
{
// make sure the phone number is not too long:
if (remoteNumber.length() < 20)
{
// let the user know you're calling:
Serial.print("Calling to : ");
Serial.println(remoteNumber);
Serial.println();
// Call the remote number
remoteNumber.toCharArray(charbuffer, 20);
vcs.voiceCall(charbuffer))
remoteNumber="";
Serial.println(vcs.getvoiceCallStatus());
}
else
{
Serial.println("That's too long for a phone number. I'm forgetting it");
remoteNumber = "";
}
}
else
{
// add the latest character to the message to send:
if(inChar!='\r')
remoteNumber += inChar;
}
}
}
more to read up on the problem in particular here:
http://forum.arduino.cc/index.php?topic=264959.0