mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 20:18:09 +00:00
make sure dialog is in the right state before notifying
This commit is contained in:
parent
2ecb66aa42
commit
2f3f665343
1 changed files with 7 additions and 1 deletions
|
|
@ -292,7 +292,13 @@ static belle_sip_request_t *create_presence_notify(SalOp *op){
|
|||
}
|
||||
|
||||
int sal_notify_presence(SalOp *op, SalPresenceModel *presence){
|
||||
belle_sip_request_t* notify=create_presence_notify(op);
|
||||
belle_sip_dialog_state_t state=op->dialog?belle_sip_dialog_get_state(op->dialog): BELLE_SIP_DIALOG_NULL;
|
||||
belle_sip_request_t* notify=NULL;
|
||||
if (state != BELLE_SIP_DIALOG_CONFIRMED) {
|
||||
ms_warning("Cannot notify presence because dialog in state [%s]",belle_sip_dialog_state_to_string(state));
|
||||
return -1;
|
||||
}
|
||||
notify=create_presence_notify(op);
|
||||
sal_add_presence_info(op,BELLE_SIP_MESSAGE(notify),presence); /*FIXME, what about expires ??*/
|
||||
belle_sip_message_add_header(BELLE_SIP_MESSAGE(notify)
|
||||
,BELLE_SIP_HEADER(belle_sip_header_subscription_state_create(BELLE_SIP_SUBSCRIPTION_STATE_ACTIVE,600)));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue