]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone
authorJehan Monnier <jehan.monnier@linphone.org>
Mon, 13 Sep 2010 15:08:31 +0000 (17:08 +0200)
committerJehan Monnier <jehan.monnier@linphone.org>
Mon, 13 Sep 2010 15:08:31 +0000 (17:08 +0200)
coreapi/callbacks.c
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/sal.c
gtk/main.c
gtk/main.ui
share/rings/silence.wav [new file with mode: 0644]

index a980b51b12445f19796bd7f92ec3c1c2544302ac..642e3d18808697d25904639b5fff727e5cf16793 100644 (file)
@@ -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){
index 6e9e4c45cf63f60f34813cdaddf09d260f665d5a..338c84336cf4b311de914f1f1af1bcc743365075 100644 (file)
@@ -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)*/
index 4b79993eb137416a460ceea5bf397db120c40bb0..bbb1897534c119a10aba12fe55dc1ae900b679a5 100644 (file)
@@ -1664,14 +1664,14 @@ void linphone_core_iterate(LinphoneCore *lc){
                                /*start the call even if the OPTIONS reply did not arrive*/
                                linphone_core_start_invite(lc,call,NULL);
                        }
-                       if (call->dir==LinphoneCallIncoming && call->state==LinphoneCallOutgoingRinging){
-                               elapsed=curtime-call->start_time;
-                               ms_message("incoming call ringing for %i seconds",elapsed);
-                               if (elapsed>lc->sip_conf.inc_timeout){
-                                       call->log->status=LinphoneCallMissed;
-                                       linphone_core_terminate_call(lc,call);
-                               }
+               if (call->dir==LinphoneCallIncoming && call->state==LinphoneCallOutgoingRinging){
+                       elapsed=curtime-call->start_time;
+                       ms_message("incoming call ringing for %i seconds",elapsed);
+                       if (elapsed>lc->sip_conf.inc_timeout){
+                               call->log->status=LinphoneCallMissed;
+                               linphone_core_terminate_call(lc,call);
                        }
+               }
        }
        call = linphone_core_get_current_call(lc);
        if(call)
@@ -3363,7 +3363,13 @@ static MSFilter *get_dtmf_gen(LinphoneCore *lc){
        }
        if (lc->ringstream==NULL){
                MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard;
-               lc->ringstream=ring_start(NULL,0,ringcard);
+               const char *playfile;
+#ifdef ANDROID
+               playfile="/data/data/org.linphone/files/silence.wav";
+#else
+               playfile=NULL;
+#endif
+               lc->ringstream=ring_start(playfile,0,ringcard);
                lc->dmfs_playing_start_time=time(NULL);
        }else{
                if (lc->dmfs_playing_start_time!=0)
index 84f3d412b2cc61fdf541ff82c3c5327e06f7ff76..463884d709c01c448d3e98425f034789927e01de 100644 (file)
@@ -83,9 +83,9 @@ bool_t sal_media_description_has_dir(const SalMediaDescription *md, SalStreamDir
        int i;
        for(i=0;i<md->nstreams;++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){
index be173842eb6a3c1a73f0685044bff0bda87bd896..8b416cf85340af1ff1d1aee38e7b1e3172ba5acf 100644 (file)
@@ -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);
index 04f1ff17f1f7926aece81d093595c13bede4f206..c4bcfa14d07a99bdd5f6e9b3e97b30ea81d07c5a 100644 (file)
                                   <object class="GtkHBox" id="hbox7">
                                     <property name="visible">True</property>
                                     <child>
-                                      <object class="GtkToggleButton" id="main_mute">
+                                      <object class="GtkButton" id="main_mute">
                                         <property name="label" translatable="yes">Mute</property>
-                                        <property name="sensitive">False</property>
                                         <property name="can_focus">True</property>
                                         <property name="receives_default">True</property>
-                                        <signal name="toggled" handler="linphone_gtk_mute_toggled"/>
+                                        <signal name="clicked" handler="linphone_gtk_mute_clicked"/>
                                       </object>
                                       <packing>
                                         <property name="fill">False</property>
diff --git a/share/rings/silence.wav b/share/rings/silence.wav
new file mode 100644 (file)
index 0000000..b57d2fb
Binary files /dev/null and b/share/rings/silence.wav differ