} else {
tr.tcp_port=lp_config_get_int(lc->config,"sip","sip_tcp_port",0);
}
+ if (lp_config_get_int(lc->config,"sip","sip_tls_random_port",0)) {
+ tr.tls_port=(0xDFF&+random())+1024;
+ } else {
+ tr.tls_port=lp_config_get_int(lc->config,"sip","sip_tls_port",0);
+ }
/*start listening on ports*/
linphone_core_set_sip_transports(lc,&tr);
ms_free(contact);
}
+ sal_root_ca(lc->sal, lp_config_get_string(lc->config,"sip","root_ca", "/etc/ssl/certs"));
+
tmp=lp_config_get_int(lc->config,"sip","guess_hostname",1);
linphone_core_set_guess_hostname(lc,tmp);
linphone_core_assign_payload_type(&payload_type_pcmu8000,0,NULL);
linphone_core_assign_payload_type(&payload_type_gsm,3,NULL);
linphone_core_assign_payload_type(&payload_type_pcma8000,8,NULL);
+ linphone_core_assign_payload_type(&payload_type_g722,9,NULL);
linphone_core_assign_payload_type(&payload_type_lpc1015,115,NULL);
linphone_core_assign_payload_type(&payload_type_speex_nb,110,"vbr=on");
linphone_core_assign_payload_type(&payload_type_speex_wb,111,"vbr=on");
linphone_core_assign_payload_type(&payload_type_mp4v,99,"profile-level-id=3");
linphone_core_assign_payload_type(&payload_type_x_snow,100,NULL);
linphone_core_assign_payload_type(&payload_type_h264,102,"profile-level-id=428014");
+ linphone_core_assign_payload_type(&payload_type_vp8,103,NULL);
/* due to limited space in SDP, we have to disable this h264 line which is normally no more necessary */
/* linphone_core_assign_payload_type(&payload_type_h264,103,"packetization-mode=1;profile-level-id=428014");*/
#endif
int linphone_core_get_sip_port(LinphoneCore *lc)
{
LCSipTransports *tr=&lc->sip_conf.transports;
- return tr->udp_port>0 ? tr->udp_port : tr->tcp_port;
+ return tr->udp_port>0 ? tr->udp_port : (tr->tcp_port > 0 ? tr->tcp_port : tr->tls_port);
}
static char _ua_name[64]="Linphone";
sal_unlisten_ports (sal);
if (tr->udp_port>0){
if (sal_listen_port (sal,anyaddr,tr->udp_port,SalTransportUDP,FALSE)!=0){
- transport_error(lc,"UDP",tr->udp_port);
+ transport_error(lc,"udp",tr->udp_port);
return -1;
}
}
if (tr->tcp_port>0){
if (sal_listen_port (sal,anyaddr,tr->tcp_port,SalTransportTCP,FALSE)!=0){
- transport_error(lc,"TCP",tr->tcp_port);
+ transport_error(lc,"tcp",tr->tcp_port);
+ }
+ }
+ if (tr->tls_port>0){
+ if (sal_listen_port (sal,anyaddr,tr->tls_port,SalTransportTLS,TRUE)!=0){
+ transport_error(lc,"tls",tr->tls_port);
}
}
apply_user_agent(lc);
#ifdef VIDEO_ENABLED
if (call->videostream!=NULL){
video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
+ if (call->camera_active)
+ call->videostream->cam=lc->video_conf.device; /*to take into account eventual cam changes*/
video_stream_update_video_params (call->videostream);
}
#endif
return lc->sound_conf.local_ring;
}
+ /**
+ * Sets the path to a file or folder containing trusted root CAs (PEM format)
+ *
+ * @param path
+ * @param lc The LinphoneCore object
+ *
+ * @ingroup media_parameters
+ **/
+ void linphone_core_set_root_ca(LinphoneCore *lc,const char *path){
+ sal_root_ca(lc->sal, path);
+ }
+
static void notify_end_of_ring(void *ud, MSFilter *f, unsigned int event, void *arg){
LinphoneCore *lc=(LinphoneCore*)ud;
lc->preview_finished=1;
* If not set the core will create its own window.
**/
void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id){
+#ifdef VIDEO_ENABLED
lc->preview_window_id=id;
+ LinphoneCall *call=linphone_core_get_current_call(lc);
+ if (call!=NULL && call->videostream){
+ video_stream_set_native_preview_window_id(call->videostream,id);
+ }
+#endif
}
/**
sip_config_t *config=&lc->sip_conf;
lp_config_set_int(lc->config,"sip","sip_port",config->transports.udp_port);
lp_config_set_int(lc->config,"sip","sip_tcp_port",config->transports.tcp_port);
+ lp_config_set_int(lc->config,"sip","sip_tls_port",config->transports.tls_port);
lp_config_set_int(lc->config,"sip","guess_hostname",config->guess_hostname);
lp_config_set_string(lc->config,"sip","contact",config->contact);
lp_config_set_int(lc->config,"sip","inc_timeout",config->inc_timeout);
ms_error("linphone_core_remove_iterate_hook(): No such hook found.");
}
-
+ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){
+ if (lc->zrtp_secrets_cache != NULL) {
+ ms_free(lc->zrtp_secrets_cache);
+ }
+ lc->zrtp_secrets_cache=file ? ms_strdup(file) : NULL;
+ }