Skip to content
Snippets Groups Projects
Commit c38714f4 authored by rswindell's avatar rswindell
Browse files

Fixed parsing of Caller-ID response messages.

Converts 'P' and 'O' CID responses to "Private" and "Out-of-area".
parent eb7d785c
No related branches found
No related tags found
No related merge requests found
......@@ -762,6 +762,7 @@ BOOL wait_for_call(HANDLE com_handle)
else if(strncmp(p,"NMBR",4)==0 || strncmp(p,"MESG",4)==0) {
p+=4;
FIND_CHAR(p,'=');
SKIP_CHAR(p,'=');
SKIP_WHITESPACE(p);
if(cid_number[0]==0) /* Don't overwrite, if multiple messages received */
SAFECOPY(cid_number, p);
......@@ -769,6 +770,7 @@ BOOL wait_for_call(HANDLE com_handle)
else if(strncmp(p,"NAME",4)==0) {
p+=4;
FIND_CHAR(p,'=');
SKIP_CHAR(p,'=');
SKIP_WHITESPACE(p);
SAFECOPY(cid_name, p);
}
......@@ -783,6 +785,16 @@ BOOL wait_for_call(HANDLE com_handle)
break;
}
if(strcmp(cid_name,"P")==0)
SAFECOPY(cid_name,"Private");
else if(strcmp(cid_name,"O")==0)
SAFECOPY(cid_name,"Out-of-area");
if(strcmp(cid_number,"P")==0)
SAFECOPY(cid_number,"Private");
else if(strcmp(cid_number,"O")==0)
SAFECOPY(cid_number,"Out-of-area");
lprintf(LOG_INFO,"Carrier detected on %s", com_dev);
return TRUE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment