- if ((call->ice_session != NULL) && (call->videostream != NULL) && !params->has_video) {
- ice_session_remove_check_list(call->ice_session, call->videostream->ms.ice_check_list);
- call->videostream->ms.ice_check_list = NULL;
+ if((call->videostream != NULL) && !params->has_video) {
+ if (call->ice_session != NULL) {
+ ice_session_remove_check_list(call->ice_session, call->videostream->ms.ice_check_list);
+ call->videostream->ms.ice_check_list = NULL;
+ }
+#ifdef BUILD_UPNP
+ if(call->upnp_session != NULL) {
+ if (linphone_core_update_upnp(lc, call)<0) {
+ /* uPnP port mappings failed, proceed with the call anyway. */
+ linphone_call_delete_upnp_session(call);
+ }
+ }
+#endif //BUILD_UPNP