mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-30 08:03:49 +00:00
Added VOMPEVENT_CALLINFO MDP message flag to get info on
specified call (if present), and summary of all valid calls (session token + state)
This commit is contained in:
parent
cbb4df7c11
commit
ddeb316421
5
serval.h
5
serval.h
@ -1140,6 +1140,7 @@ typedef struct overlay_mdp_addrlist {
|
||||
} overlay_mdp_addrlist;
|
||||
|
||||
#define MDP_VOMPEVENT 7
|
||||
#define VOMP_MAX_CALLS 16
|
||||
typedef struct overlay_mdp_vompevent {
|
||||
/* Once a call has been established, this is how the MDP/VoMP server
|
||||
and user-end process talk about the call. */
|
||||
@ -1172,6 +1173,10 @@ typedef struct overlay_mdp_vompevent {
|
||||
unsigned char remote_did[64];
|
||||
unsigned char local_sid[SID_SIZE];
|
||||
unsigned char remote_sid[SID_SIZE];
|
||||
/* session numbers of other calls in progress
|
||||
(for VOMPEVENT_CALLINFO) */
|
||||
unsigned int other_calls_sessions[VOMP_MAX_CALLS];
|
||||
unsigned char other_calls_states[VOMP_MAX_CALLS];
|
||||
};
|
||||
unsigned char audio_bytes[MDP_MTU-100];
|
||||
};
|
||||
|
13
vomp.c
13
vomp.c
@ -31,7 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
to progress the call to a further state. */
|
||||
int vomp_call_count=0;
|
||||
int vomp_active_call=-1;
|
||||
#define VOMP_MAX_CALLS 16
|
||||
vomp_call_state vomp_call_states[VOMP_MAX_CALLS];
|
||||
|
||||
/* Now keep track of who wants to know what we are up to */
|
||||
@ -285,6 +284,18 @@ int vomp_mdp_event(overlay_mdp_frame *mdp,
|
||||
bcopy(call->local.did,mdpreply.vompevent.local_did,64);
|
||||
bcopy(call->remote.did,mdpreply.vompevent.remote_did,64);
|
||||
|
||||
/* and provide a quick summary of all calls in progress */
|
||||
int i;
|
||||
for(i=0;i<VOMP_MAX_CALLS;i++)
|
||||
{
|
||||
if (i<vomp_call_count) {
|
||||
mdpreply.vompevent.other_calls_sessions[i]
|
||||
=vomp_call_states[i].local.session;
|
||||
mdpreply.vompevent.other_calls_states[i]
|
||||
=vomp_call_states[i].local.state;
|
||||
}
|
||||
}
|
||||
|
||||
return overlay_mdp_reply(mdp_named_socket,recvaddr,recvaddrlen,&mdpreply);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user