mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 02:39:44 +00:00
added stubs for DNA lookup helper app (not yet complete).
cleaned up some unused variables.
This commit is contained in:
parent
3281f2c652
commit
e5394dd143
@ -42,6 +42,7 @@ SERVALD_SRC_FILES = \
|
||||
serval-dna/keyring.c \
|
||||
serval-dna/vomp.c \
|
||||
serval-dna/lsif.c \
|
||||
serval-dna/dna_helper.c \
|
||||
serval-dna/monitor.c \
|
||||
serval-dna/monitor-cli.c \
|
||||
serval-dna/codecs.c \
|
||||
|
@ -45,6 +45,7 @@ SRCS= main.c \
|
||||
lsif.c \
|
||||
monitor.c \
|
||||
monitor-cli.c \
|
||||
dna_helper.c \
|
||||
codecs.c \
|
||||
audiodevices.c \
|
||||
audio_msm_g1.c \
|
||||
|
2
codecs.c
2
codecs.c
@ -48,6 +48,6 @@ int bufferAudioForPlayback(int codec,long long start_time,long long end_time,
|
||||
decode codecs etc here. */
|
||||
|
||||
/* send audio to device */
|
||||
int bytesWritten=audev->write(&data[0],dataLen);
|
||||
// int bytesWritten=audev->write(&data[0],dataLen);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1678,8 +1678,7 @@ int app_node_info(int argc, const char *const *argv, struct command_line_option
|
||||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
int bytes=m2.in.payload_length;
|
||||
{
|
||||
char did[512];
|
||||
char name[512];
|
||||
char uri[512];
|
||||
|
@ -509,6 +509,7 @@ int overlay_saw_mdp_frame(int interface, overlay_mdp_frame *mdp,long long now)
|
||||
bcopy(&mdp->out.src.sid[0],&srcsid[0],SID_SIZE);
|
||||
/* now switch addresses around for any replies */
|
||||
overlay_mdp_swap_src_dst(mdp);
|
||||
int results=0;
|
||||
while(keyring_find_did(keyring,&cn,&in,&kp,did))
|
||||
{
|
||||
/* package DID and Name into reply (we include the DID because
|
||||
@ -542,8 +543,21 @@ int overlay_saw_mdp_frame(int interface, overlay_mdp_frame *mdp,long long now)
|
||||
overlay_mdp_dispatch(mdp,0 /* system generated */,
|
||||
NULL,0);
|
||||
kp++;
|
||||
|
||||
results++;
|
||||
}
|
||||
if (!results) {
|
||||
/* No local results, so see if servald has been configured to use
|
||||
a DNA-helper that can provide additional mappings. This provides
|
||||
a generalised interface for resolving telephone numbers into URIs.
|
||||
The first use will be for resolving DIDs to SIP addresses for
|
||||
OpenBTS boxes run by the OTI/Commotion project.
|
||||
|
||||
The helper is run asynchronously, and the replies will be delivered
|
||||
when results become available, so this function will return
|
||||
immediately, so as not to cause blockages and delays in servald.
|
||||
*/
|
||||
dna_helper_enqueue(did,mdp->out.dst.sid);
|
||||
}
|
||||
/* and switch addresses back around in case the caller was planning on
|
||||
using MDP structure again (this happens if there is a loop-back reply
|
||||
and the frame needs sending on, as happens with broadcasts. MDP ping
|
||||
|
4
serval.h
4
serval.h
@ -1519,3 +1519,7 @@ int stopAudio();
|
||||
#define SERVER_NOTRUNNING 3
|
||||
#define SERVER_RUNNING 4
|
||||
int server_probe(int *pid);
|
||||
|
||||
int dna_helper_enqueue(char *did, unsigned char *requestorSid);
|
||||
int dna_return_resolution(overlay_mdp_frame *mdp, unsigned char *fromSid,
|
||||
const char *did,const char *name,const char *uri);
|
||||
|
Loading…
Reference in New Issue
Block a user