Module: kamailio
Branch: master
Commit: b7c588dff06030a82f305b210573be5bbc961cec
URL: https://github.com/kamailio/kamailio/commit/b7c588dff06030a82f305b210573be5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-07T15:56:45+02:00
tm: store last received response code before running onreply_route
- otherwise an innapropriate cancel can happen if the current branch got
before an 1xx response, and the script writer enforces another reply
code with t_reply()
- reported by Thomas Sevestre, GH#315
---
Modified: modules/tm/t_reply.c
---
Diff: https://github.com/kamailio/kamailio/commit/b7c588dff06030a82f305b210573be5…
Patch: https://github.com/kamailio/kamailio/commit/b7c588dff06030a82f305b210573be5…
---
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index b2e6e53..8da3205 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -2286,10 +2286,21 @@ int reply_received( struct sip_msg *p_msg )
backup_xavps = xavp_set_list(&t->xavps_list);
#endif
setbflagsval(0, uac->branch_flags);
+ if(msg_status>last_uac_status) {
+ /* current response (msg) status is higher that the last received
+ * on the same branch - set it temporarily so functions in onreply_route
+ * can access it (e.g., avoid sending CANCEL by forcing another t_relply()
+ * in onreply_route when a negative sip response was received) */
+ uac->last_received = msg_status;
+ }
+
/* Pre- and post-script callbacks have already
* been executed by the core. (Miklos)
*/
run_top_route(onreply_rt.rlist[onreply_route], p_msg, &ctx);
+
+ /* restore brach last_received as before executing onreply_route */
+ uac->last_received = last_uac_status;
/* transfer current message context back to t */
if (t->uas.request) t->uas.request->flags=p_msg->flags;
getbflagsval(0, &uac->branch_flags);
Module: kamailio
Branch: master
Commit: 3438dbe5e5149d23c40ba17e1c47f6b9708ac352
URL: https://github.com/kamailio/kamailio/commit/3438dbe5e5149d23c40ba17e1c47f6b…
Author: Federico Favaro <federico(a)aereo.lan.athonet.com>
Committer: Federico Favaro <federico(a)aereo.lan.athonet.com>
Date: 2016-08-01T14:50:39+02:00
ims_usrloc_scscf: Double check contact refs on DB
If the contact is on state CONTACT_DELAYED_DELETE
and still has refs > 0 in memory, it could be
that it failed to acquire a lock to de-ref the
contact. This brings to a leak on the contact DB
because the contact will always have refs > 0 and
no actual refs on DB. Now, as a fallback, we
actually checks on DB the real number of refs of
the contact. If this refs is 0, force the
number of refs in the record to 0 and mark the
contact for deletion.
---
Modified: modules/ims_usrloc_scscf/udomain.c
Modified: modules/ims_usrloc_scscf/usrloc_db.c
Modified: modules/ims_usrloc_scscf/usrloc_db.h
---
Diff: https://github.com/kamailio/kamailio/commit/3438dbe5e5149d23c40ba17e1c47f6b…
Patch: https://github.com/kamailio/kamailio/commit/3438dbe5e5149d23c40ba17e1c47f6b…
Some improvements on the handling of contacts on S-CSCF database, namely
* Clean the contact table at startup if impu_contact table is empty
* if the contact is in state DELAYED_DELETE but still has ref_count > 0 in memory, it could mean that it has not been decremented before due to a failure to get a lock. This way we are leaking a contact on the DB and in memory. When the contact is expired and in DELAYED_DELETE, we do a query to check if it is really still referenced on impu_contact table. If not, we mark contact for deletion.
* Add an helper function to print the actual state of a contact instead of the index of the enum
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/730
-- Commit Summary --
* ims_usrloc_scscf: Remove all unlinked contacts
* ims_usrloc_scscf: Double check contact refs on DB
* ims_usrloc_scscf: Print contact state as string
-- File Changes --
M modules/ims_usrloc_scscf/udomain.c (26)
M modules/ims_usrloc_scscf/usrloc.h (17)
M modules/ims_usrloc_scscf/usrloc_db.c (72)
M modules/ims_usrloc_scscf/usrloc_db.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/730.patchhttps://github.com/kamailio/kamailio/pull/730.diff
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/730