... | ... |
@@ -16,13 +16,13 @@ NAME=sip_router |
16 | 16 |
|
17 | 17 |
|
18 | 18 |
CC=gcc |
19 |
-CFLAGS=-O2 -Wcast-align #-Wmissing-prototypes -Wall |
|
19 |
+CFLAGS=-O2 -Wcast-align #-Wmissing-prototypes -Wall |
|
20 | 20 |
LEX=lex |
21 | 21 |
YACC=yacc |
22 | 22 |
YACC_FLAGS=-d -b cfg |
23 | 23 |
# on linux and freebsd keep it empty (e.g. LIBS= ) |
24 | 24 |
# on solaris add -lxnet (e.g. LIBS= -lxnet) |
25 |
-LIBS=-lfl -L/usr/local/lib |
|
25 |
+LIBS=-lfl -L/usr/local/lib |
|
26 | 26 |
ALLDEP=Makefile |
27 | 27 |
|
28 | 28 |
MKDEP=gcc -M |
... | ... |
@@ -12,6 +12,9 @@ |
12 | 12 |
#include "forward.h" |
13 | 13 |
#include "action.h" |
14 | 14 |
|
15 |
+#ifdef DEBUG_DMALLOC |
|
16 |
+#include <dmalloc.h> |
|
17 |
+#endif |
|
15 | 18 |
|
16 | 19 |
int receive_msg(char* buf, unsigned int len, unsigned long src_ip) |
17 | 20 |
{ |
... | ... |
@@ -78,9 +81,11 @@ int receive_msg(char* buf, unsigned int len, unsigned long src_ip) |
78 | 81 |
} |
79 | 82 |
} |
80 | 83 |
skip: |
84 |
+ if (msg.new_uri) free(msg.new_uri); |
|
81 | 85 |
free(msg.orig); |
82 | 86 |
return 0; |
83 | 87 |
error: |
88 |
+ if (msg.new_uri) free(msg.new_uri); |
|
84 | 89 |
free(msg.orig); |
85 | 90 |
error1: |
86 | 91 |
return -1; |
... | ... |
@@ -19,6 +19,10 @@ |
19 | 19 |
#include "dprint.h" |
20 | 20 |
#include "proxy.h" |
21 | 21 |
|
22 |
+#ifdef DEBUG_DMALLOC |
|
23 |
+#include <dmalloc.h> |
|
24 |
+#endif |
|
25 |
+ |
|
22 | 26 |
/* main routing list */ |
23 | 27 |
struct route_elem* rlist[RT_NO]; |
24 | 28 |
|
... | ... |
@@ -284,8 +288,13 @@ static int eval_elem(struct expr* e, struct sip_msg* msg) |
284 | 288 |
e->op, e->subtype); |
285 | 289 |
break; |
286 | 290 |
case URI_O: |
287 |
- ret=comp_str(msg->first_line.u.request.uri, e->r.param, |
|
288 |
- e->op, e->subtype); |
|
291 |
+ if(msg->new_uri){ |
|
292 |
+ ret=comp_str(msg->new_uri, e->r.param, |
|
293 |
+ e->op, e->subtype); |
|
294 |
+ }else{ |
|
295 |
+ ret=comp_str(msg->first_line.u.request.uri, e->r.param, |
|
296 |
+ e->op, e->subtype); |
|
297 |
+ } |
|
289 | 298 |
break; |
290 | 299 |
case SRCIP_O: |
291 | 300 |
ret=comp_ip(msg->src_ip, e->r.param, e->op, e->subtype); |