if (call->referer) linphone_core_notify_refer_state(lc,call->referer,call);
}
if (md && !sal_media_description_empty(md)){
+ linphone_call_update_remote_session_id_and_ver(call);
if (sal_media_description_has_dir(md,SalStreamSendOnly) ||
sal_media_description_has_dir(md,SalStreamInactive)){
if (lc->vtable.display_status){
linphone_core_update_ice_from_remote_media_description(call,rmd);
linphone_core_update_local_media_description_from_ice(call->localdesc,call->ice_session);
}
+ linphone_call_update_remote_session_id_and_ver(call);
sal_call_accept(call->op);
md=sal_call_get_final_media_description(call->op);
if (md && !sal_media_description_empty(md))
#endif
}
+void linphone_call_update_remote_session_id_and_ver(LinphoneCall *call) {
+ SalMediaDescription *remote_desc = sal_call_get_remote_media_description(call->op);
+ if (remote_desc) {
+ ms_warning("linphone_call_update_remote_session_id_and_ver(): id=%u, ver=%u",
+ remote_desc->session_id, remote_desc->session_ver);
+ call->remote_session_id = remote_desc->session_id;
+ call->remote_session_ver = remote_desc->session_ver;
+ }
+}
+
void linphone_call_delete_ice_session(LinphoneCall *call){
if (call->ice_session != NULL) {
ice_session_destroy(call->ice_session);
}
linphone_core_update_local_media_description_from_ice(call->localdesc, call->ice_session);
}
+ linphone_call_update_remote_session_id_and_ver(call);
sal_call_set_local_media_description(call->op,call->localdesc);
sal_call_accept(call->op);
md=sal_call_get_final_media_description(call->op);
* @return 0 if sucessful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state).
**/
int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
+ SalMediaDescription *remote_desc;
#ifdef VIDEO_ENABLED
bool_t old_has_video = call->params.has_video;
#endif
linphone_call_state_to_string(call->state));
return -1;
}
+ remote_desc = sal_call_get_remote_media_description(call->op);
+ ms_warning("linphone_core_accept_update(): rmt_id=%u, rmt_ver=%u, call->rmt_id=%u, call->rmt_ver=%u",
+ remote_desc->session_id, remote_desc->session_ver, call->remote_session_id, call->remote_session_ver);
+ if ((remote_desc->session_id == call->remote_session_id) && (remote_desc->session_ver == call->remote_session_ver)) {
+ /* Remote has sent an INVITE with the same SDP as before, so send a 200 OK with the same SDP as before. */
+ ms_warning("Send same SDP as before!");
+ sal_call_accept(call->op);
+ linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
+ return 0;
+ }
if (params==NULL){
call->params.has_video=lc->video_policy.automatically_accept || call->current_params.has_video;
}else
ms_warning("Video isn't supported in conference");
call->params.has_video = FALSE;
}
- call->params.has_video &= linphone_core_media_description_contains_video_stream(sal_call_get_remote_media_description(call->op));
+ call->params.has_video &= linphone_core_media_description_contains_video_stream(remote_desc);
call->camera_active=call->params.has_video;
linphone_call_make_local_media_description(lc,call);
if (call->ice_session != NULL) {
- linphone_core_update_ice_from_remote_media_description(call, sal_call_get_remote_media_description(call->op));
+ linphone_core_update_ice_from_remote_media_description(call, remote_desc);
#ifdef VIDEO_ENABLED
if ((call->ice_session != NULL) &&!ice_session_candidates_gathered(call->ice_session)) {
if ((call->params.has_video) && (call->params.has_video != old_has_video)) {
audio_stream_prepare_sound(call->audiostream,lc->sound_conf.play_sndcard,lc->sound_conf.capt_sndcard);
}
+ linphone_call_update_remote_session_id_and_ver(call);
sal_call_accept(call->op);
if (lc->vtable.display_status!=NULL)
lc->vtable.display_status(lc,_("Connected."));
IceSession *ice_session;
LinphoneChatMessage* pending_message;
int ping_time;
+ unsigned int remote_session_id;
+ unsigned int remote_session_ver;
bool_t refer_pending;
bool_t media_pending;
bool_t audio_muted;
void linphone_call_delete_ice_session(LinphoneCall *call);
void linphone_call_stop_media_streams_for_ice_gathering(LinphoneCall *call);
void linphone_call_update_crypto_parameters(LinphoneCall *call, SalMediaDescription *old_md, SalMediaDescription *new_md);
+void linphone_call_update_remote_session_id_and_ver(LinphoneCall *call);
const char * linphone_core_get_identity(LinphoneCore *lc);
const char * linphone_core_get_route(LinphoneCore *lc);
int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){
int i,j;
const char *mtype,*proto,*rtp_port,*rtp_addr,*number;
+ const char *sess;
sdp_bandwidth_t *sbw=NULL;
sdp_attribute_t *attr;
int nb_ice_candidates;
+ /* Get session information. */
+ sess = sdp_message_o_sess_id_get(msg);
+ if (sess) desc->session_id = strtoul(sess, NULL, 10);
+ sess = sdp_message_o_sess_version_get(msg);
+ if (sess) desc->session_ver = strtoul(sess, NULL, 10);
+
rtp_addr=sdp_message_c_addr_get (msg, -1, 0);
if (rtp_addr)
strncpy(desc->addr,rtp_addr,sizeof(desc->addr));