Commit 44d9246e authored by Simon Morlat's avatar Simon Morlat
Browse files

indicate that a dialog is expired in the dialog_terminated event

parent 34a227fd
......@@ -57,6 +57,7 @@ BELLESIP_EXPORT belle_sip_dialog_t *belle_sip_request_event_get_dialog(const bel
/*Dialog terminated event*/
BELLESIP_EXPORT belle_sip_dialog_t* belle_sip_dialog_terminated_event_get_dialog(const belle_sip_dialog_terminated_event_t *event);
BELLESIP_EXPORT int belle_sip_dialog_terminated_event_is_expired(const belle_sip_dialog_terminated_event_t *event);
/**
* Timeout Event
......
......@@ -809,11 +809,12 @@ struct belle_sip_dialog{
belle_sip_transaction_t* last_transaction;
belle_sip_header_privacy_t* privacy;
belle_sip_list_t *queued_ct;/* queued client transactions*/
unsigned int remote_invite_cseq; /*needed because multiple trans can be handled whithin invite transaction (I.E UPDATE, PRACK,etc*/
unsigned char is_server;
unsigned char is_secure;
unsigned char terminate_on_bye;
unsigned char needs_ack;
unsigned int remote_invite_cseq; /*needed because multiple trans can be handled whithin invite transaction (I.E UPDATE, PRACK,etc*/
unsigned char is_expired;
unsigned char pending_trans_checking_enabled; /*use to disabled pending transaction check at request creation (testing)*/
};
......@@ -887,6 +888,7 @@ belle_sdp_##object_type##_t* belle_sdp_##object_type##_parse (const char* value)
struct belle_sip_dialog_terminated_event{
belle_sip_provider_t *source;
belle_sip_dialog_t *dialog;
int is_expired;
};
struct belle_sip_io_error_event{
......
......@@ -205,6 +205,7 @@ static int belle_sip_dialog_init_as_uac(belle_sip_dialog_t *obj, belle_sip_reque
static int belle_sip_dialog_expired(belle_sip_dialog_t *dialog){
belle_sip_message("Dialog [%p] expired", dialog);
dialog->is_expired = TRUE;
belle_sip_dialog_delete(dialog);
return BELLE_SIP_STOP;
}
......@@ -751,7 +752,7 @@ void belle_sip_dialog_delete(belle_sip_dialog_t *obj){
belle_sip_object_unref(obj->expiration_timer);
obj->expiration_timer = NULL;
}
belle_sip_message("dialog [%p] deleted.",obj);
belle_sip_message("Dialog [%p] deleted (is_expired=%i)",obj, obj->is_expired);
belle_sip_dialog_stop_200Ok_retrans(obj); /*if any*/
set_state(obj,BELLE_SIP_DIALOG_TERMINATED);
dropped_transactions=belle_sip_list_size(obj->queued_ct);
......
......@@ -689,10 +689,11 @@ void belle_sip_provider_remove_dialog(belle_sip_provider_t *prov, belle_sip_dial
belle_sip_dialog_terminated_event_t* ev=belle_sip_malloc(sizeof(belle_sip_dialog_terminated_event_t));
ev->source=prov;
ev->dialog=dialog;
ev->is_expired=dialog->is_expired;
prov->dialogs=belle_sip_list_remove(prov->dialogs,dialog);
belle_sip_main_loop_do_later(belle_sip_stack_get_main_loop(prov->stack)
,(belle_sip_callback_t) notify_dialog_terminated
, ev);
,(belle_sip_callback_t) notify_dialog_terminated
, ev);
}
......
......@@ -94,8 +94,8 @@ static void schedule_timer(belle_sip_refresher_t* refresher) {
}
static void process_dialog_terminated(belle_sip_listener_t *user_ctx, const belle_sip_dialog_terminated_event_t *event){
/*nop*/
}
static void process_io_error(belle_sip_listener_t *user_ctx, const belle_sip_io_error_event_t *event){
belle_sip_refresher_t* refresher=(belle_sip_refresher_t*)user_ctx;
belle_sip_client_transaction_t*client_transaction;
......
......@@ -46,6 +46,10 @@ belle_sip_dialog_t* belle_sip_dialog_terminated_event_get_dialog(const belle_sip
return event->dialog;
}
int belle_sip_dialog_terminated_event_is_expired(const belle_sip_dialog_terminated_event_t *event){
return event->is_expired;
}
const char* belle_sip_io_error_event_get_host(const belle_sip_io_error_event_t* event) {
return event->host;
}
......
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