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);
This PR contains my backlog of changes for uac registrations.
Most patches are for making the registrations list fully dynamic (add/remove via RPC)
Some fixes, some cleanups, some features...
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/729
-- Commit Summary --
* uac: uac_reg: fix uac_reg_get_byuser()
* uac: uac_reg: protect the registration lists with locks
* uac: uac_reg: add uac_reg_status() function
* uac: uac_reg: Add function to remove registration
* uac: uac_reg: Use locking to prevent deletion of a registration entry when it is still being referenced
* uac: uac_reg: Add RPC function to remove a registration
* uac: uac_reg: Add RPC function to add a new registration
* uac: uac_reg: Consolidate and sync (almost) duplicate code in adding an RPC node
* uac: uac_reg: Return HTTP-like fault codes for RPC
* uac: uac_reg: Consolidate and optimize filtering records
* uac: uac_reg: Optimize updating a registration
* uac: uac_reg: Update of all fields when record is refreshed from DB
* uac: uac_reg: Only set UAC_REG_INIT flag if it was not set yet
* parser: Add parser for Min-Expires
* uac: uac_reg: Handle 423 response to outbound register
* uac: uac_reg: Use core parser instead of hand-parsing the Expires header
* uac: uac_reg: Keep Call-ID in registration sequence
* uac: uac_reg: Add setting for using a random reg_delay
* uac: uac_reg: Deduplicate code for copying a record from DB to mem
-- File Changes --
M modules/uac/doc/uac_admin.xml (89)
M modules/uac/uac.c (26)
M modules/uac/uac_reg.c (722)
M modules/uac/uac_reg.h (3)
M parser/case_min.h (47)
M parser/hf.c (4)
M parser/hf.h (3)
M parser/msg_parser.c (5)
M parser/msg_parser.h (1)
M sip_msg_clone.c (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/729.patchhttps://github.com/kamailio/kamailio/pull/729.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/729