Module: sip-router
Branch: master
Commit: 65bac992f75893bd9f80894af9c0759f5492498b
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=65bac99…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Oct 6 17:47:38 2011 +0200
core: make method conditions work on reply routes
- reported by Alex Hermann, closes FS#164
---
route.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/route.c b/route.c
index 7a29ded..7990cfd 100644
--- a/route.c
+++ b/route.c
@@ -1868,8 +1868,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) {