return TRUE;
}
-static void propagate_encryption_changed(LinphoneCall *call){
+void propagate_encryption_changed(LinphoneCall *call){
if (call->core->vtable.call_encryption_changed == NULL) return;
if (!linphone_call_are_all_streams_encrypted(call)) {
OrtpZrtpParams params;
params.zid=get_zrtp_identifier(call->core);
params.zid_file=NULL; //unused
- OrtpZrtpUiCb cbs={0};
- cbs.data=call;
- cbs.encryption_changed=linphone_call_videostream_encryption_changed;
- params.ui_cbs=&cbs;
video_stream_enable_zrtp(call->videostream,call->audiostream,¶ms);
}
#endif
OrtpZrtpParams params;
params.zid=get_zrtp_identifier(lc);
params.zid_file=lc->zrtp_secrets_cache;
- OrtpZrtpUiCb cbs={0};
- cbs.data=call;
- cbs.encryption_changed=linphone_call_audiostream_encryption_changed;
- cbs.sas_ready=linphone_call_audiostream_auth_token_ready;
- params.ui_cbs=&cbs;
audio_stream_enable_zrtp(call->audiostream,¶ms);
}
ms_message("Thread processing load: audio=%f\tvideo=%f",audio_load,video_load);
}
#ifdef VIDEO_ENABLED
- if (call->videostream!=NULL)
+ if (call->videostream!=NULL) {
+ if (call->videostream->evq){
+ OrtpEvent *ev=ortp_ev_queue_get(call->videostream->evq);
+ if (ev!=NULL){
+ OrtpEventType evt=ortp_event_get_type(ev);
+ if (evt == ORTP_EVENT_ZRTP_ENCRYPTION_CHANGED){
+ OrtpEventData *evd=ortp_event_get_data(ev);
+ linphone_call_videostream_encryption_changed(call, evd->info.zrtp_stream_encrypted);
+ }
+ ortp_event_destroy(ev);
+ }
+ }
video_stream_iterate(call->videostream);
+ }
#endif
- if (call->audiostream!=NULL)
+ if (call->audiostream!=NULL) {
+ if (call->audiostream->evq){
+ OrtpEvent *ev=ortp_ev_queue_get(call->audiostream->evq);
+ if (ev!=NULL){
+ OrtpEventType evt=ortp_event_get_type(ev);
+ if (evt == ORTP_EVENT_ZRTP_ENCRYPTION_CHANGED){
+ OrtpEventData *evd=ortp_event_get_data(ev);
+ linphone_call_audiostream_encryption_changed(call, evd->info.zrtp_stream_encrypted);
+ } else if (evt == ORTP_EVENT_ZRTP_SAS_READY) {
+ OrtpEventData *evd=ortp_event_get_data(ev);
+ linphone_call_audiostream_auth_token_ready(call, evd->info.zrtp_sas.sas, evd->info.zrtp_sas.verified);
+ }
+ ortp_event_destroy(ev);
+ }
+ }
audio_stream_iterate(call->audiostream);
+ }
if (one_second_elapsed && call->audiostream!=NULL && disconnect_timeout>0 )
disconnected=!audio_stream_alive(call->audiostream,disconnect_timeout);
if (disconnected)
vTable.global_state_changed = globalStateChange;
vTable.registration_state_changed = registrationStateChange;
vTable.call_state_changed = callStateChange;
- //vTable.call_encryption_changed = callEncryptionChange;
+ vTable.call_encryption_changed = callEncryptionChange;
vTable.text_received = text_received;
vTable.new_subscription_request = new_subscription_request;
vTable.notify_presence_recv = notify_presence_recv;
- listernerClass = (jclass)env->NewGlobalRef(env->GetObjectClass( alistener));
+ listenerClass = (jclass)env->NewGlobalRef(env->GetObjectClass( alistener));
/*displayStatus(LinphoneCore lc,String message);*/
- displayStatusId = env->GetMethodID(listernerClass,"displayStatus","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;)V");
+ displayStatusId = env->GetMethodID(listenerClass,"displayStatus","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;)V");
/*void generalState(LinphoneCore lc,int state); */
- globalStateId = env->GetMethodID(listernerClass,"globalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GlobalState;Ljava/lang/String;)V");
+ globalStateId = env->GetMethodID(listenerClass,"globalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GlobalState;Ljava/lang/String;)V");
globalStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$GlobalState"));
globalStateFromIntId = env->GetStaticMethodID(globalStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$GlobalState;");
/*registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, LinphoneCore.RegistrationState cstate, String smessage);*/
- registrationStateId = env->GetMethodID(listernerClass,"registrationState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneProxyConfig;Lorg/linphone/core/LinphoneCore$RegistrationState;Ljava/lang/String;)V");
+ registrationStateId = env->GetMethodID(listenerClass,"registrationState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneProxyConfig;Lorg/linphone/core/LinphoneCore$RegistrationState;Ljava/lang/String;)V");
registrationStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$RegistrationState"));
registrationStateFromIntId = env->GetStaticMethodID(registrationStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$RegistrationState;");
/*callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State cstate,String message);*/
- callStateId = env->GetMethodID(listernerClass,"callState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;Lorg/linphone/core/LinphoneCall$State;Ljava/lang/String;)V");
+ callStateId = env->GetMethodID(listenerClass,"callState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;Lorg/linphone/core/LinphoneCall$State;Ljava/lang/String;)V");
callStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCall$State"));
callStateFromIntId = env->GetStaticMethodID(callStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCall$State;");
/*callEncryption(LinphoneCore lc, LinphoneCall call, boolean encrypted,String auth_token);*/
- callEncryptionChangedId=env->GetMethodID(listernerClass,"callEncryptionChanged","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;ZLjava/lang/String;)V");
+ callEncryptionChangedId=env->GetMethodID(listenerClass,"callEncryptionChanged","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;ZLjava/lang/String;)V");
/*void ecCalibrationStatus(LinphoneCore.EcCalibratorStatus status, int delay_ms, Object data);*/
- ecCalibrationStatusId = env->GetMethodID(listernerClass,"ecCalibrationStatus","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$EcCalibratorStatus;ILjava/lang/Object;)V");
+ ecCalibrationStatusId = env->GetMethodID(listenerClass,"ecCalibrationStatus","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$EcCalibratorStatus;ILjava/lang/Object;)V");
ecCalibratorStatusClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$EcCalibratorStatus"));
ecCalibratorStatusFromIntId = env->GetStaticMethodID(ecCalibratorStatusClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$EcCalibratorStatus;");
/*void newSubscriptionRequest(LinphoneCore lc, LinphoneFriend lf, String url)*/
- newSubscriptionRequestId = env->GetMethodID(listernerClass,"newSubscriptionRequest","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneFriend;Ljava/lang/String;)V");
+ newSubscriptionRequestId = env->GetMethodID(listenerClass,"newSubscriptionRequest","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneFriend;Ljava/lang/String;)V");
/*void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf);*/
- notifyPresenceReceivedId = env->GetMethodID(listernerClass,"notifyPresenceReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneFriend;)V");
+ notifyPresenceReceivedId = env->GetMethodID(listenerClass,"notifyPresenceReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneFriend;)V");
/*void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from,String message);*/
- textReceivedId = env->GetMethodID(listernerClass,"textReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneAddress;Ljava/lang/String;)V");
+ textReceivedId = env->GetMethodID(listenerClass,"textReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneAddress;Ljava/lang/String;)V");
proxyClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneProxyConfigImpl"));
proxyCtrId = env->GetMethodID(proxyClass,"<init>", "(J)V");
env->DeleteGlobalRef(core);
env->DeleteGlobalRef(listener);
if (userdata) env->DeleteGlobalRef(userdata);
- env->DeleteGlobalRef(listernerClass);
+ env->DeleteGlobalRef(listenerClass);
env->DeleteGlobalRef(globalStateClass);
env->DeleteGlobalRef(registrationStateClass);
env->DeleteGlobalRef(callStateClass);
jobject listener;
jobject userdata;
- jclass listernerClass;
+ jclass listenerClass;
jmethodID displayStatusId;
jmethodID newSubscriptionRequestId;
jmethodID notifyPresenceReceivedId;