]> sjero.net Git - linphone/commitdiff
dtmf should be notified from main thread
authorSimon Morlat <simon.morlat@linphone.org>
Tue, 2 Oct 2012 15:31:39 +0000 (17:31 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Tue, 2 Oct 2012 15:32:03 +0000 (17:32 +0200)
coreapi/linphonecall.c

index 95bc621063a5bc616492d02257e6233190526b9d..cb5397d782d6c1ca4d2fb151bdf4df0fcf4b091b 100644 (file)
@@ -1078,8 +1078,7 @@ void linphone_call_init_media_streams(LinphoneCall *call){
 
 static int dtmf_tab[16]={'0','1','2','3','4','5','6','7','8','9','*','#','A','B','C','D'};
 
-static void linphone_core_dtmf_received(RtpSession* s, int dtmf, void* user_data){
-       LinphoneCore* lc = (LinphoneCore*)user_data;
+static void linphone_core_dtmf_received(LinphoneCore *lc, int dtmf){
        if (dtmf<0 || dtmf>15){
                ms_warning("Bad dtmf value %i",dtmf);
                return;
@@ -1169,7 +1168,7 @@ static void post_configure_audio_streams(LinphoneCall*call){
        if (lc->vtable.dtmf_received!=NULL){
                /* replace by our default action*/
                audio_stream_play_received_dtmfs(call->audiostream,FALSE);
-               rtp_session_signal_connect(call->audiostream->session,"telephone-event",(RtpCallback)linphone_core_dtmf_received,(unsigned long)lc);
+               /*rtp_session_signal_connect(call->audiostream->session,"telephone-event",(RtpCallback)linphone_core_dtmf_received,(unsigned long)lc);*/
        }
 }
 
@@ -1955,6 +1954,8 @@ void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapse
                        } else if ((evt == ORTP_EVENT_ICE_SESSION_PROCESSING_FINISHED) || (evt == ORTP_EVENT_ICE_GATHERING_FINISHED)
                                || (evt == ORTP_EVENT_ICE_LOSING_PAIRS_COMPLETED) || (evt == ORTP_EVENT_ICE_RESTART_NEEDED)) {
                                handle_ice_events(call, ev);
+                       } else if (evt==ORTP_EVENT_TELEPHONE_EVENT){
+                               linphone_core_dtmf_received(lc,evd->info.telephone_event);
                        }
                        ortp_event_destroy(ev);
                }