diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index 03a467041..817c2f4ba 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -623,9 +623,6 @@ static int sal_add_listen_port(Sal *ctx, SalAddress* addr, bool_t is_tunneled){ belle_sip_listening_point_set_keep_alive(lp,ctx->keep_alive); result = belle_sip_provider_add_listening_point(ctx->prov,lp); if (sal_address_get_transport(addr)==SalTransportTLS) { - belle_sip_tls_listening_point_t *tls_lp = (belle_sip_tls_listening_point_t *)lp; - belle_sip_tls_listening_point_set_http_proxy_host(tls_lp,ctx->http_proxy_host); - belle_sip_tls_listening_point_set_http_proxy_port(tls_lp,ctx->http_proxy_port); set_tls_properties(ctx); } } else { @@ -1196,33 +1193,18 @@ int sal_enable_pending_trans_checking(Sal *sal, bool_t value) { return 0; } void sal_set_http_proxy_host(Sal *sal, const char *host) { - belle_sip_tls_listening_point_t *lp=(belle_sip_tls_listening_point_t *)belle_sip_provider_get_listening_point(sal->prov,"TLS"); - if (sal->http_proxy_host) ms_free (sal->http_proxy_host); - if (host) - sal->http_proxy_host = ms_strdup(host); - else - sal->http_proxy_host = NULL; - - if (lp){ - belle_sip_tls_listening_point_set_http_proxy_host(lp,sal->http_proxy_host); - belle_sip_tls_listening_point_set_http_proxy_port(lp,sal->http_proxy_port); - } + belle_sip_stack_set_http_proxy_host(sal->stack, host); } void sal_set_http_proxy_port(Sal *sal, int port) { - belle_sip_tls_listening_point_t *lp=(belle_sip_tls_listening_point_t *)belle_sip_provider_get_listening_point(sal->prov,"TLS"); - sal->http_proxy_port=port; - if (lp){ - belle_sip_tls_listening_point_set_http_proxy_port(lp,sal->http_proxy_port); - } - + belle_sip_stack_set_http_proxy_port(sal->stack, port); } const char *sal_get_http_proxy_host(const Sal *sal) { - return sal->http_proxy_host; + return belle_sip_stack_get_http_proxy_host(sal->stack); } int sal_get_http_proxy_port(const Sal *sal) { - return sal->http_proxy_port; + return belle_sip_stack_get_http_proxy_port(sal->stack); } diff --git a/coreapi/bellesip_sal/sal_impl.h b/coreapi/bellesip_sal/sal_impl.h index 6e72b68c9..b75be9156 100644 --- a/coreapi/bellesip_sal/sal_impl.h +++ b/coreapi/bellesip_sal/sal_impl.h @@ -52,8 +52,6 @@ struct Sal{ bool_t enable_sip_update; /*true by default*/ SalOpSDPHandling default_sdp_handling; bool_t pending_trans_checking; /*testing purpose*/ - char *http_proxy_host; - int http_proxy_port; }; typedef enum SalOpState { diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 5871425d1..982f64f2b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1634,7 +1634,9 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab lc->msevq=ms_factory_get_event_queue(ms_factory_get_fallback()); lc->sal=sal_init(); - + sal_set_http_proxy_host(lc->sal, linphone_core_get_http_proxy_host(lc)); + sal_set_http_proxy_port(lc->sal, linphone_core_get_http_proxy_port(lc)); + sal_set_user_pointer(lc->sal,lc); sal_set_callbacks(lc->sal,&linphone_sal_callbacks);