From 40bb0ab14bb41c2211550c3f463adf35f386a17a Mon Sep 17 00:00:00 2001 From: gardners Date: Sun, 22 Apr 2012 19:00:36 +0930 Subject: [PATCH] monitor commandline app now basically works. State changes get shown, and current conditions get repeated every tick. Eventually we may need to squelch the ticks to make life simpler for the phone application. --- vomp.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/vomp.c b/vomp.c index b188fabb..c1df9839 100644 --- a/vomp.c +++ b/vomp.c @@ -1005,7 +1005,33 @@ int app_vomp_monitor(int argc, char **argv, struct command_line_option *o) int ttl; if (overlay_mdp_client_poll(0)>0) if (!overlay_mdp_recv(&rx,&ttl)) - dump("monitored message",&rx,overlay_mdp_relevant_bytes(&rx)); + { + switch(rx.packetTypeAndFlags) { + case MDP_ERROR: + fprintf(stderr,"MDP Server error #%d: '%s'\n", + rx.error.error,rx.error.message); + break; + case MDP_VOMPEVENT: + fprintf(stderr,"VoMP call descriptor %06x %s:%s", + rx.vompevent.call_session_token, + vomp_describe_state(rx.vompevent.local_state), + vomp_describe_state(rx.vompevent.remote_state)); + if (rx.vompevent.flags&VOMPEVENT_RINGING) + fprintf(stderr," RINGING"); + if (rx.vompevent.flags&VOMPEVENT_CALLENDED) + fprintf(stderr," CALLENDED"); + if (rx.vompevent.flags&VOMPEVENT_CALLREJECT) + fprintf(stderr," CALLREJECTED"); + if (rx.vompevent.flags&VOMPEVENT_CALLCREATED) + fprintf(stderr," CREATED"); + if (rx.vompevent.flags&VOMPEVENT_AUDIOSTREAMING) + fprintf(stderr," AUDIOSTREAMING"); + fprintf(stderr,"\n"); + break; + default: + fprintf(stderr,"Unknown message (type=0x%02x)\n",rx.packetTypeAndFlags); + } + } }