opensips/opensips.patch

changeset 382
b972dc20871f
parent 377
67e813202d53
child 397
c98ae03f4266
equal deleted inserted replaced
1:214e516c8b45 2:ac32e78225fe
1 Index: main.c 1 Index: main.c
2 diff -Nau main.c.orig main.c 2 diff -Nau main.c.orig main.c
3 --- main.c.orig 2009-12-10 14:11:03.590141302 +0100 3 --- main.c.orig 2009-12-10 14:11:03.590141302 +0100
4 +++ main.c 2009-12-10 14:11:07.246237908 +0100 4 +++ main.c 2009-12-10 14:11:07.246237908 +0100
5 @@ -1038,6 +1038,10 @@ 5 @@ -952,6 +952,10 @@
6 ret=-1; 6 ret=-1;
7 my_argc=argc; my_argv=argv; 7 my_argc=argc; my_argv=argv;
8 8
9 + /* if (!log_stderr), that's not usable yet! '/ 9 + /* if (!log_stderr), that's not usable yet! '/
10 + /* ...so unconditionally log to syslog for now */ 10 + /* ...so unconditionally log to syslog for now */
11 + openlog(argv[0], LOG_PID|LOG_CONS, log_facility); 11 + openlog(argv[0], LOG_PID|LOG_CONS, log_facility);
12 + 12 +
13 /*init pkg mallocs (before parsing cfg or cmd line !)*/ 13 /*init pkg mallocs (before parsing cfg or cmd line !)*/
14 if (init_pkg_mallocs()==-1) 14 if (init_pkg_mallocs()==-1)
15 goto error00; 15 goto error00;
16 @@ -1370,6 +1374,11 @@ 16 @@ -1284,6 +1288,11 @@
17 17
18 /* init_daemon? */ 18 /* init_daemon? */
19 if (!dont_fork){ 19 if (!dont_fork){
20 + /* shortly after main() we called openlog(3) to log */ 20 + /* shortly after main() we called openlog(3) to log */
21 + /* the initialization, but since daemonize() has its */ 21 + /* the initialization, but since daemonize() has its */
27 } 27 }
28 Index: Makefile.defs 28 Index: Makefile.defs
29 diff -Nau Makefile.defs.orig Makefile.defs 29 diff -Nau Makefile.defs.orig Makefile.defs
30 --- Makefile.defs.orig 2007-12-13 14:39:06.000000000 +0100 30 --- Makefile.defs.orig 2007-12-13 14:39:06.000000000 +0100
31 +++ Makefile.defs 2008-01-14 16:48:02.811615000 +0100 31 +++ Makefile.defs 2008-01-14 16:48:02.811615000 +0100
32 @@ -220,7 +220,7 @@ 32 @@ -216,7 +216,7 @@
33 else 33 else
34 doc-dir = doc/$(MAIN_NAME)/ 34 doc-dir = doc/$(MAIN_NAME)/
35 man-dir = man/ 35 man-dir = man/
36 - data-dir = $(MAIN_NAME)/ 36 - data-dir = $(MAIN_NAME)/
37 + data-dir = share/$(MAIN_NAME)/ 37 + data-dir = share/$(MAIN_NAME)/
38 LOCALBASE ?= $(SYSBASE)/local 38 LOCALBASE ?= $(SYSBASE)/local
39 endif 39 endif
40 endif 40 endif
41 @@ -1432,6 +1432,10 @@ 41 @@ -1427,6 +1427,10 @@
42 LIBS+= -lsctp 42 LIBS+= -lsctp
43 endif 43 endif
44 44
45 +#conditionally add libfsl 45 +#conditionally add libfsl
46 +LDFLAGS += -L$(prefix)/lib 46 +LDFLAGS += -L$(prefix)/lib
72 use POSIX; 72 use POSIX;
73 -use Frontier::RPC2; 73 -use Frontier::RPC2;
74 use IO::Socket; 74 use IO::Socket;
75 use Socket; 75 use Socket;
76 #use Net::IP; 76 #use Net::IP;
77 @@ -378,6 +377,12 @@ 77 @@ -396,6 +395,12 @@
78 } 78 }
79 } 79 }
80 80
81 + if ( $MD5 eq "" ) { 81 + if ( $MD5 eq "" ) {
82 + if ( $arr[0] =~ /^\s*MD5/ ) { 82 + if ( $arr[0] =~ /^\s*MD5/ ) {
117 117
118 Index: modules/nathelper/nathelper.c 118 Index: modules/nathelper/nathelper.c
119 diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c 119 diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c
120 --- modules/nathelper/nathelper.c.orig 2010-12-20 14:33:50.000000000 +0100 120 --- modules/nathelper/nathelper.c.orig 2010-12-20 14:33:50.000000000 +0100
121 +++ modules/nathelper/nathelper.c 2011-01-26 17:48:40.685941382 +0100 121 +++ modules/nathelper/nathelper.c 2011-01-26 17:48:40.685941382 +0100
122 @@ -288,6 +288,9 @@ 122 @@ -273,6 +273,9 @@
123 return 0; 123 #define MI_RECHECK_TICKS "recheck_ticks"
124 } 124 #define MI_RECHECK_T_LEN (sizeof(MI_RECHECK_TICKS)-1)
125 125
126 +/* MSvB macros */ 126 +/* MSvB macros */
127 +#define OPENSIPS_NOOP ((void)0) 127 +#define OPENSIPS_NOOP ((void)0)
128 + 128 +
129 129
130 130
131 131 /* Supported version of the RTP proxy command protocol */
132 @@ -805,6 +808,7 @@ 132 @@ -1921,6 +1925,7 @@
133 #define FIX_MEDIP 0x02 133 #define FIX_MEDIP 0x02
134 #define ADD_ANORTPPROXY 0x04 134 #define ADD_ANORTPPROXY 0x04
135 #define FIX_ORGIP 0x08 135 #define FIX_ORGIP 0x08
136 +#define FIX_RTCPIP 0x10 136 +#define FIX_RTCPIP 0x10
137 137
138 #define ADIRECTION "a=direction:active" 138 #define ADIRECTION "a=direction:active"
139 #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1) 139 #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1)
140 @@ -821,7 +825,9 @@ 140 @@ -2050,6 +2055,12 @@
141 return -1;
142 }
143
144 + if (level & FIX_RTCPIP) {
145 + /* Iterate all a=rtcp: and replace ips in them. */
146 + if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1)
147 + return -1;
148 + }
149 +
150 return 1;
151 }
152
153 @@ -2215,7 +2226,9 @@
141 { 154 {
142 char *buf; 155 char *buf;
143 int offset; 156 int offset;
144 + int binlump; 157 + int binlump;
145 struct lump* anchor; 158 struct lump* anchor;
146 + struct lump* templump; 159 + struct lump* templump;
147 str omip, nip, oip; 160 str omip, nip, oip;
148 161
149 /* check that updating mediaip is really necessary */ 162 /* check that updating mediaip is really necessary */
150 @@ -852,7 +858,19 @@ 163 @@ -2246,7 +2259,19 @@
151 memcpy(buf, CRLF, CRLF_LEN); 164 memcpy(buf, CRLF, CRLF_LEN);
152 memcpy(buf + CRLF_LEN, omip.s, omip.len); 165 memcpy(buf + CRLF_LEN, omip.s, omip.len);
153 memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len); 166 memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len);
154 - if (insert_new_lump_after(anchor, buf, 167 - if (insert_new_lump_after(anchor, buf,
155 + 168 +
156 + /* if the oldmediaip string is already */ 169 + /* if the oldmediaip string is already */
157 + /* in the body then don't add it again */ 170 + /* in the body then don't add it again */
158 + binlump = 0; 171 + binlump = 0;
159 + for (templump = msg->body_lumps; templump; templump = templump->next) 172 + for (templump = msg->body_lumps; templump; templump = templump->next)
160 + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) 173 + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf))
161 + binlump = 1; 174 + binlump = 1;
162 + for (templump = msg->add_rm; templump; templump = templump->next) 175 + for (templump = msg->add_rm; templump; templump = templump->next)
166 + pkg_free(buf); 179 + pkg_free(buf);
167 + else if (insert_new_lump_after(anchor, buf, 180 + else if (insert_new_lump_after(anchor, buf,
168 omip.len + oldip->len + CRLF_LEN, 0) == NULL) { 181 omip.len + oldip->len + CRLF_LEN, 0) == NULL) {
169 LM_ERR("insert_new_lump_after failed\n"); 182 LM_ERR("insert_new_lump_after failed\n");
170 pkg_free(buf); 183 pkg_free(buf);
171 @@ -1038,6 +1056,12 @@
172 p= p->next;
173 }
174
175 + if (level & FIX_RTCPIP) {
176 + /* Iterate all a=rtcp: and replace ips in them. */
177 + if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1)
178 + return -1;
179 + }
180 +
181 return 1;
182 }
183
184 Index: parser/sdp/sdp_helpr_funcs.c 184 Index: parser/sdp/sdp_helpr_funcs.c
185 diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c 185 diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c
186 --- parser/sdp/sdp_helpr_funcs.c.orig 2010-12-08 15:14:06.000000000 +0100 186 --- parser/sdp/sdp_helpr_funcs.c.orig 2010-12-08 15:14:06.000000000 +0100
187 +++ parser/sdp/sdp_helpr_funcs.c 2011-01-27 00:39:50.128212053 +0100 187 +++ parser/sdp/sdp_helpr_funcs.c 2011-01-27 00:39:50.128212053 +0100
188 @@ -392,7 +392,7 @@ 188 @@ -392,7 +392,7 @@

mercurial