/* this callback is called when an incoming re-INVITE modifies the session*/ static void call_updating(SalOp *op){ LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op)); LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op); LinphoneCallState prevstate=LinphoneCallIdle; SalMediaDescription *md; md=sal_call_get_final_media_description(op); if (md && !sal_media_description_empty(md)) { if (sal_media_description_has_dir(call->localdesc,SalStreamSendRecv)){ ms_message("Our local status is SalStreamSendRecv"); if (sal_media_description_has_dir (md,SalStreamRecvOnly) || sal_media_description_has_dir(md,SalStreamInactive)){ /* we are being paused */ if(lc->vtable.display_status) lc->vtable.display_status(lc,_("We are being paused...")); linphone_call_set_state (call,LinphoneCallPausedByRemote,"Call paused by remote"); }else if (!sal_media_description_has_dir(call->resultdesc,SalStreamSendRecv) && sal_media_description_has_dir(md,SalStreamSendRecv)){ if(lc->vtable.display_status) lc->vtable.display_status(lc,_("We have been resumed...")); linphone_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)"); lc->current_call=call; }else{ prevstate=call->state; linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote"); } } /*accept the modification (sends a 200Ok)*/ sal_call_accept(op); linphone_core_update_streams (lc,call,md); if (prevstate!=LinphoneCallIdle){ linphone_call_set_state (call,prevstate,"Connected (streams running)"); } } }
static void call_accept_update(LinphoneCore *lc, LinphoneCall *call){ SalMediaDescription *md; SalMediaDescription *rmd=sal_call_get_remote_media_description(call->op); if (rmd!=NULL && call->ice_session!=NULL) { linphone_core_update_ice_from_remote_media_description(call,rmd); linphone_core_update_local_media_description_from_ice(call->localdesc,call->ice_session); } #ifdef BUILD_UPNP if(call->upnp_session != NULL) { linphone_core_update_upnp_from_remote_media_description(call, rmd); linphone_core_update_local_media_description_from_upnp(call->localdesc,call->upnp_session); } #endif //BUILD_UPNP 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)){ linphone_core_update_streams(lc,call,md); } }