mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
Add find hlr check, fix compile errors
This commit is contained in:
parent
ad53f85f8f
commit
803def3633
2
mphlr.h
2
mphlr.h
@ -343,6 +343,8 @@ int fixResponses(struct response_set *responses);
|
||||
int importHlr(char *textfile);
|
||||
int exportHlr(unsigned char *hlr,char *text);
|
||||
int openHlrFile(char *backing_file,int size);
|
||||
int runCommand(char *cmd);
|
||||
int asteriskObtainGateway(char *requestor_sid,char *did,char *uri_out);
|
||||
|
||||
#define CRYPT_CIPHERED 1
|
||||
#define CRYPT_SIGNED 2
|
||||
|
17
server.c
17
server.c
@ -214,12 +214,15 @@ int processRequest(unsigned char *packet,int len,
|
||||
pofs+=messageLen;
|
||||
|
||||
// Check if I'm the recipient
|
||||
|
||||
// Send SMS to android
|
||||
char amCommand[576]; // 64 char + 2*256(max) char = 576
|
||||
sprintf(amCommand, "am broadcast -a org.servalproject.DT -e number \"%s\" -e content \"%s\"", emitterPhoneNumber, message);
|
||||
if (debug>1) fprintf(stderr,"Delivering DT message via intent: %s\n",amCommand);
|
||||
int exitcode = runCommand(amCommand);
|
||||
ofs=0;
|
||||
if (findHlr(hlr, &ofs, sid, did)){
|
||||
// Send SMS to android
|
||||
char amCommand[576]; // 64 char + 2*256(max) char = 576
|
||||
sprintf(amCommand, "am broadcast -a org.servalproject.DT -e number \"%s\" -e content \"%s\"", emitterPhoneNumber, message);
|
||||
if (debug>1) fprintf(stderr,"Delivering DT message via intent: %s\n",amCommand);
|
||||
int exitcode = runCommand(amCommand);
|
||||
respondSimple(sid,ACTION_OKAY,NULL,0,transaction_id,CRYPT_CIPHERED|CRYPT_SIGNED);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_SET:
|
||||
@ -401,7 +404,7 @@ int processRequest(unsigned char *packet,int len,
|
||||
ask asterisk to re-read extensions.conf, and then make sure it has
|
||||
a functional SIP gateway.
|
||||
*/
|
||||
if (!asteriskObtainGateway(sid,did,uri))
|
||||
if (!asteriskObtainGateway(sid,did,(char *)uri))
|
||||
{
|
||||
|
||||
fake.value_len=strlen((char *)uri);
|
||||
|
Loading…
x
Reference in New Issue
Block a user