how can extract number from +clip order

My project is about getting contact number, so far I can shown number of contact is ringing in the serial monitor But my problem is that I can not extract number from +clip order , please help and tell me how can extract number and store that in the variable

#include <SoftwareSerial.h>
SoftwareSerial SIM808(10, 11);
#define GSMReset 5
char inData[50];
char inChar;
byte index = 0;
void setup() {
Serial.begin(9600); // for serial monitor
SIM808.begin(9600); // for GSM shield
gsmPower();
gsmConfig();

}
//*******************************************************************************************
void loop() {

}
//*******************************************************************************************

void gsmPower() {
Serial.println("Turning GSM ON");
digitalWrite(GSMReset, HIGH);
delay(10);
digitalWrite(GSMReset, LOW);
delay(100);
digitalWrite(GSMReset, HIGH);
delay(7000);
sendCommand("AT\n", 100);
Serial.println(" 'A' answer and 'R' reject ! ");
}

//*******************************************************************************************
void callprocess() {
if (SIM808.available())

{
delay(2000);
sendCommand("AT+CLIP=1 \r \n", 100);
//String code = "+CLIP:"09111111111",145,"",0,"",0,," ;
//int firstClosingBracket = code.indexOf('"');
//int secondOpeningBracket = firstClosingBracket + 1;
//int secondClosingBracket = code.indexOf('"', secondOpeningBracket);
//String number = code.substring(7, 18);
//Serial.println(number);
}
}
//*******************************************************************************************
void sendCommand(String cmd, int t)
{
SIM808.println(cmd);
delay(t);
readSerial();
}
//*******************************************************************************************
void readSerial() {
while (SIM808.available())
Serial.write(SIM808.read());
}
//*******************************************************************************************
void gsmConfig() {
while (1) {
char c = Serial.read();
if (c == 'A') {
sendCommand("\n ATA\r\n", 100);
Serial.println("\n call is accept !");
}
if (c == 'R') {
sendCommand("\n ATH\r\n", 100);
Serial.println("\n call is reject !");

}

callprocess();

}
}
//****************************************************************************************

so far I can shown number of contact is ringing in the serial monitor

But, you don't seem to be able to show us that code, or any proof that you do more with the data than print it (like save it to an array).

please help

Not possible, since you posted no code.


i adding my code
and this picture is result of compile and serial monitor

Please post your code using code tags. Please copy the data from serial monitor and post it using code tags.

Don't use images.

Briefly looking at the output, use strchr() to find the first double quote, another strchr() to find the second one and you basically have the text that you're looking for; needs a little finetuning.

i adding my code

Don't go back and modify your original post. The code was NOT there when I made my comment. The fact that it is there now makes me look like an idiot. I don't try to help people that do that.

 #include <SoftwareSerial.h>
SoftwareSerial SIM808(10, 11);
#define GSMReset 5
char inData[50];
char inChar;
byte index = 0;
void setup() {
  Serial.begin(9600); // for serial monitor
  SIM808.begin(9600); // for GSM shield
  gsmPower();
  gsmConfig();

}
//*******************************************************************************************
void loop() {

}
//*******************************************************************************************

void gsmPower() {
  Serial.println("Turning GSM ON");
  digitalWrite(GSMReset, HIGH);
  delay(10);
  digitalWrite(GSMReset, LOW);
  delay(100);
  digitalWrite(GSMReset, HIGH);
  delay(7000);
  sendCommand("AT\n", 100);
  Serial.println(" 'A' answer and 'R' reject  ! ");
}

//*******************************************************************************************
void callprocess() {
  if (SIM808.available())

  {
    delay(2000);
    sendCommand("AT+CLIP=1 \r \n", 100);
    //String code = "+CLIP:\"09111111111\",145,"",0,"",0,," ;
    //int firstClosingBracket = code.indexOf('"');
    //int secondOpeningBracket = firstClosingBracket + 1;
    //int secondClosingBracket = code.indexOf('"', secondOpeningBracket);
    //String number = code.substring(7, 18);
    //Serial.println(number);
  }
}
//*******************************************************************************************
void sendCommand(String cmd, int t)
{
  SIM808.println(cmd);
  delay(t);
  readSerial();
}
//*******************************************************************************************
void readSerial() {
  while (SIM808.available())
    Serial.write(SIM808.read());
}
//*******************************************************************************************
void gsmConfig() {
  while (1) {
    char c = Serial.read();
    if (c == 'A') {
      sendCommand("\n ATA\r\n", 100);
      Serial.println("\n call is accept !");
    }
    if (c == 'R') {
      sendCommand("\n ATH\r\n", 100);
      Serial.println("\n call is reject !");

    }

    callprocess();

  }
}
//****************************************************************************************

this is shown in the serial monitor
Turning GSM ON
AT

OK
'A' answer and 'R' reject !

RING

+CLIP: "+989108793902",145,"",0,"",0
AT+CLIP=1

RING

PaulS:
Don't go back and modify your original post. The code was NOT there when I made my comment. The fact that it is there now makes me look like an idiot. I don't try to help people that do that.

I'm sorry for the mistake I did not intend to disrespect

There is a thread called 'Serial Input Basics - updated'. I think you can apply the basics instead if your readSerial() function.

You're grasp of what happens seems to be a bit loose.
You only need to send +CLIP=1/r once - as part of the modem initialization.

Then - when an incoming call arrives - you will get either a ::

+CLIP: xxxxxxxxxxxxxxxxxxxx
or
RING/r/n+CLIP: xxxxxxxxxxxxxxxxxxxx

notification (this can be set in the AT commands)

HOWEVER - in my other thread - the returned +CLIP data is incorrect until after the second RING has been received. This is not mentioned in the modem manual, but is in fact part of the way CLI data is delivered by the telcos.

OK - now we have that out of the way. Please change to using char[] arrays instead of the String class. It's more memory efficient, faster and portable. I for one, won't even read String based questions. You were lucky the +CLIP caught my eye!

And use code tags to surround your posted code snippets!