Commit b2a0cd77 authored by Ronan's avatar Ronan

fix(core): deal with new cpp flags

parent 8ae87e2f
...@@ -348,7 +348,7 @@ void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, voi ...@@ -348,7 +348,7 @@ void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, voi
LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username) { LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username) {
int min_length = lp_config_get_int(creator->core->config, "assistant", "username_min_length", -1); int min_length = lp_config_get_int(creator->core->config, "assistant", "username_min_length", -1);
int max_length = lp_config_get_int(creator->core->config, "assistant", "username_max_length", -1); int max_length = lp_config_get_int(creator->core->config, "assistant", "username_max_length", -1);
bool_t use_phone_number = lp_config_get_int(creator->core->config, "assistant", "use_phone_number", 0); bool_t use_phone_number = !!lp_config_get_int(creator->core->config, "assistant", "use_phone_number", 0);
const char* regex = lp_config_get_string(creator->core->config, "assistant", "username_regex", 0); const char* regex = lp_config_get_string(creator->core->config, "assistant", "username_regex", 0);
if (!username) { if (!username) {
creator->username = NULL; creator->username = NULL;
......
...@@ -219,7 +219,7 @@ void linphone_auth_info_destroy(LinphoneAuthInfo *obj){ ...@@ -219,7 +219,7 @@ void linphone_auth_info_destroy(LinphoneAuthInfo *obj){
void linphone_auth_info_write_config(LpConfig *config, LinphoneAuthInfo *obj, int pos) { void linphone_auth_info_write_config(LpConfig *config, LinphoneAuthInfo *obj, int pos) {
char key[50]; char key[50];
bool_t store_ha1_passwd = lp_config_get_int(config, "sip", "store_ha1_passwd", 1); bool_t store_ha1_passwd = !!lp_config_get_int(config, "sip", "store_ha1_passwd", 1);
sprintf(key, "auth_info_%i", pos); sprintf(key, "auth_info_%i", pos);
lp_config_clean_section(config, key); lp_config_clean_section(config, key);
......
...@@ -58,7 +58,7 @@ void sal_address_set_secure(SalAddress *addr, bool_t enabled){ ...@@ -58,7 +58,7 @@ void sal_address_set_secure(SalAddress *addr, bool_t enabled){
bool_t sal_address_is_secure(const SalAddress *addr){ bool_t sal_address_is_secure(const SalAddress *addr){
belle_sip_header_address_t* header_addr = BELLE_SIP_HEADER_ADDRESS(addr); belle_sip_header_address_t* header_addr = BELLE_SIP_HEADER_ADDRESS(addr);
belle_sip_uri_t* uri = belle_sip_header_address_get_uri(header_addr); belle_sip_uri_t* uri = belle_sip_header_address_get_uri(header_addr);
if (uri) return belle_sip_uri_is_secure(uri); if (uri) return !!belle_sip_uri_is_secure(uri);
return FALSE; return FALSE;
} }
...@@ -199,7 +199,7 @@ void sal_address_set_param(SalAddress *addr,const char* name,const char* value){ ...@@ -199,7 +199,7 @@ void sal_address_set_param(SalAddress *addr,const char* name,const char* value){
bool_t sal_address_has_param(const SalAddress *addr, const char *name){ bool_t sal_address_has_param(const SalAddress *addr, const char *name){
belle_sip_parameters_t* parameters = BELLE_SIP_PARAMETERS(addr); belle_sip_parameters_t* parameters = BELLE_SIP_PARAMETERS(addr);
return belle_sip_parameters_has_parameter(parameters, name); return !!belle_sip_parameters_has_parameter(parameters, name);
} }
const char * sal_address_get_param(const SalAddress *addr, const char *name) { const char * sal_address_get_param(const SalAddress *addr, const char *name) {
...@@ -224,7 +224,7 @@ void sal_address_set_uri_params(SalAddress *addr, const char *params){ ...@@ -224,7 +224,7 @@ void sal_address_set_uri_params(SalAddress *addr, const char *params){
bool_t sal_address_has_uri_param(const SalAddress *addr, const char *name){ bool_t sal_address_has_uri_param(const SalAddress *addr, const char *name){
belle_sip_parameters_t* parameters = BELLE_SIP_PARAMETERS(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(addr))); belle_sip_parameters_t* parameters = BELLE_SIP_PARAMETERS(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(addr)));
return belle_sip_parameters_has_parameter(parameters, name); return !!belle_sip_parameters_has_parameter(parameters, name);
} }
const char * sal_address_get_uri_param(const SalAddress *addr, const char *name) { const char * sal_address_get_uri_param(const SalAddress *addr, const char *name) {
......
...@@ -84,7 +84,7 @@ void sal_set_log_level(OrtpLogLevel level) { ...@@ -84,7 +84,7 @@ void sal_set_log_level(OrtpLogLevel level) {
if (((level&ORTP_DEBUG) != 0) || ((level&ORTP_TRACE) != 0)) { if (((level&ORTP_DEBUG) != 0) || ((level&ORTP_TRACE) != 0)) {
belle_sip_level = BELLE_SIP_LOG_DEBUG; belle_sip_level = BELLE_SIP_LOG_DEBUG;
} }
belle_sip_set_log_level(belle_sip_level); belle_sip_set_log_level(belle_sip_level);
} }
static BctbxLogFunc _belle_sip_log_handler = bctbx_logv_out; static BctbxLogFunc _belle_sip_log_handler = bctbx_logv_out;
...@@ -215,7 +215,7 @@ static void process_request_event(void *ud, const belle_sip_request_event_t *eve ...@@ -215,7 +215,7 @@ static void process_request_event(void *ud, const belle_sip_request_event_t *eve
if (dialog) { if (dialog) {
op=(SalOp*)belle_sip_dialog_get_application_data(dialog); op=(SalOp*)belle_sip_dialog_get_application_data(dialog);
if (op == NULL && strcmp("NOTIFY",method) == 0) { if (op == NULL && strcmp("NOTIFY",method) == 0) {
/*special case for Dialog created by notify mathing subscribe*/ /*special case for Dialog created by notify mathing subscribe*/
belle_sip_transaction_t * sub_trans = belle_sip_dialog_get_last_transaction(dialog); belle_sip_transaction_t * sub_trans = belle_sip_dialog_get_last_transaction(dialog);
...@@ -658,7 +658,7 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i ...@@ -658,7 +658,7 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
sal_address_set_domain(sal_addr,addr); sal_address_set_domain(sal_addr,addr);
sal_address_set_port(sal_addr,port); sal_address_set_port(sal_addr,port);
sal_address_set_transport(sal_addr,tr); sal_address_set_transport(sal_addr,tr);
result = sal_add_listen_port(ctx, sal_addr, is_tunneled); result = sal_add_listen_port(ctx, sal_addr, !!is_tunneled);
sal_address_destroy(sal_addr); sal_address_destroy(sal_addr);
return result; return result;
} }
...@@ -986,7 +986,7 @@ const char *sal_custom_header_find(const SalCustomHeader *ch, const char *name){ ...@@ -986,7 +986,7 @@ const char *sal_custom_header_find(const SalCustomHeader *ch, const char *name){
SalCustomHeader *sal_custom_header_remove(SalCustomHeader *ch, const char *name) { SalCustomHeader *sal_custom_header_remove(SalCustomHeader *ch, const char *name) {
belle_sip_message_t *msg=(belle_sip_message_t*)ch; belle_sip_message_t *msg=(belle_sip_message_t*)ch;
if (msg==NULL) return NULL; if (msg==NULL) return NULL;
belle_sip_message_remove_header(msg, name); belle_sip_message_remove_header(msg, name);
return (SalCustomHeader*)msg; return (SalCustomHeader*)msg;
} }
...@@ -1066,9 +1066,9 @@ int sal_generate_uuid(char *uuid, size_t len) { ...@@ -1066,9 +1066,9 @@ int sal_generate_uuid(char *uuid, size_t len) {
if (len==0) return -1; if (len==0) return -1;
/*create an UUID as described in RFC4122, 4.4 */ /*create an UUID as described in RFC4122, 4.4 */
belle_sip_random_bytes((unsigned char*)&uuid_struct, sizeof(sal_uuid_t)); belle_sip_random_bytes((unsigned char*)&uuid_struct, sizeof(sal_uuid_t));
uuid_struct.clock_seq_hi_and_reserved&=~(1<<6); uuid_struct.clock_seq_hi_and_reserved&=(unsigned char)~(1<<6);
uuid_struct.clock_seq_hi_and_reserved|=1<<7; uuid_struct.clock_seq_hi_and_reserved|=1<<7;
uuid_struct.time_hi_and_version&=~(0xf<<12); uuid_struct.time_hi_and_version&=(short unsigned int)~(0xf<<12);
uuid_struct.time_hi_and_version|=4<<12; uuid_struct.time_hi_and_version|=4<<12;
written=snprintf(uuid,len,"%8.8x-%4.4x-%4.4x-%2.2x%2.2x-", uuid_struct.time_low, uuid_struct.time_mid, written=snprintf(uuid,len,"%8.8x-%4.4x-%4.4x-%2.2x%2.2x-", uuid_struct.time_low, uuid_struct.time_mid,
......
...@@ -327,7 +327,7 @@ static void call_process_response(void *op_base, const belle_sip_response_event_ ...@@ -327,7 +327,7 @@ static void call_process_response(void *op_base, const belle_sip_response_event_
&& (header_content_type = belle_sip_message_get_header_by_type(req,belle_sip_header_content_type_t)) && (header_content_type = belle_sip_message_get_header_by_type(req,belle_sip_header_content_type_t))
&& strcmp("application",belle_sip_header_content_type_get_type(header_content_type))==0 && strcmp("application",belle_sip_header_content_type_get_type(header_content_type))==0
&& strcmp("media_control+xml",belle_sip_header_content_type_get_subtype(header_content_type))==0) { && strcmp("media_control+xml",belle_sip_header_content_type_get_subtype(header_content_type))==0) {
unsigned int retry_in = (unsigned int)(1000*((float)rand()/RAND_MAX)); unsigned int retry_in = (unsigned int)(1000*((float)rand()/(float)RAND_MAX));
belle_sip_source_t *s=sal_create_timer(op->base.root,vfu_retry,sal_op_ref(op), retry_in, "vfu request retry"); belle_sip_source_t *s=sal_create_timer(op->base.root,vfu_retry,sal_op_ref(op), retry_in, "vfu request retry");
ms_message("Rejected vfu request on op [%p], just retry in [%ui] ms",op,retry_in); ms_message("Rejected vfu request on op [%p], just retry in [%ui] ms",op,retry_in);
belle_sip_object_unref(s); belle_sip_object_unref(s);
......
...@@ -150,25 +150,25 @@ static void add_rtcp_fb_attributes(belle_sdp_media_description_t *media_desc, co ...@@ -150,25 +150,25 @@ static void add_rtcp_fb_attributes(belle_sdp_media_description_t *media_desc, co
/* Add trr-int if not set generally. */ /* Add trr-int if not set generally. */
if (general_trr_int != TRUE && trr_int != 0) { if (general_trr_int != TRUE && trr_int != 0) {
add_rtcp_fb_trr_int_attribute(media_desc, payload_type_get_number(pt), avpf_params.trr_interval); add_rtcp_fb_trr_int_attribute(media_desc, (int8_t)payload_type_get_number(pt), avpf_params.trr_interval);
} }
/* Add rtcp-fb attributes according to the AVPF features of the payload types. */ /* Add rtcp-fb attributes according to the AVPF features of the payload types. */
if (avpf_params.features & PAYLOAD_TYPE_AVPF_PLI) { if (avpf_params.features & PAYLOAD_TYPE_AVPF_PLI) {
add_rtcp_fb_nack_attribute(media_desc, payload_type_get_number(pt), BELLE_SDP_RTCP_FB_PLI); add_rtcp_fb_nack_attribute(media_desc, (int8_t)payload_type_get_number(pt), BELLE_SDP_RTCP_FB_PLI);
} }
if (avpf_params.features & PAYLOAD_TYPE_AVPF_SLI) { if (avpf_params.features & PAYLOAD_TYPE_AVPF_SLI) {
add_rtcp_fb_nack_attribute(media_desc, payload_type_get_number(pt), BELLE_SDP_RTCP_FB_SLI); add_rtcp_fb_nack_attribute(media_desc, (int8_t)payload_type_get_number(pt), BELLE_SDP_RTCP_FB_SLI);
} }
if (avpf_params.features & PAYLOAD_TYPE_AVPF_RPSI) { if (avpf_params.features & PAYLOAD_TYPE_AVPF_RPSI) {
if (avpf_params.rpsi_compatibility == TRUE) { if (avpf_params.rpsi_compatibility == TRUE) {
add_rtcp_fb_nack_attribute(media_desc, payload_type_get_number(pt), BELLE_SDP_RTCP_FB_RPSI); add_rtcp_fb_nack_attribute(media_desc, (int8_t)payload_type_get_number(pt), BELLE_SDP_RTCP_FB_RPSI);
} else { } else {
add_rtcp_fb_ack_attribute(media_desc, payload_type_get_number(pt), BELLE_SDP_RTCP_FB_RPSI); add_rtcp_fb_ack_attribute(media_desc, (int8_t)payload_type_get_number(pt), BELLE_SDP_RTCP_FB_RPSI);
} }
} }
if (avpf_params.features & PAYLOAD_TYPE_AVPF_FIR) { if (avpf_params.features & PAYLOAD_TYPE_AVPF_FIR) {
add_rtcp_fb_ccm_attribute(media_desc, payload_type_get_number(pt), BELLE_SDP_RTCP_FB_FIR); add_rtcp_fb_ccm_attribute(media_desc, (int8_t)payload_type_get_number(pt), BELLE_SDP_RTCP_FB_FIR);
} }
} }
} }
...@@ -263,9 +263,9 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session ...@@ -263,9 +263,9 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session
if (ms_crypto_suite_to_name_params(stream->crypto[j].algo,&desc)==0){ if (ms_crypto_suite_to_name_params(stream->crypto[j].algo,&desc)==0){
if (desc.params) if (desc.params)
snprintf ( buffer, sizeof ( buffer )-1, "%d %s inline:%s %s", stream->crypto[j].tag, desc.name, stream->crypto[j].master_key,desc.params); snprintf ( buffer, sizeof ( buffer )-1, "%d %s inline:%s %s", stream->crypto[j].tag, desc.name, stream->crypto[j].master_key,desc.params);
else else
snprintf ( buffer, sizeof ( buffer )-1, "%d %s inline:%s", stream->crypto[j].tag, desc.name, stream->crypto[j].master_key ); snprintf ( buffer, sizeof ( buffer )-1, "%d %s inline:%s", stream->crypto[j].tag, desc.name, stream->crypto[j].master_key );
belle_sdp_media_description_add_attribute( media_desc,belle_sdp_attribute_create ("crypto", buffer)); belle_sdp_media_description_add_attribute( media_desc,belle_sdp_attribute_create ("crypto", buffer));
}else break; }else break;
} }
...@@ -314,11 +314,11 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session ...@@ -314,11 +314,11 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session
break; break;
} }
if ( dir ) belle_sdp_media_description_add_attribute ( media_desc,belle_sdp_attribute_create ( dir,NULL ) ); if ( dir ) belle_sdp_media_description_add_attribute ( media_desc,belle_sdp_attribute_create ( dir,NULL ) );
if (stream->rtcp_mux){ if (stream->rtcp_mux){
belle_sdp_media_description_add_attribute(media_desc, belle_sdp_attribute_create ("rtcp-mux",NULL ) ); belle_sdp_media_description_add_attribute(media_desc, belle_sdp_attribute_create ("rtcp-mux",NULL ) );
} }
if (rtp_port != 0) { if (rtp_port != 0) {
different_rtp_and_rtcp_addr = (rtcp_addr[0] != '\0') && (strcmp(rtp_addr, rtcp_addr) != 0); different_rtp_and_rtcp_addr = (rtcp_addr[0] != '\0') && (strcmp(rtp_addr, rtcp_addr) != 0);
if ((rtcp_port != (rtp_port + 1)) || (different_rtp_and_rtcp_addr == TRUE)) { if ((rtcp_port != (rtp_port + 1)) || (different_rtp_and_rtcp_addr == TRUE)) {
...@@ -337,7 +337,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session ...@@ -337,7 +337,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session
belle_sdp_media_description_add_attribute(media_desc,belle_sdp_attribute_create ("ice-mismatch",NULL)); belle_sdp_media_description_add_attribute(media_desc,belle_sdp_attribute_create ("ice-mismatch",NULL));
} else { } else {
if (rtp_port != 0) { if (rtp_port != 0) {
if (stream->ice_pwd[0] != '\0') if (stream->ice_pwd[0] != '\0')
belle_sdp_media_description_add_attribute(media_desc,belle_sdp_attribute_create ("ice-pwd",stream->ice_pwd)); belle_sdp_media_description_add_attribute(media_desc,belle_sdp_attribute_create ("ice-pwd",stream->ice_pwd));
if (stream->ice_ufrag[0] != '\0') if (stream->ice_ufrag[0] != '\0')
belle_sdp_media_description_add_attribute(media_desc,belle_sdp_attribute_create ("ice-ufrag",stream->ice_ufrag)); belle_sdp_media_description_add_attribute(media_desc,belle_sdp_attribute_create ("ice-ufrag",stream->ice_ufrag));
...@@ -432,7 +432,7 @@ belle_sdp_session_description_t * media_description_to_sdp ( const SalMediaDescr ...@@ -432,7 +432,7 @@ belle_sdp_session_description_t * media_description_to_sdp ( const SalMediaDescr
if ( desc->bandwidth>0 ) { if ( desc->bandwidth>0 ) {
belle_sdp_session_description_set_bandwidth ( session_desc,"AS",desc->bandwidth ); belle_sdp_session_description_set_bandwidth ( session_desc,"AS",desc->bandwidth );
} }
if (desc->set_nortpproxy == TRUE) belle_sdp_session_description_add_attribute(session_desc, belle_sdp_attribute_create("nortpproxy","yes")); if (desc->set_nortpproxy == TRUE) belle_sdp_session_description_add_attribute(session_desc, belle_sdp_attribute_create("nortpproxy","yes"));
if (desc->ice_pwd[0] != '\0') belle_sdp_session_description_add_attribute(session_desc, belle_sdp_attribute_create("ice-pwd",desc->ice_pwd)); if (desc->ice_pwd[0] != '\0') belle_sdp_session_description_add_attribute(session_desc, belle_sdp_attribute_create("ice-pwd",desc->ice_pwd));
if (desc->ice_ufrag[0] != '\0') belle_sdp_session_description_add_attribute(session_desc, belle_sdp_attribute_create("ice-ufrag",desc->ice_ufrag)); if (desc->ice_ufrag[0] != '\0') belle_sdp_session_description_add_attribute(session_desc, belle_sdp_attribute_create("ice-ufrag",desc->ice_ufrag));
...@@ -501,7 +501,7 @@ static void sdp_parse_media_crypto_parameters(belle_sdp_media_description_t *med ...@@ -501,7 +501,7 @@ static void sdp_parse_media_crypto_parameters(belle_sdp_media_description_t *med
&stream->crypto[valid_count].tag, &stream->crypto[valid_count].tag,
tmp, tmp,
tmp2, parameters ); tmp2, parameters );
if ( nb >= 3 ) { if ( nb >= 3 ) {
MSCryptoSuite cs; MSCryptoSuite cs;
MSCryptoSuiteNameParams np; MSCryptoSuiteNameParams np;
...@@ -651,7 +651,7 @@ static bool_t sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_ ...@@ -651,7 +651,7 @@ static bool_t sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_
PayloadType *pt; PayloadType *pt;
int8_t pt_num; int8_t pt_num;
bool_t retval = FALSE; bool_t retval = FALSE;
/* Handle rtcp-fb attributes that concern all payload types. */ /* Handle rtcp-fb attributes that concern all payload types. */
for (it = belle_sdp_media_description_get_attributes(media_desc); it != NULL; it = it->next) { for (it = belle_sdp_media_description_get_attributes(media_desc); it != NULL; it = it->next) {
attribute = BELLE_SDP_ATTRIBUTE(it->data); attribute = BELLE_SDP_ATTRIBUTE(it->data);
...@@ -805,7 +805,7 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md, ...@@ -805,7 +805,7 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md,
} }
stream->rtcp_mux = belle_sdp_media_description_get_attribute(media_desc, "rtcp-mux") != NULL; stream->rtcp_mux = belle_sdp_media_description_get_attribute(media_desc, "rtcp-mux") != NULL;
/* Get media payload types */ /* Get media payload types */
sdp_parse_payload_types(media_desc, stream); sdp_parse_payload_types(media_desc, stream);
...@@ -857,7 +857,7 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md, ...@@ -857,7 +857,7 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md,
/* Get ICE candidate attributes if any */ /* Get ICE candidate attributes if any */
sdp_parse_media_ice_parameters(media_desc, stream); sdp_parse_media_ice_parameters(media_desc, stream);
has_avpf_attributes = sdp_parse_rtcp_fb_parameters(media_desc, stream); has_avpf_attributes = sdp_parse_rtcp_fb_parameters(media_desc, stream);
/* Get RTCP-FB attributes if any */ /* Get RTCP-FB attributes if any */
...@@ -892,7 +892,7 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S ...@@ -892,7 +892,7 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S
const char* value; const char* value;
SalDtlsRole session_role=SalDtlsRoleInvalid; SalDtlsRole session_role=SalDtlsRoleInvalid;
int i; int i;
desc->nb_streams = 0; desc->nb_streams = 0;
desc->dir = SalStreamSendRecv; desc->dir = SalStreamSendRecv;
...@@ -902,11 +902,11 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S ...@@ -902,11 +902,11 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S
if ( (sname=belle_sdp_session_description_get_session_name(session_desc)) && belle_sdp_session_name_get_value(sname) ){ if ( (sname=belle_sdp_session_description_get_session_name(session_desc)) && belle_sdp_session_name_get_value(sname) ){
strncpy(desc->name,belle_sdp_session_name_get_value(sname),sizeof(desc->name) - 1); strncpy(desc->name,belle_sdp_session_name_get_value(sname),sizeof(desc->name) - 1);
} }
if ( belle_sdp_session_description_get_bandwidth ( session_desc,"AS" ) >0 ) { if ( belle_sdp_session_description_get_bandwidth ( session_desc,"AS" ) >0 ) {
desc->bandwidth=belle_sdp_session_description_get_bandwidth ( session_desc,"AS" ); desc->bandwidth=belle_sdp_session_description_get_bandwidth ( session_desc,"AS" );
} }
/*in some very rare case, session attribute may set stream dir*/ /*in some very rare case, session attribute may set stream dir*/
if ( belle_sdp_session_description_get_attribute ( session_desc,"sendrecv" ) ) { if ( belle_sdp_session_description_get_attribute ( session_desc,"sendrecv" ) ) {
desc->dir=SalStreamSendRecv; desc->dir=SalStreamSendRecv;
...@@ -940,10 +940,10 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S ...@@ -940,10 +940,10 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S
/* Get ICE remote ufrag and remote pwd, and ice_lite flag */ /* Get ICE remote ufrag and remote pwd, and ice_lite flag */
value=belle_sdp_session_description_get_attribute_value(session_desc,"ice-ufrag"); value=belle_sdp_session_description_get_attribute_value(session_desc,"ice-ufrag");
if (value) strncpy(desc->ice_ufrag, value, sizeof(desc->ice_ufrag) - 1); if (value) strncpy(desc->ice_ufrag, value, sizeof(desc->ice_ufrag) - 1);
value=belle_sdp_session_description_get_attribute_value(session_desc,"ice-pwd"); value=belle_sdp_session_description_get_attribute_value(session_desc,"ice-pwd");
if (value) strncpy(desc->ice_pwd, value, sizeof(desc->ice_pwd)-1); if (value) strncpy(desc->ice_pwd, value, sizeof(desc->ice_pwd)-1);
value=belle_sdp_session_description_get_attribute_value(session_desc,"ice-lite"); value=belle_sdp_session_description_get_attribute_value(session_desc,"ice-lite");
if (value) desc->ice_lite = TRUE; if (value) desc->ice_lite = TRUE;
......
...@@ -153,7 +153,7 @@ bctbx_list_t * call_logs_read_from_config_file(LinphoneCore *lc){ ...@@ -153,7 +153,7 @@ bctbx_list_t * call_logs_read_from_config_file(LinphoneCore *lc){
tmp=lp_config_get_string(cfg,logsection,"refkey",NULL); tmp=lp_config_get_string(cfg,logsection,"refkey",NULL);
if (tmp) cl->refkey=ms_strdup(tmp); if (tmp) cl->refkey=ms_strdup(tmp);
cl->quality=lp_config_get_float(cfg,logsection,"quality",-1); cl->quality=lp_config_get_float(cfg,logsection,"quality",-1);
cl->video_enabled=lp_config_get_int(cfg,logsection,"video_enabled",0); cl->video_enabled=!!lp_config_get_int(cfg,logsection,"video_enabled",0);
tmp=lp_config_get_string(cfg,logsection,"call_id",NULL); tmp=lp_config_get_string(cfg,logsection,"call_id",NULL);
if (tmp) cl->call_id=ms_strdup(tmp); if (tmp) cl->call_id=ms_strdup(tmp);
call_logs=bctbx_list_append(call_logs,cl); call_logs=bctbx_list_append(call_logs,cl);
......
...@@ -169,23 +169,25 @@ public: ...@@ -169,23 +169,25 @@ public:
LocalConference(LinphoneCore *core, LinphoneConference *conf, const Params *params = NULL); LocalConference(LinphoneCore *core, LinphoneConference *conf, const Params *params = NULL);
virtual ~LocalConference(); virtual ~LocalConference();
virtual int inviteAddresses(const list<const LinphoneAddress*> &addresses, const LinphoneCallParams *params); virtual int inviteAddresses(const list<const LinphoneAddress*> &addresses, const LinphoneCallParams *params) override;
virtual int addParticipant(LinphoneCall *call); virtual int addParticipant(LinphoneCall *call) override;
virtual int removeParticipant(LinphoneCall *call); virtual int removeParticipant(LinphoneCall *call) override;
virtual int removeParticipant(const LinphoneAddress *uri); virtual int removeParticipant(const LinphoneAddress *uri) override;
virtual int terminate(); virtual int terminate() override;
virtual int enter(); virtual int enter() override;
virtual int leave(); virtual int leave() override;
virtual bool isIn() const {return m_localParticipantStream!=NULL;} virtual bool isIn() const override {
virtual int getSize() const; return m_localParticipantStream!=NULL;
}
virtual int getSize() const override;
virtual int startRecording(const char *path); virtual int startRecording(const char *path) override;
virtual int stopRecording(); virtual int stopRecording() override;
virtual void onCallStreamStarting(LinphoneCall *call, bool isPausedByRemote); virtual void onCallStreamStarting(LinphoneCall *call, bool isPausedByRemote) override;
virtual void onCallStreamStopping(LinphoneCall *call); virtual void onCallStreamStopping(LinphoneCall *call) override;
virtual void onCallTerminating(LinphoneCall *call); virtual void onCallTerminating(LinphoneCall *call) override;
private: private:
void addLocalEndpoint(); void addLocalEndpoint();
...@@ -207,18 +209,24 @@ public: ...@@ -207,18 +209,24 @@ public:
RemoteConference(LinphoneCore *core, LinphoneConference *conf, const Params *params = NULL); RemoteConference(LinphoneCore *core, LinphoneConference *conf, const Params *params = NULL);
virtual ~RemoteConference(); virtual ~RemoteConference();
virtual int inviteAddresses(const list<const LinphoneAddress*> &addresses, const LinphoneCallParams *params); virtual int inviteAddresses(const list<const LinphoneAddress*> &addresses, const LinphoneCallParams *params) override;
virtual int addParticipant(LinphoneCall *call); virtual int addParticipant(LinphoneCall *call) override;
virtual int removeParticipant(LinphoneCall *call) {return -1;} virtual int removeParticipant(LinphoneCall *call) override {
virtual int removeParticipant(const LinphoneAddress *uri); return -1;
virtual int terminate(); }
virtual int removeParticipant(const LinphoneAddress *uri) override;
virtual int terminate() override;
virtual int enter(); virtual int enter() override;
virtual int leave(); virtual int leave() override;
virtual bool isIn() const; virtual bool isIn() const override;
virtual int startRecording(const char *path) {return 0;} virtual int startRecording (const char *path) override {
virtual int stopRecording() {return 0;} return 0;
}
virtual int stopRecording() override {
return 0;
}
private: private:
bool focusIsReady() const; bool focusIsReady() const;
......
...@@ -47,8 +47,8 @@ static void ecc_init_filters(EcCalibrator *ecc){ ...@@ -47,8 +47,8 @@ static void ecc_init_filters(EcCalibrator *ecc){
ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&ecc->rate); ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&ecc->rate);
ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_NCHANNELS,&channels); ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_NCHANNELS,&channels);
ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_OUTPUT_NCHANNELS,&ecc_channels); ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_OUTPUT_NCHANNELS,&ecc_channels);
ecc->det=ms_factory_create_filter(ecc->factory, MS_TONE_DETECTOR_ID); ecc->det=ms_factory_create_filter(ecc->factory, MS_TONE_DETECTOR_ID);
ms_filter_call_method(ecc->det,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate); ms_filter_call_method(ecc->det,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
ecc->rec=ms_factory_create_filter(ecc->factory, MS_VOID_SINK_ID); ecc->rec=ms_factory_create_filter(ecc->factory, MS_VOID_SINK_ID);
...@@ -62,7 +62,7 @@ static void ecc_init_filters(EcCalibrator *ecc){ ...@@ -62,7 +62,7 @@ static void ecc_init_filters(EcCalibrator *ecc){
ms_filter_call_method(ecc->gen,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate); ms_filter_call_method(ecc->gen,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
ecc->write_resampler=ms_factory_create_filter(ecc->factory, MS_RESAMPLE_ID); ecc->write_resampler=ms_factory_create_filter(ecc->factory, MS_RESAMPLE_ID);
ecc->sndwrite=ms_snd_card_create_writer(ecc->play_card); ecc->sndwrite=ms_snd_card_create_writer(ecc->play_card);
ms_filter_call_method(ecc->sndwrite,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate); ms_filter_call_method(ecc->sndwrite,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
ms_filter_call_method(ecc->sndwrite,MS_FILTER_GET_SAMPLE_RATE,&rate); ms_filter_call_method(ecc->sndwrite,MS_FILTER_GET_SAMPLE_RATE,&rate);
ms_filter_call_method(ecc->sndwrite,MS_FILTER_SET_NCHANNELS,&ecc_channels); ms_filter_call_method(ecc->sndwrite,MS_FILTER_SET_NCHANNELS,&ecc_channels);
...@@ -153,37 +153,37 @@ static void on_tone_received(void *data, MSFilter *f, unsigned int event_id, voi ...@@ -153,37 +153,37 @@ static void on_tone_received(void *data, MSFilter *f, unsigned int event_id, voi
static void ecc_play_tones(EcCalibrator *ecc){ static void ecc_play_tones(EcCalibrator *ecc){
MSDtmfGenCustomTone tone; MSDtmfGenCustomTone tone;
MSToneDetectorDef expected_tone; MSToneDetectorDef expected_tone;
memset(&tone,0,sizeof(tone)); memset(&tone,0,sizeof(tone));
memset(&expected_tone,0,sizeof(expected_tone)); memset(&expected_tone,0,sizeof(expected_tone));
ms_filter_add_notify_callback(ecc->det,on_tone_received,ecc,TRUE); ms_filter_add_notify_callback(ecc->det,on_tone_received,ecc,TRUE);
/* configure the tones to be scanned */ /* configure the tones to be scanned */
strncpy(expected_tone.tone_name,"freq1",sizeof(expected_tone.tone_name)); strncpy(expected_tone.tone_name,"freq1",sizeof(expected_tone.tone_name));
expected_tone.frequency=(int)2349.32; expected_tone.frequency=(int)2349.32;
expected_tone.min_duration=40; expected_tone.min_duration=40;
expected_tone.min_amplitude=0.1f; expected_tone.min_amplitude=0.1f;
ms_filter_call_method (ecc->det,MS_TONE_DETECTOR_ADD_SCAN,&expected_tone); ms_filter_call_method (ecc->det,MS_TONE_DETECTOR_ADD_SCAN,&expected_tone);
strncpy(expected_tone.tone_name,"freq2",sizeof(expected_tone.tone_name)); strncpy(expected_tone.tone_name,"freq2",sizeof(expected_tone.tone_name));
expected_tone.frequency=(int)2637.02; expected_tone.frequency=(int)2637.02;
expected_tone.min_duration=40; expected_tone.min_duration=40;
expected_tone.min_amplitude=0.1f; expected_tone.min_amplitude=0.1f;
ms_filter_call_method (ecc->det,MS_TONE_DETECTOR_ADD_SCAN,&expected_tone); ms_filter_call_method (ecc->det,MS_TONE_DETECTOR_ADD_SCAN,&expected_tone);
strncpy(expected_tone.tone_name,"freq3",sizeof(expected_tone.tone_name)); strncpy(expected_tone.tone_name,"freq3",sizeof(expected_tone.tone_name));
expected_tone.frequency=(int)2093; expected_tone.frequency=(int)2093;
expected_tone.min_duration=40; expected_tone.min_duration=40;
expected_tone.min_amplitude=0.1f; expected_tone.min_amplitude=0.1f;
ms_filter_call_method (ecc->det,MS_TONE_DETECTOR_ADD_SCAN,&expected_tone); ms_filter_call_method (ecc->det,MS_TONE_DETECTOR_ADD_SCAN,&expected_tone);
/*play an initial tone to startup the audio playback/capture*/ /*play an initial tone to startup the audio playback/capture*/
tone.frequencies[0]=140; tone.frequencies[0]=140;
tone.duration=1000; tone.duration=1000;
tone.amplitude=0.5; tone.amplitude=0.5;
...@@ -192,23 +192,23 @@ static void ecc_play_tones(EcCalibrator *ecc){ ...@@ -192,23 +192,23 @@ static void ecc_play_tones(EcCalibrator *ecc){
ms_sleep(2); ms_sleep(2);
ms_filter_add_notify_callback(ecc->gen,on_tone_sent,ecc,TRUE); ms_filter_add_notify_callback(ecc->gen,on_tone_sent,ecc,TRUE);
/* play the three tones*/ /* play the three tones*/
if (ecc->play_cool_tones){ if (ecc->play_cool_tones){
strncpy(tone.tone_name, "D", sizeof(tone.tone_name)); strncpy(tone.tone_name, "D", sizeof(tone.tone_name));
tone.frequencies[0]=(int)2349.32; tone.frequencies[0]=(int)2349.32;
tone.duration=100; tone.duration=100;
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone); ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
ms_usleep(300000); ms_usleep(300000);
strncpy(tone.tone_name, "E", sizeof(tone.tone_name)); strncpy(tone.tone_name, "E", sizeof(tone.tone_name));
tone.frequencies[0]=(int)2637.02; tone.frequencies[0]=(int)2637.02;
tone.duration=100; tone.duration=100;
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone); ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
ms_usleep(300000); ms_usleep(300000);
strncpy(tone.tone_name, "C", sizeof(tone.tone_name)); strncpy(tone.tone_name, "C", sizeof(tone.tone_name));
tone.frequencies[0]=(int)2093; tone.frequencies[0]=(int)2093;
tone.duration=100; tone.duration=100;
...@@ -220,20 +220,20 @@ static void ecc_play_tones(EcCalibrator *ecc){ ...@@ -220,20 +220,20 @@ static void ecc_play_tones(EcCalibrator *ecc){
tone.duration=100; tone.duration=100;
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone); ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
ms_usleep(300000); ms_usleep(300000);
strncpy(tone.tone_name, "D", sizeof(tone.tone_name)); strncpy(tone.tone_name, "D", sizeof(tone.tone_name));
tone.frequencies[0]=(int)2349.32; tone.frequencies[0]=(int)2349.32;
tone.duration=100; tone.duration=100;
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone); ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
ms_usleep(300000); ms_usleep(300000);
strncpy(tone.tone_name, "E", sizeof(tone.tone_name)); strncpy(tone.tone_name, "E", sizeof(tone.tone_name));
tone.frequencies[0]=(int)2637.02; tone.frequencies[0]=(int)2637.02;
tone.duration=100; tone.duration=100;
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone); ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
ms_usleep(300000); ms_usleep(300000);
} }
/*these two next ones are for lyrism*/ /*these two next ones are for lyrism*/
if (ecc->play_cool_tones){ if (ecc->play_cool_tones){
tone.tone_name[0]='\0'; tone.tone_name[0]='\0';
...@@ -241,15 +241,15 @@ static void ecc_play_tones(EcCalibrator *ecc){ ...@@ -241,15 +241,15 @@ static void ecc_play_tones(EcCalibrator *ecc){
tone.duration=400; tone.duration=400;
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone); ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
ms_usleep(300000); ms_usleep(300000);
tone.tone_name[0]='\0'; tone.tone_name[0]='\0';
tone.frequencies[0]=(int)1567.98; tone.frequencies[0]=(int)1567.98;
tone.duration=400; tone.duration=400;
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone); ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
} }
ms_sleep(1); ms_sleep(1);
if (ecc->freq1 && ecc->freq2 && ecc->freq3) { if (ecc->freq1 && ecc->freq2 && ecc->freq3) {
int delay=(int)(ecc->acc/3); int delay=(int)(ecc->acc/3);
if (delay<0){ if (delay<0){
...@@ -274,7 +274,7 @@ static void ecc_play_tones(EcCalibrator *ecc){ ...@@ -274,7 +274,7 @@ static void ecc_play_tones(EcCalibrator *ecc){
static void * ecc_thread(void *p){ static void * ecc_thread(void *p){
EcCalibrator *ecc=(EcCalibrator*)p; EcCalibrator *ecc=(EcCalibrator*)p;
ecc_init_filters(ecc); ecc_init_filters(ecc);
ecc_play_tones(ecc); ecc_play_tones(ecc);
ecc_deinit_filters(ecc); ecc_deinit_filters(ecc);
...@@ -320,8 +320,7 @@ int linphone_core_start_echo_calibration(LinphoneCore *lc, LinphoneEcCalibration ...@@ -320,8 +320,7 @@ int linphone_core_start_echo_calibration(LinphoneCore *lc, LinphoneEcCalibration
} }
rate = lp_config_get_int(lc->config,"sound","echo_cancellation_rate",8000); rate = lp_config_get_int(lc->config,"sound","echo_cancellation_rate",8000);
lc->ecc=ec_calibrator_new(lc->factory, lc->sound_conf.play_sndcard,