Module: sip-router
Branch: master
Commit: 5a620b105b62e48631e9248906e00b4b2c7b4081
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5a620b105b62e48631e9248906e00b4b2c7b4081

Author: Andrei Pelinescu-Onciul <[email protected]>
Committer: Andrei Pelinescu-Onciul <[email protected]>
Date:   Mon Feb 22 19:41:33 2010 +0100

tmx(k): core & tm onreply route support

- support for core onreply route (like for tm onreply route, but
  with extra t_unref).
- use get_route_type() instead of directly accessing route_type.

---

 modules_k/tmx/t_var.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules_k/tmx/t_var.c b/modules_k/tmx/t_var.c
index 6441763..7f537ff 100644
--- a/modules_k/tmx/t_var.c
+++ b/modules_k/tmx/t_var.c
@@ -404,12 +404,18 @@ int pv_get_tm_reply_code(struct sip_msg *msg, pv_param_t 
*param,
                /* no T */
                code = 0;
        } else {
-               switch (route_type) {
+               switch (get_route_type()) {
                        case REQUEST_ROUTE:
                                /* use the status of the last sent reply */
                                code = t->uas.status;
                                break;
-                       case ONREPLY_ROUTE:
+                       case CORE_ONREPLY_ROUTE:
+                               /*  t_check() above has the side effect of 
setting T and
+                                   REFerencing T => we must unref and unset it 
for the 
+                                   main/core onreply_route. */
+                               _tmx_tmb.t_unref(msg);
+                               /* no break */
+                       case TM_ONREPLY_ROUTE:
                                /* use the status of the current reply */
                                code = msg->first_line.u.reply.statuscode;
                                break;
@@ -424,7 +430,7 @@ int pv_get_tm_reply_code(struct sip_msg *msg, pv_param_t 
*param,
                                }
                                break;
                        default:
-                               LM_ERR("unsupported route_type %d\n", 
route_type);
+                               LM_ERR("unsupported route_type %d\n", 
get_route_type());
                                code = 0;
                }
        }


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to