WORD GSM_SendCallToData(void)
{
WORD IndexDCID;
BYTE b, i, k;
WORD_VAL wvTemp;
BYTE temp[20];
for(b=0; b<strlen((char*)Gsm.ReceiveData); b++) if(Gsm.ReceiveData[b] == '"') break;
for(i=b+1, k=0; i<strlen((char*)Gsm.ReceiveData); i++, k++){
if(Gsm.ReceiveData[i] == '"'){
temp[k] = '\0';
break;
}
temp[k] = Gsm.ReceiveData[i];
}
for(IndexDCID=0; IndexDCID<MAX_DCID; IndexDCID++){
if((IndexAddressElement[IndexDCID][1] & 0x0f) == PHYSICAL_LAYER_GSM_CALL){
if(strstr(TableAddressSMS[IndexAddressElement[IndexDCID][0]].TelNumber, (const char*)(temp + 1)) != NULL){
wvTemp.byte.HB = DCID[IndexDCID][0];
wvTemp.byte.LB = DCID[IndexDCID][1];
break;
}
}
}
if(IndexDCID == MAX_DCID) return ERR_GSM_SendCallToData_TEL;
strcpy(bTemp, TableAddressSMS[IndexAddressElement[IndexDCID][0]].TelNumber);
API_PutEvent(wvTemp.Val, AE_GSM_VOICE_CALL, bTemp, strlen(bTemp));
return(ERR_OK);
}