Module: kamailio
Branch: master
Commit: 0e22abe2b89be8936df4b8230955fbaf43ad40e7
URL:
https://github.com/kamailio/kamailio/commit/0e22abe2b89be8936df4b8230955fba…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-05-11T17:16:09+02:00
dialog: don't send keepalive if dialog not in confirmed state
- if dialog is in deleted state, remove it from keep alive list
immediately
---
Modified: modules/dialog/dlg_hash.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0e22abe2b89be8936df4b8230955fba…
Patch:
https://github.com/kamailio/kamailio/commit/0e22abe2b89be8936df4b8230955fba…
---
diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c
index 1c42bed..536fe32 100644
--- a/modules/dialog/dlg_hash.c
+++ b/modules/dialog/dlg_hash.c
@@ -169,8 +169,9 @@ int dlg_ka_run(ticks_t ti)
if(*dlg_ka_list_head == *dlg_ka_list_tail) {
*dlg_ka_list_head = NULL;
*dlg_ka_list_tail = NULL;
+ } else {
+ *dlg_ka_list_head = dka->next;
}
- *dlg_ka_list_head = dka->next;
lock_release(dlg_ka_list_lock);
/* send keep-alive for dka */
@@ -179,10 +180,16 @@ int dlg_ka_run(ticks_t ti)
shm_free(dka);
dka = NULL;
} else {
- if(dka->iflags & DLG_IFLAG_KA_SRC)
+ if((dka->iflags & DLG_IFLAG_KA_SRC)
+ && (dlg->state==DLG_STATE_CONFIRMED))
dlg_send_ka(dlg, DLG_CALLER_LEG);
- if(dka->iflags & DLG_IFLAG_KA_DST)
+ if((dka->iflags & DLG_IFLAG_KA_DST)
+ && (dlg->state==DLG_STATE_CONFIRMED))
dlg_send_ka(dlg, DLG_CALLEE_LEG);
+ if(dlg->state==DLG_STATE_DELETED) {
+ shm_free(dka);
+ dka = NULL;
+ }
dlg_release(dlg);
}
/* append to tail */