mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 21:58:08 +00:00
Allow activation of AVPF for a call based on the proxy configuration.
This commit is contained in:
parent
2110281d2e
commit
1a5f37eaba
6 changed files with 53 additions and 3 deletions
|
|
@ -340,6 +340,7 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
|
|||
md->session_id=(old_md ? old_md->session_id : (rand() & 0xfff));
|
||||
md->session_ver=(old_md ? (old_md->session_ver+1) : (rand() & 0xfff));
|
||||
md->n_total_streams=(call->biggestdesc ? call->biggestdesc->n_total_streams : 1);
|
||||
md->avpf_rr_interval = call->params.avpf_rr_interval;
|
||||
|
||||
strncpy(md->addr,local_ip,sizeof(md->addr));
|
||||
strncpy(md->username,linphone_address_get_username(addr),sizeof(md->username));
|
||||
|
|
|
|||
|
|
@ -2825,6 +2825,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
|
|||
char *real_url=NULL;
|
||||
LinphoneCall *call;
|
||||
bool_t defer = FALSE;
|
||||
LinphoneCallParams *cp = linphone_call_params_copy(params);
|
||||
|
||||
linphone_core_preempt_sound_resources(lc);
|
||||
|
||||
|
|
@ -2837,20 +2838,24 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
|
|||
real_url=linphone_address_as_string(addr);
|
||||
proxy=linphone_core_lookup_known_proxy(lc,addr);
|
||||
|
||||
if (proxy!=NULL)
|
||||
if (proxy!=NULL) {
|
||||
from=linphone_proxy_config_get_identity(proxy);
|
||||
cp->avpf_enabled = proxy->avpf_enabled;
|
||||
cp->avpf_rr_interval = proxy->avpf_rr_interval;
|
||||
}
|
||||
|
||||
/* if no proxy or no identity defined for this proxy, default to primary contact*/
|
||||
if (from==NULL) from=linphone_core_get_primary_contact(lc);
|
||||
|
||||
parsed_url2=linphone_address_new(from);
|
||||
|
||||
call=linphone_call_new_outgoing(lc,parsed_url2,linphone_address_clone(addr),params,proxy);
|
||||
call=linphone_call_new_outgoing(lc,parsed_url2,linphone_address_clone(addr),cp,proxy);
|
||||
|
||||
if(linphone_core_add_call(lc,call)!= 0)
|
||||
{
|
||||
ms_warning("we had a problem in adding the call into the invite ... weird");
|
||||
linphone_call_unref(call);
|
||||
linphone_call_params_destroy(cp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -2895,6 +2900,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
|
|||
if (defer==FALSE) linphone_core_start_invite(lc,call,NULL);
|
||||
|
||||
if (real_url!=NULL) ms_free(real_url);
|
||||
linphone_call_params_destroy(cp);
|
||||
return call;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -929,6 +929,27 @@ LINPHONE_PUBLIC void linphone_proxy_config_set_privacy(LinphoneProxyConfig *para
|
|||
* */
|
||||
LINPHONE_PUBLIC LinphonePrivacyMask linphone_proxy_config_get_privacy(const LinphoneProxyConfig *params);
|
||||
|
||||
/**
|
||||
* Indicates whether AVPF/SAVPF must be used for calls using this proxy config.
|
||||
* @param[in] cfg #LinphoneProxyConfig object
|
||||
* @param[in] enable True to enable AVPF/SAVF, false to disable it.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_proxy_config_enable_avpf(LinphoneProxyConfig *cfg, bool_t enable);
|
||||
|
||||
/**
|
||||
* Set the interval between regular RTCP reports when using AVPF/SAVPF.
|
||||
* @param[in] cfg #LinphoneProxyConfig object
|
||||
* @param[in] interval The interval in seconds (between 0 and 5 seconds).
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_proxy_config_set_avpf_rr_interval(LinphoneProxyConfig *cfg, uint8_t interval);
|
||||
|
||||
/**
|
||||
* Get the interval between regular RTCP reports when using AVPF/SAVPF.
|
||||
* @param[in] cfg #LinphoneProxyConfig object
|
||||
* @return The interval in seconds.
|
||||
*/
|
||||
LINPHONE_PUBLIC uint8_t linphone_proxy_config_get_avpf_rr_interval(const LinphoneProxyConfig *cfg);
|
||||
|
||||
/**
|
||||
* @}
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ struct _LinphoneCallParams{
|
|||
bool_t in_conference; /*in conference mode */
|
||||
bool_t low_bandwidth;
|
||||
LinphonePrivacyMask privacy;
|
||||
uint8_t avpf_rr_interval;
|
||||
};
|
||||
|
||||
struct _LinphoneCallLog{
|
||||
|
|
@ -430,7 +431,9 @@ struct _LinphoneProxyConfig
|
|||
bool_t dial_escape_plus;
|
||||
bool_t send_publish;
|
||||
bool_t send_statistics;
|
||||
bool_t pad[3];
|
||||
bool_t avpf_enabled;
|
||||
bool_t pad;
|
||||
uint8_t avpf_rr_interval;
|
||||
void* user_data;
|
||||
time_t deletion_date;
|
||||
LinphonePrivacyMask privacy;
|
||||
|
|
|
|||
|
|
@ -1183,6 +1183,8 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
|
|||
lp_config_set_int(config,key,"reg_expires",obj->expires);
|
||||
lp_config_set_int(config,key,"reg_sendregister",obj->reg_sendregister);
|
||||
lp_config_set_int(config,key,"publish",obj->publish);
|
||||
lp_config_set_int(config, key, "avpf", obj->avpf_enabled);
|
||||
lp_config_set_int(config, key, "avpf_rr_interval", obj->avpf_rr_interval);
|
||||
lp_config_set_int(config,key,"dial_escape_plus",obj->dial_escape_plus);
|
||||
lp_config_set_int(config,key,"send_statistics",obj->send_statistics);
|
||||
lp_config_set_string(config,key,"dial_prefix",obj->dial_prefix);
|
||||
|
|
@ -1229,6 +1231,9 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config
|
|||
|
||||
linphone_proxy_config_enable_publish(cfg,lp_config_get_int(config,key,"publish",0));
|
||||
|
||||
linphone_proxy_config_enable_avpf(cfg, lp_config_get_int(config, key, "avpf", 0));
|
||||
linphone_proxy_config_set_avpf_rr_interval(cfg, lp_config_get_int(config, key, "avpf_rr_interval", 0));
|
||||
|
||||
linphone_proxy_config_set_dial_escape_plus(cfg,lp_config_get_int(config,key,"dial_escape_plus",lp_config_get_default_int(config,"proxy","dial_escape_plus",0)));
|
||||
linphone_proxy_config_set_dial_prefix(cfg,lp_config_get_string(config,key,"dial_prefix",lp_config_get_default_string(config,"proxy","dial_prefix",NULL)));
|
||||
|
||||
|
|
@ -1541,3 +1546,16 @@ int linphone_proxy_config_get_publish_expires(const LinphoneProxyConfig *obj) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
void linphone_proxy_config_enable_avpf(LinphoneProxyConfig *cfg, bool_t enable) {
|
||||
cfg->avpf_enabled = enable;
|
||||
}
|
||||
|
||||
void linphone_proxy_config_set_avpf_rr_interval(LinphoneProxyConfig *cfg, uint8_t interval) {
|
||||
if (interval > 5) interval = 5;
|
||||
cfg->avpf_rr_interval = interval;
|
||||
}
|
||||
|
||||
uint8_t linphone_proxy_config_get_avpf_rr_interval(const LinphoneProxyConfig *cfg) {
|
||||
return cfg->avpf_rr_interval;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ typedef struct SalMediaDescription{
|
|||
unsigned int session_ver;
|
||||
unsigned int session_id;
|
||||
SalStreamDir dir;
|
||||
uint8_t avpf_rr_interval;
|
||||
SalStreamDescription streams[SAL_MEDIA_DESCRIPTION_MAX_STREAMS];
|
||||
OrtpRtcpXrConfiguration rtcp_xr;
|
||||
char ice_ufrag[SAL_MEDIA_DESCRIPTION_MAX_ICE_UFRAG_LEN];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue