Module: kamailio
Branch: master
Commit: f9aa4a219bc0e5a44b167772d6e3b86d99a59932
URL: https://github.com/kamailio/kamailio/commit/f9aa4a219bc0e5a44b167772d6e3b86…
Author: jaybeepee <jason.penton(a)gmail.com>
Committer: jaybeepee <jason.penton(a)gmail.com>
Date: 2015-09-11T12:01:10+02:00
modules/cdp: changed load balancing timer from second resolution to millisecond resolution
---
Modified: modules/cdp/session.h
---
Diff: https://github.com/kamailio/kamailio/commit/f9aa4a219bc0e5a44b167772d6e3b86…
Patch: https://github.com/kamailio/kamailio/commit/f9aa4a219bc0e5a44b167772d6e3b86…
---
diff --git a/modules/cdp/session.h b/modules/cdp/session.h
index 11adc86..8758081 100644
--- a/modules/cdp/session.h
+++ b/modules/cdp/session.h
@@ -124,6 +124,10 @@ typedef struct _cdp_auth_session_t {
time_t timeout; /**< absolute time for session timeout -1 means forever */
time_t lifetime; /**< absolute time for auth lifetime -1 means forever */
time_t grace_period; /**< grace_period in seconds */
+ unsigned int last_requested_lifetime; /**< the following 3 timers are used to store what we are */
+ unsigned int last_requested_timeout; /**<requesitng in a request, if the answer does not have anything */
+ unsigned int last_requested_grace; /**<different then we will use these values */
+
void* generic_data;
} cdp_auth_session_t;
Module: kamailio
Branch: master
Commit: 956be0edcd816134650c5efccb7965fccb4d5916
URL: https://github.com/kamailio/kamailio/commit/956be0edcd816134650c5efccb7965f…
Author: jaybeepee <jason.penton(a)gmail.com>
Committer: jaybeepee <jason.penton(a)gmail.com>
Date: 2015-09-11T11:44:31+02:00
modules/cdp: fixed race condition between CCR update and CCR terminate - lean priority towards T
---
Modified: modules/cdp/acctstatemachine.c
---
Diff: https://github.com/kamailio/kamailio/commit/956be0edcd816134650c5efccb7965f…
Patch: https://github.com/kamailio/kamailio/commit/956be0edcd816134650c5efccb7965f…
---
diff --git a/modules/cdp/acctstatemachine.c b/modules/cdp/acctstatemachine.c
index d4e524d..31304d2 100644
--- a/modules/cdp/acctstatemachine.c
+++ b/modules/cdp/acctstatemachine.c
@@ -210,29 +210,41 @@ inline int cc_acc_client_stateful_sm_process(cdp_session_t* s, int event, AAAMes
}
break;
case ACC_CC_ST_PENDING_U:
- if (event == ACC_CC_EV_RECV_ANS && msg && !is_req(msg)) {
- rc = get_result_code(msg);
- if (rc >= 2000 && rc < 3000) {
- event = ACC_CC_EV_RECV_ANS_SUCCESS;
- } else {
- event = ACC_CC_EV_RECV_ANS_UNSUCCESS;
- }
- }
- switch (event) {
- case ACC_CC_EV_RECV_ANS_SUCCESS:
- x->state = ACC_CC_ST_OPEN;
- LM_DBG("success CCA for UPDATE\n");
- update_gsu_response_timers(x, msg);
- break;
- case ACC_CC_EV_RECV_ANS_UNSUCCESS:
- //TODO: check whether we grant or terminate service to callback clients
- x->state = ACC_CC_ST_DISCON;
- LM_ERR("update failed... going back to IDLE/DISCON\n");
- break;
- default:
- LM_ERR("Received unknown event [%d] in state [%d]\n", event, x->state);
- break;
- }
+
+ /**Richard added Aug 5 - there is a potential race condition where you may send a CCR-U immediately followed by CCR-T
+ * and then receive a CCA-T while in state ACC_CC_ST_PENDING_U (e.g. if update timer and dialog termination at same time)
+ * In this event you would incorrectly ignore the CCR-T
+ * Solution is to change state to change state to ACC_CC_ST_PENDING_T if CCR-T is sent while in this state */
+ if (event == ACC_CC_EV_SEND_REQ && msg && get_accounting_record_type(msg) == 4 /*TERMINATE RECORD*/) {
+ LM_ERR("Received CCR-T while in state ACC_CC_ST_PENDING_U, just going to change to ACC_CC_ST_PENDING_T\n");
+ s->u.cc_acc.state = ACC_CC_ST_PENDING_T;
+ //update our reservation and its timers...
+ update_gsu_request_timers(x, msg);
+ } else {
+ if (event == ACC_CC_EV_RECV_ANS && msg && !is_req(msg)) {
+ rc = get_result_code(msg);
+ if (rc >= 2000 && rc < 3000) {
+ event = ACC_CC_EV_RECV_ANS_SUCCESS;
+ } else {
+ event = ACC_CC_EV_RECV_ANS_UNSUCCESS;
+ }
+ }
+ switch (event) {
+ case ACC_CC_EV_RECV_ANS_SUCCESS:
+ x->state = ACC_CC_ST_OPEN;
+ LM_DBG("success CCA for UPDATE\n");
+ update_gsu_response_timers(x, msg);
+ break;
+ case ACC_CC_EV_RECV_ANS_UNSUCCESS:
+ //TODO: check whether we grant or terminate service to callback clients
+ x->state = ACC_CC_ST_DISCON;
+ LM_ERR("update failed... going back to IDLE/DISCON\n");
+ break;
+ default:
+ LM_ERR("Received unknown event [%d] in state [%d]\n", event, x->state);
+ break;
+ }
+ }
break;
case ACC_CC_ST_DISCON:
switch (event) {
Hello,
Kamailio SIP Server v4.3.2 stable release is out.
This is a maintenance release of the latest stable branch, 4.3, that
includes fixes since release of v4.3.1. There is no change to database
schema or configuration language structure that you have to do on
previous installations of v4.3.x. Deployments running previous v4.x.x
versions are strongly recommended to be upgraded to v4.3.2.
For more details about version 4.3.2 (including links and guidelines to
download the tarball or from GIT repository), visit:
* http://www.kamailio.org/w/2015/09/kamailio-v4-3-2-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda