mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
DTLS-SRTP init linphone console too
This commit is contained in:
parent
54e91b6394
commit
37e5ccfbc2
3 changed files with 14 additions and 7 deletions
|
|
@ -161,6 +161,7 @@ static int trace_level = 0;
|
|||
static char *logfile_name = NULL;
|
||||
static char configfile_name[PATH_MAX];
|
||||
static char zrtpsecrets[PATH_MAX];
|
||||
static char usr_certificates_path[PATH_MAX];
|
||||
static const char *factory_configfile_name=NULL;
|
||||
static char *sip_addr_to_call = NULL; /* for autocall */
|
||||
static int window_id = 0; /* 0=standalone window, or window id for embedding video */
|
||||
|
|
@ -680,6 +681,8 @@ linphonec_init(int argc, char **argv)
|
|||
getenv("HOME"));
|
||||
snprintf(zrtpsecrets, PATH_MAX, "%s/.linphone-zidcache",
|
||||
getenv("HOME"));
|
||||
snprintf(usr_certificates_path, PATH_MAX, "%s/.linphone-usr-crt",
|
||||
getenv("HOME"));
|
||||
#elif defined(_WIN32_WCE)
|
||||
strncpy(configfile_name,PACKAGE_DIR "\\linphonerc",PATH_MAX);
|
||||
mylogfile=fopen(PACKAGE_DIR "\\" "linphonec.log","w");
|
||||
|
|
@ -689,6 +692,8 @@ linphonec_init(int argc, char **argv)
|
|||
getenv("APPDATA"));
|
||||
snprintf(zrtpsecrets, PATH_MAX, "%s/Linphone/linphone-zidcache",
|
||||
getenv("APPDATA"));
|
||||
snprintf(usr_certificates_path, PATH_MAX, "%s/Linphone/linphone-usr-crt",
|
||||
getenv("APPDATA"));
|
||||
#endif
|
||||
/* Handle configuration filename changes */
|
||||
switch (handle_configfile_migration())
|
||||
|
|
@ -745,6 +750,7 @@ linphonec_init(int argc, char **argv)
|
|||
|
||||
linphone_core_set_user_agent(linphonec,"Linphonec", LINPHONE_VERSION);
|
||||
linphone_core_set_zrtp_secrets_file(linphonec,zrtpsecrets);
|
||||
linphone_core_set_user_certificates_path(linphonec,usr_certificates_path);
|
||||
linphone_core_enable_video_capture(linphonec, vcap_enabled);
|
||||
linphone_core_enable_video_display(linphonec, display_enabled);
|
||||
if (display_enabled && window_id != 0)
|
||||
|
|
|
|||
|
|
@ -1489,10 +1489,11 @@ static void misc_config_read(LinphoneCore *lc) {
|
|||
}else if (strcmp(uuid,"0")!=0) /*to allow to disable sip.instance*/
|
||||
sal_set_uuid(lc->sal, uuid);
|
||||
|
||||
/* DTLS: if media_encryption is DTLS, get or create the certificate directory */
|
||||
if (linphone_core_get_media_encryption(lc) == LinphoneMediaEncryptionDTLS) {
|
||||
/* TODO*/
|
||||
}
|
||||
/* DTLS: if media_encryption DTLS SRTP is available, get or create the certificate directory */
|
||||
/*if (ms_dtls_srtp_available()){
|
||||
*//*JOHAN: USELESS? REMOVE IT*/
|
||||
//const char *user_certificate_config_path = lp_config_get_string(config,"misc","uuid",);
|
||||
// }*/
|
||||
}
|
||||
|
||||
static void linphone_core_start(LinphoneCore * lc) {
|
||||
|
|
@ -6834,7 +6835,7 @@ bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, Linphone
|
|||
case LinphoneMediaEncryptionSRTP:
|
||||
return ms_srtp_supported();
|
||||
case LinphoneMediaEncryptionDTLS:
|
||||
return ms_dtls_available();
|
||||
return ms_dtls_srtp_available();
|
||||
case LinphoneMediaEncryptionZRTP:
|
||||
return ms_zrtp_available();
|
||||
case LinphoneMediaEncryptionNone:
|
||||
|
|
@ -6859,7 +6860,7 @@ int linphone_core_set_media_encryption(LinphoneCore *lc, LinphoneMediaEncryption
|
|||
ret=-1;
|
||||
}else type="zrtp";
|
||||
}else if (menc == LinphoneMediaEncryptionDTLS){
|
||||
if (!ms_dtls_available()){
|
||||
if (!ms_dtls_srtp_available()){
|
||||
ms_warning("DTLS not supported by library.");
|
||||
type="none";
|
||||
ret=-1;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 44b25ea43a65afc118d9586fca82bd772c41cd76
|
||||
Subproject commit c300a5806ca1f731fe2899aa39925c20dc825899
|
||||
Loading…
Add table
Reference in a new issue