mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 13:48:09 +00:00
fix bug causing double subscribe.
This commit is contained in:
parent
58c0d50bb2
commit
180a835ed6
3 changed files with 12 additions and 8 deletions
|
|
@ -152,6 +152,7 @@ void __linphone_friend_do_subscribe(LinphoneFriend *fr){
|
|||
fr->outsub=sal_op_new(fr->lc->sal);
|
||||
sal_op_set_route(fr->outsub,route);
|
||||
sal_subscribe_presence(fr->outsub,from,friend);
|
||||
fr->subscribe_active=TRUE;
|
||||
ms_free(friend);
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +365,7 @@ void linphone_friend_apply(LinphoneFriend *fr, LinphoneCore *lc){
|
|||
fr->inc_subscribe_pending=FALSE;
|
||||
}
|
||||
if (fr->subscribe && fr->subscribe_active==FALSE){
|
||||
|
||||
ms_message("Sending a new SUBSCRIBE");
|
||||
__linphone_friend_do_subscribe(fr);
|
||||
}
|
||||
ms_message("linphone_friend_apply() done.");
|
||||
|
|
|
|||
|
|
@ -1305,7 +1305,7 @@ static bool_t process_event(Sal *sal, eXosip_event_t *ev){
|
|||
}
|
||||
break;
|
||||
case EXOSIP_IN_SUBSCRIPTION_NEW:
|
||||
ms_message("CALL_SUBSCRIPTION_NEW ");
|
||||
ms_message("CALL_IN_SUBSCRIPTION_NEW ");
|
||||
sal_exosip_subscription_recv(sal,ev);
|
||||
break;
|
||||
case EXOSIP_IN_SUBSCRIPTION_RELEASED:
|
||||
|
|
|
|||
|
|
@ -416,7 +416,7 @@ int sal_notify_presence(SalOp *op, SalPresenceStatus status, const char *status_
|
|||
}
|
||||
|
||||
int sal_notify_close(SalOp *op){
|
||||
osip_message_t *msg;
|
||||
osip_message_t *msg=NULL;
|
||||
eXosip_lock();
|
||||
eXosip_insubscription_build_notify(op->did,EXOSIP_SUBCRSTATE_TERMINATED,DEACTIVATED,&msg);
|
||||
if (msg!=NULL){
|
||||
|
|
@ -424,7 +424,8 @@ int sal_notify_close(SalOp *op){
|
|||
if (identity==NULL) identity=sal_op_get_to(op);
|
||||
osip_message_set_contact(msg,identity);
|
||||
eXosip_insubscription_send_request(op->did,msg);
|
||||
}else ms_error("sal_notify_close(): could not create notify for incoming subscription.");
|
||||
}else ms_error("sal_notify_close(): could not create notify for incoming subscription"
|
||||
" did=%i, nid=%i",op->did,op->nid);
|
||||
eXosip_unlock();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -668,15 +669,16 @@ void sal_exosip_in_subscription_closed(Sal *sal, eXosip_event_t *ev){
|
|||
ms_error("Incoming subscription closed but no associated op !");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sal_remove_in_subscribe(sal,op);
|
||||
op->nid=-1;
|
||||
op->did=-1;
|
||||
if (ev->request){
|
||||
osip_from_to_str(ev->request->from,&tmp);
|
||||
sal->callbacks.subscribe_closed(op,tmp);
|
||||
osip_free(tmp);
|
||||
}
|
||||
|
||||
sal_remove_in_subscribe(sal,op);
|
||||
op->nid=-1;
|
||||
op->did=-1;
|
||||
}
|
||||
|
||||
void sal_exosip_subscription_closed(Sal *sal,eXosip_event_t *ev){
|
||||
|
|
@ -688,6 +690,7 @@ void sal_exosip_subscription_closed(Sal *sal,eXosip_event_t *ev){
|
|||
sal_remove_out_subscribe(sal,op);
|
||||
op->sid=-1;
|
||||
op->did=-1;
|
||||
sal->callbacks.notify(op,SalSubscribeTerminated, SalPresenceOffline,NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue