Commit 50469413 authored by jehan's avatar jehan
Browse files

fix crash when presence request is declined by an error sip message

parent 798bd065
......@@ -98,8 +98,8 @@ static void presence_response_event(void *op_base, const belle_sip_response_even
belle_sip_header_expires_t* expires;
if (sal_compute_sal_errors(response,&error,&sr,reason, sizeof(reason))) {
ms_error("subscription to [%s] rejected reason [%s]",sal_op_get_to(op),reason[0]!=0?reason:sal_reason_to_string(sr));
op->base.root->callbacks.notify_presence(op,SalSubscribeTerminated, SalPresenceOffline,NULL);
ms_error("subscription to [%s] rejected reason [%s]",sal_op_get_to(op),reason[0]!=0?reason:sal_reason_to_string(sr));
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));
......
......@@ -1587,7 +1587,7 @@ void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeStatus ss, Sa
char *tmp;
LinphoneFriend *lf;
LinphoneAddress *friend=NULL;
LinphonePresenceModel *presence = (LinphonePresenceModel *)model;
LinphonePresenceModel *presence = model ? (LinphonePresenceModel *)model:linphone_presence_model_new_with_activity(LinphonePresenceActivityOffline, NULL);
lf=linphone_find_friend_by_out_subscribe(lc->friends,op);
if (lf==NULL && lp_config_get_int(lc->config,"sip","allow_out_of_subscribe_presence",0)){
......
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