proxy.c: fix crash in linphone_core_interpret_url when username is NULL and do...

proxy.c: fix crash in linphone_core_interpret_url when username is NULL and do not copy parameters when using proxy's domain
parent 853c89a6
......@@ -2925,21 +2925,6 @@ void linphone_configure_op(LinphoneCore *lc, SalOp *op, const LinphoneAddress *d
sal_op_cnx_ip_to_0000_if_sendonly_enable(op,lp_config_get_default_int(lc->config,"sip","cnx_ip_to_0000_if_sendonly_enabled",0)); /*also set in linphone_call_new_incoming*/
}
/**
* Initiates an outgoing call given a destination LinphoneAddress
*
* @ingroup call_control
* @param lc the LinphoneCore object
* @param addr the destination of the call (sip address).
@param params call parameters
*
* The LinphoneAddress can be constructed directly using linphone_address_new(), or
* created by linphone_core_interpret_url().
* The application doesn't own a reference to the returned LinphoneCall object.
* Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application.
*
* @return a LinphoneCall object or NULL in case of failure
**/
LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const LinphoneAddress *addr, const LinphoneCallParams *params)
{
const char *from=NULL;
......
......@@ -723,7 +723,7 @@ LINPHONE_PUBLIC const char *linphone_call_get_remote_contact(LinphoneCall *call)
/**
* Get the mesured playback volume level.
*
*
* @param call The call.
* @return float Volume level in percentage.
*/
......@@ -731,7 +731,7 @@ LINPHONE_PUBLIC float linphone_call_get_play_volume(LinphoneCall *call);
/**
* Get the mesured record volume level
*
*
* @param call The call.
* @return float Volume level in percentage.
*/
......@@ -741,7 +741,7 @@ LINPHONE_PUBLIC float linphone_call_get_record_volume(LinphoneCall *call);
* Get speaker volume gain.
* If the sound backend supports it, the returned gain is equal to the gain set
* with the system mixer.
*
*
* @param call The call.
* @return Percenatge of the max supported volume gain. Valid values are in [ 0.0 : 1.0 ].
* In case of failure, a negative value is returned
......@@ -751,7 +751,7 @@ LINPHONE_PUBLIC float linphone_call_get_speaker_volume_gain(const LinphoneCall *
/**
* Set speaker volume gain.
* If the sound backend supports it, the new gain will synchronized with the system mixer.
*
*
* @param call The call.
* @param volume Percentage of the max supported gain. Valid values are in [ 0.0 : 1.0 ].
*/
......@@ -761,7 +761,7 @@ LINPHONE_PUBLIC void linphone_call_set_speaker_volume_gain(LinphoneCall *call, f
* Get microphone volume gain.
* If the sound backend supports it, the returned gain is equal to the gain set
* with the system mixer.
*
*
* @param call The call.
* @return double Percenatge of the max supported volume gain. Valid values are in [ 0.0 : 1.0 ].
* In case of failure, a negative value is returned
......@@ -771,7 +771,7 @@ LINPHONE_PUBLIC float linphone_call_get_microphone_volume_gain(const LinphoneCal
/**
* Set microphone volume gain.
* If the sound backend supports it, the new gain will synchronized with the system mixer.
*
*
* @param call The call.
* @param volume Percentage of the max supported gain. Valid values are in [ 0.0 : 1.0 ].
*/
......@@ -896,7 +896,7 @@ typedef enum _LinphoneAudioRoute LinphoneAudioRoute;
* Change the playback output device (currently only used for blackberry)
* @param call
* @param route the wanted audio route (earpiece, speaker, ...)
*
*
* @ingroup call_control
**/
LINPHONE_PUBLIC void linphone_call_set_audio_route(LinphoneCall *call, LinphoneAudioRoute route);
......@@ -2319,6 +2319,21 @@ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, co
LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *url, const LinphoneCallParams *params);
/**
* Initiates an outgoing call given a destination LinphoneAddress
*
* @ingroup call_control
* @param lc the LinphoneCore object
* @param addr the destination of the call (sip address).
@param params call parameters
*
* The LinphoneAddress can be constructed directly using linphone_address_new(), or
* created by linphone_core_interpret_url().
* The application doesn't own a reference to the returned LinphoneCall object.
* Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application.
*
* @return a LinphoneCall object or NULL in case of failure
**/
LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const LinphoneAddress *addr, const LinphoneCallParams *params);
LINPHONE_PUBLIC int linphone_core_transfer_call(LinphoneCore *lc, LinphoneCall *call, const char *refer_to);
......
......@@ -1003,7 +1003,7 @@ LinphoneAddress* linphone_proxy_config_normalize_sip_uri(LinphoneProxyConfig *pr
char *tmpurl;
LinphoneAddress *uri;
if (*username=='\0') return NULL;
if (!username || *username=='\0') return NULL;
if (is_enum(username,&enum_domain)){
if (proxy) {
......@@ -1036,8 +1036,9 @@ LinphoneAddress* linphone_proxy_config_normalize_sip_uri(LinphoneProxyConfig *pr
}
if (proxy!=NULL){
/* append the proxy domain suffix */
/* append the proxy domain suffix but remove any custom parameters/headers */
LinphoneAddress *uri=linphone_address_clone(linphone_proxy_config_get_identity_address(proxy));
linphone_address_clean(uri);
if (uri==NULL){
return NULL;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment