Added VoMP call-pickup message handling.

This commit is contained in:
gardners 2012-04-20 05:25:48 +09:30
parent 57be9bef32
commit ea372aece2
2 changed files with 17 additions and 1 deletions

@ -1157,6 +1157,7 @@ typedef struct overlay_mdp_vompevent {
#define VOMPEVENT_REGISTERINTEREST (1<<7)
#define VOMPEVENT_WITHDRAWINTEREST (1<<8)
#define VOMPEVENT_CALLCREATED (1<<9)
#define VOMPEVENT_PICKUP (1<<10)
unsigned int flags;
unsigned short audio_sample_bytes;
unsigned char local_state;
@ -1244,7 +1245,7 @@ typedef struct vomp_call_half {
unsigned long long milliseconds_since_call_start;
} vomp_call_half;
typedef struct vomp_call_state {
typedef struct vomp_call_stateo {
vomp_call_half local;
vomp_call_half remote;
int ringing;

15
vomp.c

@ -316,6 +316,21 @@ int vomp_mdp_event(overlay_mdp_frame *mdp,
call->local.state=VOMP_STATE_CALLENDED;
return vomp_send_status(call,VOMP_TELLREMOTE|VOMP_TELLINTERESTED);
}
case VOMPEVENT_PICKUP:
{
vomp_call_state *call
=vomp_find_call_by_session(mdp->vompevent.call_session_token);
if (!call)
return overlay_mdp_reply_error
(mdp_named_socket,recvaddr,recvaddrlen,4006,
"No such call");
call->local.state=VOMP_STATE_INCALL;
call->ringing=0;
/* state machine does job of starting audio stream, just tell everyone about
the changed state. */
return vomp_send_status(call,VOMP_TELLREMOTE|VOMP_TELLINTERESTED);
}
break;
case VOMPEVENT_AUDIOSTREAMING: /* user supplying audio */
WHY("Handling of in-call audio not yet implemented");
break;