fix crash and compilation issue

This commit is contained in:
Simon Morlat 2015-10-19 13:04:04 +02:00
parent 59b7e88d7d
commit 17f575229b
2 changed files with 9 additions and 5 deletions

View file

@ -96,9 +96,11 @@ static void presence_response_event(void *op_base, const belle_sip_response_even
sal_op_set_error_info_from_response(op,response);
if (code>=300) {
ms_message("subscription to [%s] rejected",sal_op_get_to(op));
op->base.root->callbacks.notify_presence(op,SalSubscribeTerminated, NULL,NULL); /*NULL = offline*/
return;
if (strcmp("SUBSCRIBE",belle_sip_request_get_method(request))==0){
ms_message("subscription to [%s] rejected",sal_op_get_to(op));
op->base.root->callbacks.notify_presence(op,SalSubscribeTerminated, NULL,NULL); /*NULL = offline*/
return;
}
}
set_or_update_dialog(op_base,belle_sip_response_event_get_dialog(event));
if (!op->dialog) {

View file

@ -88,9 +88,11 @@ static void phone_normalization_with_dial_escape_plus(void){
#define SIP_URI_CHECK(actual, expected) { \
LinphoneProxyConfig *proxy = linphone_proxy_config_new(); \
LinphoneAddress* res;\
char* actual_str;\
linphone_proxy_config_set_identity(proxy, "sip:username@linphone.org"); \
LinphoneAddress* res = linphone_proxy_config_normalize_sip_uri(proxy, actual); \
char* actual_str = linphone_address_as_string_uri_only(res); \
res = linphone_proxy_config_normalize_sip_uri(proxy, actual); \
actual_str = linphone_address_as_string_uri_only(res); \
BC_ASSERT_STRING_EQUAL(actual_str, expected); \
ms_free(actual_str); \
linphone_address_destroy(res); \