diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index a980b51b1..642e3d188 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -280,7 +280,7 @@ static void call_updating(SalOp *op){ if (call->resultdesc && !sal_media_description_empty(call->resultdesc)) { - if (call->state==LinphoneCallPausedByRemote && + if ((call->state==LinphoneCallPausedByRemote || call->state==LinphoneCallPaused) && sal_media_description_has_dir(call->resultdesc,SalStreamSendRecv) && strcmp(call->resultdesc->addr,"0.0.0.0")!=0){ /*make sure we can be resumed */ if (lc->current_call!=NULL && lc->current_call!=call){ diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 6e9e4c45c..338c84336 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -227,10 +227,48 @@ static void linphone_call_set_terminated(LinphoneCall *call){ linphone_call_unref(call); } +const char *linphone_call_state_to_string(LinphoneCallState cs){ + switch (cs){ + case LinphoneCallIdle: + return "LinphoneCallIdle"; + case LinphoneCallIncomingReceived: + return "LinphoneCallIncomingReceived"; + case LinphoneCallOutgoingInit: + return "LinphoneCallOutgoingInit"; + case LinphoneCallOutgoingProgress: + return "LinphoneCallOutgoingProgress"; + case LinphoneCallOutgoingRinging: + return "LinphoneCallOutgoingRinging"; + case LinphoneCallOutgoingEarlyMedia: + return "LinphoneCallOutgoingEarlyMedia"; + case LinphoneCallConnected: + return "LinphoneCallConnected"; + case LinphoneCallStreamsRunning: + return "LinphoneCallStreamsRunning"; + case LinphoneCallPausing: + return "LinphoneCallPausing"; + case LinphoneCallPaused: + return "LinphoneCallPaused"; + case LinphoneCallResuming: + return "LinphoneCallResuming"; + case LinphoneCallRefered: + return "LinphoneCallRefered"; + case LinphoneCallError: + return "LinphoneCallRefered"; + case LinphoneCallEnd: + return "LinphoneCallEnd"; + case LinphoneCallPausedByRemote: + return "LinphoneCallPausedByRemote"; + } + return "undefined state"; +} + void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message){ LinphoneCore *lc=call->core; bool_t finalize_call=FALSE; if (call->state!=cstate){ + ms_message("Call %p: moving from state %s to %s",call,linphone_call_state_to_string(call->state), + linphone_call_state_to_string(cstate)); if (cstate!=LinphoneCallRefered){ /*LinphoneCallRefered is rather an event, not a state. Indeed it does not change the state of the call (still paused or running)*/ diff --git a/coreapi/sal.c b/coreapi/sal.c index 84f3d412b..463884d70 100644 --- a/coreapi/sal.c +++ b/coreapi/sal.c @@ -83,9 +83,9 @@ bool_t sal_media_description_has_dir(const SalMediaDescription *md, SalStreamDir int i; for(i=0;instreams;++i){ const SalStreamDescription *ss=&md->streams[i]; - if (ss->dir!=stream_dir) return FALSE; + if (ss->dir==stream_dir) return TRUE; } - return TRUE; + return FALSE; } static void assign_string(char **str, const char *arg){ diff --git a/gtk/main.c b/gtk/main.c index be173842e..8b416cf85 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -961,6 +961,7 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call break; case LinphoneCallResuming: linphone_gtk_enable_hold_button(call,TRUE,TRUE); + linphone_gtk_in_call_view_set_in_call (call); break; case LinphoneCallPausing: linphone_gtk_enable_hold_button(call,TRUE,FALSE); diff --git a/gtk/main.ui b/gtk/main.ui index 04f1ff17f..c4bcfa14d 100644 --- a/gtk/main.ui +++ b/gtk/main.ui @@ -545,12 +545,11 @@ True - + Mute - False True True - + False