mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-30 08:03:49 +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 importHlr(char *textfile);
|
||||||
int exportHlr(unsigned char *hlr,char *text);
|
int exportHlr(unsigned char *hlr,char *text);
|
||||||
int openHlrFile(char *backing_file,int size);
|
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_CIPHERED 1
|
||||||
#define CRYPT_SIGNED 2
|
#define CRYPT_SIGNED 2
|
||||||
|
17
server.c
17
server.c
@ -214,12 +214,15 @@ int processRequest(unsigned char *packet,int len,
|
|||||||
pofs+=messageLen;
|
pofs+=messageLen;
|
||||||
|
|
||||||
// Check if I'm the recipient
|
// Check if I'm the recipient
|
||||||
|
ofs=0;
|
||||||
// Send SMS to android
|
if (findHlr(hlr, &ofs, sid, did)){
|
||||||
char amCommand[576]; // 64 char + 2*256(max) char = 576
|
// Send SMS to android
|
||||||
sprintf(amCommand, "am broadcast -a org.servalproject.DT -e number \"%s\" -e content \"%s\"", emitterPhoneNumber, message);
|
char amCommand[576]; // 64 char + 2*256(max) char = 576
|
||||||
if (debug>1) fprintf(stderr,"Delivering DT message via intent: %s\n",amCommand);
|
sprintf(amCommand, "am broadcast -a org.servalproject.DT -e number \"%s\" -e content \"%s\"", emitterPhoneNumber, message);
|
||||||
int exitcode = runCommand(amCommand);
|
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;
|
break;
|
||||||
case ACTION_SET:
|
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
|
ask asterisk to re-read extensions.conf, and then make sure it has
|
||||||
a functional SIP gateway.
|
a functional SIP gateway.
|
||||||
*/
|
*/
|
||||||
if (!asteriskObtainGateway(sid,did,uri))
|
if (!asteriskObtainGateway(sid,did,(char *)uri))
|
||||||
{
|
{
|
||||||
|
|
||||||
fake.value_len=strlen((char *)uri);
|
fake.value_len=strlen((char *)uri);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user