Commit 82b74a8b authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Merge branch 'master' into dev_vcard

Conflicts:
	coreapi/friendlist.c
parents 8725ed30 3aed512e
......@@ -414,7 +414,8 @@ linphonec_parse_command_line(LinphoneCore *lc, char *cl)
{
while ( isdigit(*cl) || *cl == '#' || *cl == '*' )
{
linphone_core_send_dtmf(lc, *cl);
if (linphone_core_get_current_call(lc))
linphone_call_send_dtmf(linphone_core_get_current_call(lc), *cl);
linphone_core_play_dtmf (lc,*cl,100);
ms_sleep(1); // be nice
++cl;
......@@ -2336,12 +2337,12 @@ static int lpc_cmd_echolimiter(LinphoneCore *lc, char *args){
static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args)
{
linphone_core_mute_mic(lc, 1);
linphone_core_enable_mic(lc, 0);
return 1;
}
static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args){
linphone_core_mute_mic(lc, 0);
linphone_core_enable_mic(lc, 1);
return 1;
}
......
......@@ -102,7 +102,7 @@ static int linphonec_main_loop (LinphoneCore * opm);
static int linphonec_idle_call (void);
#ifdef HAVE_READLINE
static int linphonec_initialize_readline(void);
static int linphonec_finish_readline();
static int linphonec_finish_readline(void);
static char **linephonec_readline_completion(const char *text,
int start, int end);
#endif
......
......@@ -35,6 +35,7 @@ linphone_include_HEADERS=\
friendlist.h \
linphonecore.h \
linphonecore_utils.h \
ringtoneplayer.h \
linphonefriend.h \
linphonepresence.h \
linphone_proxy_config.h \
......
......@@ -542,8 +542,8 @@ void sal_set_callbacks(Sal *ctx, const SalCallbacks *cbs){
ctx->callbacks.notify=(SalOnNotify)unimplemented_stub;
if (ctx->callbacks.subscribe_received==NULL)
ctx->callbacks.subscribe_received=(SalOnSubscribeReceived)unimplemented_stub;
if (ctx->callbacks.subscribe_closed==NULL)
ctx->callbacks.subscribe_closed=(SalOnSubscribeClosed)unimplemented_stub;
if (ctx->callbacks.incoming_subscribe_closed==NULL)
ctx->callbacks.incoming_subscribe_closed=(SalOnIncomingSubscribeClosed)unimplemented_stub;
if (ctx->callbacks.parse_presence_requested==NULL)
ctx->callbacks.parse_presence_requested=(SalOnParsePresenceRequested)unimplemented_stub;
if (ctx->callbacks.convert_presence_to_xml_requested==NULL)
......
......@@ -46,11 +46,15 @@ static void subscribe_refresher_listener (belle_sip_refresher_t* refresher
if (status_code==200) sss=SalSubscribeActive;
else if (status_code==202) sss=SalSubscribePending;
set_or_update_dialog(op,belle_sip_transaction_get_dialog(tr));
}
if (status_code>=200){
sal_error_info_set(&op->error_info,SalReasonUnknown,status_code,reason_phrase,NULL);
op->base.root->callbacks.subscribe_response(op,sss);
}else if (status_code==0){
} else if (status_code >= 300) {
SalReason reason = SalReasonUnknown;
if (status_code == 503) { /*refresher returns 503 for IO error*/
reason = SalReasonIOError;
}
sal_error_info_set(&op->error_info,reason,status_code,reason_phrase,NULL);
op->base.root->callbacks.subscribe_response(op,sss);
}if (status_code==0){
op->base.root->callbacks.on_expire(op);
}
......@@ -61,10 +65,20 @@ static void subscribe_process_io_error(void *user_ctx, const belle_sip_io_error_
}
static void subscribe_process_dialog_terminated(void *ctx, const belle_sip_dialog_terminated_event_t *event) {
belle_sip_dialog_t *dialog = belle_sip_dialog_terminated_event_get_dialog(event);
SalOp* op= (SalOp*)ctx;
if (op->dialog) {
op->dialog=NULL;
if (!belle_sip_dialog_is_server(dialog) && belle_sip_dialog_terminated_event_is_expired(event)){
/*notify the app that our subscription is dead*/
const char *eventname = NULL;
if (op->event){
eventname = belle_sip_header_get_unparsed_value(op->event);
}
op->base.root->callbacks.notify(op, SalSubscribeTerminated, eventname, NULL);
}
sal_op_unref(op);
}
}
......@@ -162,7 +176,7 @@ static void subscribe_process_request_event(void *op_base, const belle_sip_reque
ms_message("Unsubscribe received from [%s]",sal_op_get_from(op));
resp=sal_op_create_response_from_request(op,req,200);
belle_sip_server_transaction_send_response(server_transaction,resp);
op->base.root->callbacks.subscribe_closed(op);
op->base.root->callbacks.incoming_subscribe_closed(op);
}
}
break;
......@@ -198,7 +212,6 @@ int sal_subscribe(SalOp *op, const char *from, const char *to, const char *event
if (!op->dialog){
sal_op_subscribe_fill_cbs(op);
/*???sal_exosip_fix_route(op); make sure to ha ;lr*/
req=sal_op_build_request(op,"SUBSCRIBE");
if( req == NULL ) {
return -1;
......
......@@ -518,14 +518,14 @@ SalReason _sal_reason_from_sip_code(int code) {
return SalReasonNotImplemented;
case 502:
return SalReasonBadGateway;
case 503:
return SalReasonServiceUnavailable;
case 504:
return SalReasonServerTimeout;
case 600:
return SalReasonDoNotDisturb;
case 603:
return SalReasonDeclined;
case 503:
return SalReasonServiceUnavailable;
default:
return SalReasonUnknown;
}
......
......@@ -58,8 +58,17 @@ static void presence_process_dialog_terminated(void *ctx, const belle_sip_dialog
if (!op->op_released){
op->base.root->callbacks.subscribe_presence_closed(op, sal_op_get_from(op));
}
set_or_update_dialog(op, NULL);
}else{
if (belle_sip_dialog_terminated_event_is_expired(event)){
ms_warning("Outgoing presence subscription expired.");
if (op->refresher){
/*send a new SUBSCRIBE, that will attempt to establish a new dialog*/
sal_subscribe_presence(op,NULL,NULL,-1);
}
}
}
set_or_update_dialog(op, NULL);
}
}
......
......@@ -503,10 +503,7 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o
if (call->params->internal_call_update)
call->params->internal_call_update = FALSE;
/* Handle remote ICE attributes if any. */
if (call->ice_session != NULL && rmd) {
linphone_call_update_ice_from_remote_media_description(call, rmd);
}
#ifdef BUILD_UPNP
if (call->upnp_session != NULL && rmd) {
linphone_core_update_upnp_from_remote_media_description(call, rmd);
......@@ -522,6 +519,12 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o
md = NULL;
}
if (md){ /*there is a valid SDP in the response, either offer or answer, and we're able to start/update the streams*/
/* Handle remote ICE attributes if any. */
if (call->ice_session != NULL && rmd) {
linphone_call_update_ice_from_remote_media_description(call, rmd, FALSE);
}
switch (call->state){
case LinphoneCallResuming:
linphone_core_notify_display_status(lc,_("Call resumed."));
......@@ -1340,7 +1343,7 @@ static void subscribe_received(SalOp *op, const char *eventname, const SalBodyHa
}
static void subscribe_closed(SalOp *op){
static void incoming_subscribe_closed(SalOp *op){
LinphoneEvent *lev=(LinphoneEvent*)sal_op_get_user_pointer(op);
linphone_event_set_state(lev,LinphoneSubscriptionTerminated);
......@@ -1397,7 +1400,7 @@ SalCallbacks linphone_sal_callbacks={
is_composing_received,
notify_refer,
subscribe_received,
subscribe_closed,
incoming_subscribe_closed,
subscribe_response,
notify,
subscribe_presence_received,
......
......@@ -35,7 +35,7 @@ const char *linphone_subscription_state_to_string(LinphoneSubscriptionState stat
switch(state){
case LinphoneSubscriptionNone: return "LinphoneSubscriptionNone";
case LinphoneSubscriptionIncomingReceived: return "LinphoneSubscriptionIncomingReceived";
case LinphoneSubscriptionOutgoingInit: return "LinphoneSubscriptionOutoingInit";
case LinphoneSubscriptionOutgoingProgress: return "LinphoneSubscriptionOutgoingProgress";
case LinphoneSubscriptionPending: return "LinphoneSubscriptionPending";
case LinphoneSubscriptionActive: return "LinphoneSubscriptionActive";
case LinphoneSubscriptionTerminated: return "LinphoneSubscriptionTerminated";
......
......@@ -591,6 +591,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon
linphone_content_set_string_buffer(content, xml_content);
linphone_event_send_subscribe(list->event, content);
linphone_content_unref(content);
linphone_event_set_user_data(list->event, list);
}
}
if (address != NULL) linphone_address_unref(address);
......@@ -667,4 +668,23 @@ void linphone_friend_list_set_uri(LinphoneFriendList *list, const char *uri) {
void linphone_friend_list_update_revision(LinphoneFriendList *list, int rev) {
list->revision = rev;
linphone_core_store_friends_list_in_db(list->lc, list);
}
\ No newline at end of file
}
void linphone_friend_list_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state) {
LinphoneFriendList *list = (LinphoneFriendList *)linphone_event_get_user_data(lev);
if (!list) {
ms_warning("core [%p] Receiving unexpected state [%s] for event [%p], no associated friend list",lc
, linphone_subscription_state_to_string(state)
, lev);
} else {
ms_message("Receiving new state [%s] for event [%p] for friend list [%p]"
, linphone_subscription_state_to_string(state)
, lev
, list);
if (state == LinphoneSubscriptionOutgoingProgress) {
ms_message("Resseting version count for friend list [%p]",list);
list->expected_notification_version = 0;
}
}
}
......@@ -932,6 +932,7 @@ static void port_config_set(LinphoneCall *call, int stream_index, int min_port,
static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from, LinphoneAddress *to){
int min_port, max_port;
ms_message("New LinphoneCall [%p] initialized (LinphoneCore version: %s)",call,linphone_core_get_version());
call->core->send_call_stats_periodical_updates = lp_config_get_int(call->core->config, "misc", "send_call_stats_periodical_updates", 0);
call->main_audio_stream_index = LINPHONE_CALL_STATS_AUDIO;
call->main_video_stream_index = LINPHONE_CALL_STATS_VIDEO;
call->main_text_stream_index = LINPHONE_CALL_STATS_TEXT;
......@@ -2236,7 +2237,7 @@ int linphone_call_prepare_ice(LinphoneCall *call, bool_t incoming_offer){
if (call->params->realtimetext_enabled) _linphone_call_prepare_ice_for_stream(call,call->main_text_stream_index,TRUE);
/*start ICE gathering*/
if (incoming_offer)
linphone_call_update_ice_from_remote_media_description(call,remote); /*this may delete the ice session*/
linphone_call_update_ice_from_remote_media_description(call, remote, TRUE); /*this may delete the ice session*/
if (call->ice_session && !ice_session_candidates_gathered(call->ice_session)){
if (call->audiostream->ms.state==MSStreamInitialized)
audio_stream_prepare_sound(call->audiostream, NULL, NULL);
......@@ -4165,20 +4166,22 @@ static void report_bandwidth(LinphoneCall *call, MediaStream *as, MediaStream *v
call->stats[LINPHONE_CALL_STATS_TEXT].rtcp_download_bandwidth=(ts_active) ? (float)(media_stream_get_rtcp_down_bw(ts)*1e-3) : 0.f;
call->stats[LINPHONE_CALL_STATS_TEXT].rtcp_upload_bandwidth=(ts_active) ? (float)(media_stream_get_rtcp_up_bw(ts)*1e-3) : 0.f;
call->stats[LINPHONE_CALL_STATS_AUDIO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE;
linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_AUDIO]);
call->stats[LINPHONE_CALL_STATS_AUDIO].updated=0;
if (as) update_local_stats(&call->stats[LINPHONE_CALL_STATS_AUDIO], as);
if (call->core->send_call_stats_periodical_updates){
call->stats[LINPHONE_CALL_STATS_AUDIO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE;
linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_AUDIO]);
call->stats[LINPHONE_CALL_STATS_AUDIO].updated=0;
if (as_active) update_local_stats(&call->stats[LINPHONE_CALL_STATS_AUDIO], as);
call->stats[LINPHONE_CALL_STATS_VIDEO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE;
linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_VIDEO]);
call->stats[LINPHONE_CALL_STATS_VIDEO].updated=0;
if (vs) update_local_stats(&call->stats[LINPHONE_CALL_STATS_VIDEO], vs);
call->stats[LINPHONE_CALL_STATS_VIDEO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE;
linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_VIDEO]);
call->stats[LINPHONE_CALL_STATS_VIDEO].updated=0;
if (vs_active) update_local_stats(&call->stats[LINPHONE_CALL_STATS_VIDEO], vs);
call->stats[LINPHONE_CALL_STATS_TEXT].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE;
linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_TEXT]);
call->stats[LINPHONE_CALL_STATS_TEXT].updated=0;
if (ts) update_local_stats(&call->stats[LINPHONE_CALL_STATS_TEXT], ts);
call->stats[LINPHONE_CALL_STATS_TEXT].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE;
linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_TEXT]);
call->stats[LINPHONE_CALL_STATS_TEXT].updated=0;
if (ts_active) update_local_stats(&call->stats[LINPHONE_CALL_STATS_TEXT], ts);
}
ms_message( "Bandwidth usage for call [%p]:\n"
......@@ -4309,8 +4312,7 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
linphone_core_update_ice_state_in_call_stats(call);
}
} else if (evt == ORTP_EVENT_ICE_RESTART_NEEDED) {
ice_session_restart(call->ice_session);
ice_session_set_role(call->ice_session, IR_Controlling);
ice_session_restart(call->ice_session, IR_Controlling);
linphone_core_update_call(call->core, call, call->current_params);
}
}
......@@ -4369,6 +4371,28 @@ void linphone_call_notify_stats_updated(LinphoneCall *call, int stream_index){
}
}
static MediaStream * linphone_call_get_media_stream(LinphoneCall *call, int stream_index){
if (stream_index == call->main_audio_stream_index)
return (MediaStream*)call->audiostream;
if (stream_index == call->main_video_stream_index)
return (MediaStream*)call->videostream;
if (stream_index == call->main_text_stream_index)
return (MediaStream*)call->textstream;
ms_error("linphone_call_get_media_stream(): no stream index %i", stream_index);
return NULL;
}
static OrtpEvQueue *linphone_call_get_event_queue(LinphoneCall *call, int stream_index){
if (stream_index == call->main_audio_stream_index)
return call->audiostream_app_evq;
if (stream_index == call->main_video_stream_index)
return call->videostream_app_evq;
if (stream_index == call->main_text_stream_index)
return call->textstream_app_evq;
ms_error("linphone_call_get_event_queue(): no stream index %i", stream_index);
return NULL;
}
void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){
MediaStream *ms = stream_index == call->main_audio_stream_index ? (MediaStream *)call->audiostream : (stream_index == call->main_video_stream_index ? (MediaStream *)call->videostream : (MediaStream *)call->textstream);
OrtpEvQueue *evq;
......@@ -4397,11 +4421,15 @@ void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){
}
}
/*yes the event queue has to be taken at each iteration, because ice events may perform operations re-creating the streams*/
while ((evq = stream_index == call->main_audio_stream_index ? call->audiostream_app_evq : (stream_index == call->main_video_stream_index ? call->videostream_app_evq : call->textstream_app_evq)) && (NULL != (ev=ortp_ev_queue_get(evq)))){
while((evq = linphone_call_get_event_queue(call, stream_index)) != NULL && NULL != (ev=ortp_ev_queue_get(evq))){
OrtpEventType evt=ortp_event_get_type(ev);
OrtpEventData *evd=ortp_event_get_data(ev);
int stats_index = stream_index == call->main_audio_stream_index ? LINPHONE_CALL_STATS_AUDIO : (stream_index == call->main_video_stream_index ? LINPHONE_CALL_STATS_VIDEO : LINPHONE_CALL_STATS_TEXT);
/*and yes the MediaStream must be taken at each iteration, because it may have changed due to the handling of events
* in this loop*/
ms = linphone_call_get_media_stream(call, stream_index);
if (ms) linphone_call_stats_fill(&call->stats[stats_index],ms,ev);
linphone_call_notify_stats_updated(call,stats_index);
......@@ -4786,8 +4814,10 @@ MSFormatType linphone_call_get_stream_type(LinphoneCall *call, int stream_index)
return MSVideo;
} else if (stream_index == call->main_text_stream_index) {
return MSText;
} else if (stream_index == call->main_audio_stream_index){
return MSAudio;
}
return MSAudio;
return MSUnknownMedia;
}
RtpTransport* linphone_call_get_meta_rtp_transport(LinphoneCall *call, int stream_index) {
......@@ -4846,6 +4876,7 @@ void linphone_call_repair_if_broken(LinphoneCall *call){
/*First, make sure that the proxy from which we received this call, or to which we routed this call is registered*/
if (!call->dest_proxy || linphone_proxy_config_get_state(call->dest_proxy) != LinphoneRegistrationOk) return;
if (!call->core->media_network_reachable) return;
switch (call->state){
case LinphoneCallStreamsRunning:
......@@ -4853,8 +4884,7 @@ void linphone_call_repair_if_broken(LinphoneCall *call){
case LinphoneCallPausedByRemote:
ms_message("LinphoneCall[%p] is going to be updated (reINVITE) in order to recover from lost connectivity", call);
if (call->ice_session){
ice_session_restart(call->ice_session);
ice_session_set_role(call->ice_session, IR_Controlling);
ice_session_restart(call->ice_session, IR_Controlling);
}
params = linphone_core_create_call_params(call->core, call);
linphone_core_update_call(call->core, call, params);
......
......@@ -1656,6 +1656,12 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
}
}
static void linphone_core_internal_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state) {
if (strcasecmp(linphone_event_get_name(lev), "Presence") == 0) {
linphone_friend_list_subscription_state_changed(lc, lev, state);
}
}
static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtable, LpConfig *config, void * userdata){
const char *remote_provisioning_uri = NULL;
LinphoneCoreVTable* local_vtable= linphone_core_v_table_new();
......@@ -1672,6 +1678,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
linphone_task_list_init(&lc->hooks);
internal_vtable->notify_received = linphone_core_internal_notify_received;
internal_vtable->subscription_state_changed = linphone_core_internal_subscription_state_changed;
_linphone_core_add_listener(lc, internal_vtable, TRUE, TRUE);
memcpy(local_vtable,vtable,sizeof(LinphoneCoreVTable));
_linphone_core_add_listener(lc, local_vtable, TRUE, FALSE);
......@@ -7119,7 +7126,7 @@ void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *para
params->realtimetext_enabled = linphone_core_realtime_text_enabled(lc);
params->privacy=LinphonePrivacyDefault;
params->avpf_enabled=linphone_core_get_avpf_mode(lc);
params->implicit_rtcp_fb = lp_config_get_int(lc->config,"rtp","rtcp_fb_implicit_rtcp_fb",TRUE);
params->implicit_rtcp_fb = lp_config_get_int(lc->config,"rtp","rtcp_fb_implicit_rtcp_fb",TRUE);
params->audio_dir=LinphoneMediaDirectionSendRecv;
params->video_dir=LinphoneMediaDirectionSendRecv;
params->real_early_media=lp_config_get_int(lc->config,"misc","real_early_media",FALSE);
......
......@@ -1254,7 +1254,7 @@ typedef enum _LinphoneChatMessageState {
* @param ud application user data
* @deprecated
*/
typedef LINPHONE_DEPRECATED void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud);
typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud);
/**
* Call back used to notify message delivery status
......
......@@ -944,8 +944,11 @@ public:
callobj = getCall(env, call);
if (stats->type == LINPHONE_CALL_STATS_AUDIO)
env->CallVoidMethod(callobj, ljb->callSetAudioStatsId, statsobj);
else
else if (stats->type == LINPHONE_CALL_STATS_VIDEO){
env->CallVoidMethod(callobj, ljb->callSetVideoStatsId, statsobj);
}else{
//text stats not updated yet.
}
env->CallVoidMethod(lcData->listener, ljb->callStatsUpdatedId, lcData->core, callobj, statsobj);
handle_possible_java_exception(env, lcData->listener);
if (statsobj) env->DeleteLocalRef(statsobj);
......
......@@ -944,8 +944,7 @@ void linphone_call_clear_unused_ice_candidates(LinphoneCall *call, const SalMedi
}
}
void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md)
{
void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md, bool_t is_offer){
const SalStreamDescription *stream;
IceCheckList *cl = NULL;
bool_t default_candidate = FALSE;
......@@ -975,14 +974,14 @@ void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call,
if (ice_params_found) {
/* Check for ICE restart and set remote credentials. */
if ((strcmp(md->addr, "0.0.0.0") == 0) || (strcmp(md->addr, "::0") == 0)) {
ice_session_restart(call->ice_session);
ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling);
ice_restarted = TRUE;
} else {
for (i = 0; i < md->nb_streams; i++) {
stream = &md->streams[i];
cl = ice_session_check_list(call->ice_session, i);
if (cl && (strcmp(stream->rtp_addr, "0.0.0.0") == 0)) {
ice_session_restart(call->ice_session);
ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling);
ice_restarted = TRUE;
break;
}
......@@ -992,7 +991,7 @@ void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call,
ice_session_set_remote_credentials(call->ice_session, md->ice_ufrag, md->ice_pwd);
} else if (ice_session_remote_credentials_changed(call->ice_session, md->ice_ufrag, md->ice_pwd)) {
if (ice_restarted == FALSE) {
ice_session_restart(call->ice_session);
ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling);
ice_restarted = TRUE;
}
ice_session_set_remote_credentials(call->ice_session, md->ice_ufrag, md->ice_pwd);
......@@ -1005,8 +1004,8 @@ void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call,
if (ice_restarted == FALSE
&& ice_check_list_get_remote_ufrag(cl)
&& ice_check_list_get_remote_pwd(cl)) {
/* restart onlu if remote ufrag/paswd was already set*/
ice_session_restart(call->ice_session);
/* restart only if remote ufrag/paswd was already set*/
ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling);
ice_restarted = TRUE;
}
ice_check_list_set_remote_credentials(cl, stream->ice_ufrag, stream->ice_pwd);
......
......@@ -153,16 +153,17 @@ struct _LinphoneCallParams{
bool_t has_audio;
bool_t has_video;
bool_t avpf_enabled; /* RTCP feedback messages are enabled */
bool_t implicit_rtcp_fb;
bool_t implicit_rtcp_fb;
bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/
bool_t in_conference; /*in conference mode */
bool_t low_bandwidth;
bool_t no_user_consent;/*when set to TRUE an UPDATE request will be used instead of reINVITE*/
uint16_t avpf_rr_interval; /*in milliseconds*/
bool_t internal_call_update; /*use mark that call update was requested internally (might be by ice) - unused for the moment*/
bool_t video_multicast_enabled;
bool_t audio_multicast_enabled;
bool_t realtimetext_enabled;
bool_t update_call_when_ice_completed;
......@@ -406,6 +407,7 @@ const LinphoneAddress* linphone_proxy_config_get_service_route(const LinphonePro
void linphone_friend_list_invalidate_subscriptions(LinphoneFriendList *list);
void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, LinphoneEvent *lev, const LinphoneContent *body);
void linphone_friend_list_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state);
void _linphone_friend_list_release(LinphoneFriendList *list);
void linphone_friend_invalidate_subscription(LinphoneFriend *lf);
void linphone_friend_close_subscriptions(LinphoneFriend *lf);
......@@ -497,7 +499,7 @@ void linphone_call_stats_fill(LinphoneCallStats *stats, MediaStream *ms, OrtpEve
void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call, SalMediaDescription *result);
void _update_local_media_description_from_ice(SalMediaDescription *desc, IceSession *session, bool_t use_nortpproxy);
void linphone_call_update_local_media_description_from_ice_or_upnp(LinphoneCall *call);
void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md);
void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md, bool_t is_offer);
void linphone_call_clear_unused_ice_candidates(LinphoneCall *call, const SalMediaDescription *md);
bool_t linphone_core_media_description_contains_video_stream(const SalMediaDescription *md);
......@@ -957,7 +959,8 @@ struct _LinphoneCore
bool_t ringstream_autorelease;
bool_t vtables_running;
bool_t pad[3];
bool_t send_call_stats_periodical_updates;
bool_t pad[2];
char localip[LINPHONE_IPADDR_SIZE];
int device_rotation;
int max_calls;
......
......@@ -89,7 +89,7 @@ bool_t linphone_core_upnp_hook(void *data);
void linphone_upnp_update(UpnpContext *ctx);
bool_t linphone_upnp_is_blacklisted(UpnpContext *ctx);
UpnpPortBinding *linphone_upnp_port_binding_new();
UpnpPortBinding *linphone_upnp_port_binding_new(void);
UpnpPortBinding *linphone_upnp_port_binding_new_with_parameters(upnp_igd_ip_protocol protocol, int local_port, int external_port);
UpnpPortBinding *linphone_upnp_port_binding_new_or_collect(MSList *list, upnp_igd_ip_protocol protocol, int local_port, int external_port);
UpnpPortBinding *linphone_upnp_port_binding_copy(const UpnpPortBinding *port);
......@@ -1089,7 +1089,7 @@ int linphone_core_update_local_media_description_from_upnp(SalMediaDescription *
* uPnP Port Binding
*/
UpnpPortBinding *linphone_upnp_port_binding_new() {
UpnpPortBinding *linphone_upnp_port_binding_new(void) {
UpnpPortBinding *port = NULL;
port = ms_new0(UpnpPortBinding,1);
ms_mutex_init(&port->mutex, NULL);
......@@ -1221,7 +1221,7 @@ void linphone_upnp_port_binding_release(UpnpPortBinding *port) {
* uPnP Stream
*/
UpnpStream* linphone_upnp_stream_new() {
UpnpStream* linphone_upnp_stream_new(void) {
UpnpStream *stream = ms_new0(UpnpStream,1);
stream->state = LinphoneUpnpStateIdle;
stream->rtp = NULL;
......
......@@ -245,7 +245,7 @@ void linphone_core_notify_notify_received(LinphoneCore *lc, LinphoneEvent *lev,
}
void linphone_core_notify_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state) {
NOTIFY_IF_EXIST(subscription_state_changed, lc,lev,state);
NOTIFY_IF_EXIST_INTERNAL(subscription_state_changed,linphone_event_is_internal(lev), lc,lev,state);
cleanup_dead_vtable_refs(lc);
}
......
......@@ -489,7 +489,7 @@ typedef void (*SalOnNotifyRefer)(SalOp *op, SalReferStatus state);
typedef void (*SalOnSubscribeResponse)(SalOp *op, SalSubscribeStatus status);
typedef void (*SalOnNotify)(SalOp *op, SalSubscribeStatus status, const char *event, SalBodyHandler *body);
typedef void (*SalOnSubscribeReceived)(SalOp *salop, const char *event, const SalBodyHandler *body);
typedef void (*SalOnSubscribeClosed)(SalOp *salop);
typedef void (*SalOnIncomingSubscribeClosed)(SalOp *salop);
typedef void (*SalOnParsePresenceRequested)(SalOp *salop, const char *content_type, const char *content_subtype, const char *content, SalPresenceModel **result);
typedef void (*SalOnConvertPresenceToXMLRequested)(SalOp *salop, SalPresenceModel *presence, const char *contact, char **content);
typedef void (*SalOnNotifyPresence)(SalOp *op, SalSubscribeStatus ss, SalPresenceModel *model, const char *msg);
......@@ -523,7 +523,7 @@ typedef struct SalCallbacks{
SalOnIsComposingReceived is_composing_received;
SalOnNotifyRefer notify_refer;
SalOnSubscribeReceived subscribe_received;
SalOnSubscribeClosed subscribe_closed;
SalOnIncomingSubscribeClosed incoming_subscribe_closed;
SalOnSubscribeResponse subscribe_response;
SalOnNotify notify;
SalOnSubscribePresenceReceived subscribe_presence_received;
......
mediastreamer2 @ 7053d54e
Subproject commit 7b1b79e2767fd4dcfe2d3db3d6c5c20951ac4c7a
Subproject commit 7053d54e7e3375944ee54671b82c3b5f63eac072
oRTP @ 83bf0a09
Subproject commit 02ce979cfdf80b68f1d13e1d0185bf2b827f4b7e
Subproject commit 83bf0a09cc2127086e15817d16793320c9fb9af0