[sr-dev] git:3.1: core: make method conditions work on reply routes

Marius Zbihlei marius.zbihlei at 1and1.ro
Mon Aug 6 13:54:55 CEST 2012


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Date:   Thu Oct  6 17:47:38 2011 +0200

core: make method conditions work on reply routes

- reported by Alex Hermann, closes FS#164
(cherry picked from commit 65bac992f75893bd9f80894af9c0759f5492498b)

---

 route.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/route.c b/route.c
index ebb2077..77d3266 100644
--- a/route.c
+++ b/route.c
@@ -1813,8 +1813,19 @@ inline static int eval_elem(struct run_act_ctx* h, struct expr* e,
 	}
 	switch(e->l_type){
 	case METHOD_O:
-		ret=comp_str(e->op, &msg->first_line.u.request.method,
+		if(msg->first_line.type==SIP_REQUEST)
+		{
+			ret=comp_str(e->op, &msg->first_line.u.request.method,
 			 			e->r_type, &e->r, msg, h);
+		} else {
+			if(parse_headers(msg, HDR_CSEQ_F, 0)!=0 || msg->cseq==NULL)
+			{
+				LM_ERR("cannot parse cseq header\n");
+				goto error;
+			}
+			ret=comp_str(e->op, &get_cseq(msg)->method,
+						e->r_type, &e->r, msg, h);
+		}
 		break;
 	case URI_O:
 		if(msg->new_uri.s) {




More information about the sr-dev mailing list