}
#ifdef BUILD_UPNP
if (linphone_core_get_firewall_policy(call->core) == LinphonePolicyUseUpnp) {
- call->upnp_session = upnp_session_new();
+ call->upnp_session = upnp_session_new(call);
}
#endif //BUILD_UPNP
call->camera_active=params->has_video;
case LinphonePolicyUseStun:
call->ping_time=linphone_core_run_stun_tests(call->core,call);
/* No break to also destroy ice session in this case. */
+ break;
+ case LinphonePolicyUseUpnp:
+#ifdef BUILD_UPNP
+ call->upnp_session = upnp_session_new(call);
+ if (call->ice_session != NULL) {
+ linphone_call_init_media_streams(call);
+ if (linphone_core_update_upnp(call->core,call)<0) {
+ /* uPnP port mappings failed, proceed with the call anyway. */
+ linphone_call_delete_upnp_session(call);
+ }
+ }
+#endif //BUILD_UPNP
+ break;
default:
break;
}
static void linphone_call_destroy(LinphoneCall *obj)
{
+#ifdef BUILD_UPNP
+ linphone_call_delete_upnp_session(obj);
+#endif //BUILD_UPNP
linphone_call_delete_ice_session(obj);
if (obj->op!=NULL) {
sal_op_release(obj->op);
}
}
+#ifdef BUILD_UPNP
+void linphone_call_delete_upnp_session(LinphoneCall *call){
+ if(call->upnp_session!=NULL) {
+ upnp_session_destroy(call->upnp_session);
+ call->upnp_session=NULL;
+ }
+}
+#endif //BUILD_UPNP
+
static void linphone_call_log_fill_stats(LinphoneCallLog *log, AudioStream *st){
audio_stream_get_local_rtp_stats (st,&log->local_stats);
log->quality=audio_stream_get_average_quality_rating(st);
report_bandwidth(call,as,vs);
ms_message("Thread processing load: audio=%f\tvideo=%f",audio_load,video_load);
}
+
+#ifdef BUILD_UPNP
+ upnp_call_process(call);
+#endif //BUILD_UPNP
+
#ifdef VIDEO_ENABLED
if (call->videostream!=NULL) {
OrtpEvent *ev;