added stubs for DNA lookup helper app (not yet complete).

cleaned up some unused variables.
This commit is contained in:
gardners 2012-06-21 08:07:03 +09:30
parent 3281f2c652
commit e5394dd143
6 changed files with 23 additions and 4 deletions

View File

@ -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 \

View File

@ -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 \

View File

@ -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;
}

View File

@ -1679,7 +1679,6 @@ int app_node_info(int argc, const char *const *argv, struct command_line_option
}
{
int bytes=m2.in.payload_length;
char did[512];
char name[512];
char uri[512];

View File

@ -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,7 +543,20 @@ 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

View File

@ -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);