Module: kamailio
Branch: master
Commit: 35c4a245b7408d595d671d4661f91900078d02db
URL: https://github.com/kamailio/kamailio/commit/35c4a245b7408d595d671d4661f9190…
Author: jaybeepee <jason.penton(a)gmail.com>
Committer: jaybeepee <jason.penton(a)gmail.com>
Date: 2016-01-20T09:57:44+02:00
modules/cdp: prevent possible deadlock when searching for sticky peers
---
Modified: modules/cdp/routing.c
---
Diff: https://github.com/kamailio/kamailio/commit/35c4a245b7408d595d671d4661f9190…
Patch: https://github.com/kamailio/kamailio/commit/35c4a245b7408d595d671d4661f9190…
---
diff --git a/modules/cdp/routing.c b/modules/cdp/routing.c
index 5bd494d..51f4190 100644
--- a/modules/cdp/routing.c
+++ b/modules/cdp/routing.c
@@ -89,7 +89,9 @@ peer* get_first_connected_route(cdp_session_t* cdp_session, routing_entry *r, in
/*try and find an already used peer for this session - sticky*/
if ((cdp_session->sticky_peer_fqdn.len > 0) && cdp_session->sticky_peer_fqdn.s) {
//we have an old sticky peer. let's make sure it's up and connected before we use it.
+ AAASessionsUnlock(cdp_session->hash); /*V1.1 - Don't attempt to hold two locks at same time */
p = get_peer_by_fqdn(&cdp_session->sticky_peer_fqdn);
+ AAASessionsLock(cdp_session->hash); /*V1.1 - As we were...no call seems to pass cdp_session unlocked */
if (p && !p->disabled && (p->state == I_Open || p->state == R_Open) && peer_handles_application(p, app_id, vendor_id)) {
p->last_selected = time(NULL);
LM_DBG("Found a sticky peer [%.*s] for this session - re-using\n", p->fqdn.len, p->fqdn.s);
We have 2M lines in carrierroute, so we often need to get back the ID of the line from the DB from carrierroute.
This commit creates a new modparam "id_in_avp" for the module carrierroute which may be 0 - 2
0 - no ID, only the description is saved in the avp
1 - ID and descrptiotion is saved in the AVP
2 - Only ID is saved in the AVP.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/221
-- Commit Summary --
* Added modparam id_in_avp for carrierroute so the ID may be returned to the AVP variable for easier debugging
-- File Changes --
M modules/carrierroute/carrierroute.c (7)
M modules/carrierroute/cr_db.c (61)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/221.patchhttps://github.com/kamailio/kamailio/pull/221.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/221