title: How to check if a call is active on SIM800L for Arduino?
body: <p><code>gprsTest.isCallActive(PHONE_NUMBER)</code> return always 0 even phone is ringing. Acording to <a href="https://github.com/Seeed-Studio/GPRS_SIM900/blob/master/GPRS_Shield_Arduino.cpp" rel="nofollow">GPRS_Shield_Arduino.cpp</a> from this <a href="https://github.com/Seeed-Studio/GPRS_SIM900" rel="nofollow">library</a> return  0 for ready, 2 for unknown, 3 for ringing, 4 for call in progress. What am I doing wrong? AT commnads are <a href="https://cdn-shop.adafruit.com/datasheets/sim800_series_at_command_manual_v1.01.pdf" rel="nofollow">here</a> .</p>
  
  <pre><code>#include &lt;GPRS_Shield_Arduino.h&gt;
  #include &lt;SoftwareSerial.h&gt;
  #include &lt;Wire.h&gt;
  
  
  #define PIN_TX    7
  #define PIN_RX    8
  #define BAUDRATE  9600
  #define PHONE_NUMBER "003xxxxxxxxxx"
  #define MESSAGE  "Temp is high"
  
  GPRS gprsTest(PIN_TX, PIN_RX, BAUDRATE); //RX,TX,BaudRate
  
  void setup() {
    Serial.begin(9600);
  
    // code 
  
  }
  
  void loop() {
  
  // ..code..
  
  
    if (temp&gt;35) {
      call_number();
    }
  
  // ..code..
  
  }
  
  void call_number() {
    Serial.println(gprsTest.isCallActive(PHONE_NUMBER));// return 0 that is ok
    Serial.println("Start to call...");
    gprsTest.callUp(PHONE_NUMBER); // It calls and phone is ringing 
    delay(4000);
    Serial.println(gprsTest.isCallActive(PHONE_NUMBER)); // It return again 0 when phone is ringing
  
  }
  </code></pre>
  
  <p>Edit 1: After Ouss4 answer as he said  <code>gprsTest.isCallActive(PHONE_NUMBER)</code> return 0 or 1. How can I modify this library or build my own function to check if call is active(ringing)?</p>
  
  <p>Edit 2: I changed to </p>
  
  <pre><code>char number[15] = "00306912345678";
  char numberToCallActive[15] = "00306912345678";
  ...
  setup(){
  ...
  
  ...
  }
  void call_number(){
    Serial.println(F("Before call"));
    Serial.println(gprsTest.isCallActive(numberToCallActive)); // return 0 , I uncomment Serial.print on cpp to print gprsBuffer
    Serial.println(F("start to call ... "));
    gprsTest.callUp(number);
    Serial.println(F("SUCCESS"));
    Serial.println(F("When phone is ringing"));
    Serial.println(gprsTest.isCallActive(numberToCallActive)); return 0 , I uncomment Serial.print on cpp to print gprsBuffer
    Serial.println(F("Again when phone is ringing"));
    Serial.println(gprsTest.isCallActive(numberToCallActive));return 0 , I uncomment Serial.print on cpp to print gprsBuffer
    Serial.print("\n");
  }
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>    Before call
      Buffer isCallActive 1: AT+CPAS
      +CPAS: 0
  
      OK
  
      0
      start to call ... 
      SUCCESS
      When phone is ringing
      Buffer isCallActive 1: ATD00306912345678;
      AT+CPAS
  
      0
      Again when phone is ringing
      Buffer isCallActive 1: 
      0
  </code></pre>