Browse code

script callbacks: corrections

- callbacks have been tested, bugs found have
been corrected.

Miklos Tirpak authored on 01/06/2009 15:33:38
Showing 1 changed files
... ...
@@ -160,8 +160,8 @@ int exec_pre_script_cb( struct sip_msg *msg, enum script_cb_type type)
160 160
 		abort();
161 161
 	}
162 162
 #endif
163
-	flags = PRE_SCRIPT_CB & (1<<(type-1));
164
-	for (cb=pre_script_cb[type]; cb ; cb=cb->next ) {
163
+	flags = PRE_SCRIPT_CB | (1<<(type-1));
164
+	for (cb=pre_script_cb[type-1]; cb ; cb=cb->next ) {
165 165
 		/* stop on error */
166 166
 		if (cb->cbf(msg, flags, cb->param)==0)
167 167
 			return 0;
... ...
@@ -183,8 +183,8 @@ int exec_post_script_cb( struct sip_msg *msg, enum script_cb_type type)
183 183
 		abort();
184 184
 	}
185 185
 #endif
186
-	flags = POST_SCRIPT_CB & (1<<(type-1));
187
-	for (cb=post_script_cb[type]; cb ; cb=cb->next){
186
+	flags = POST_SCRIPT_CB | (1<<(type-1));
187
+	for (cb=post_script_cb[type-1]; cb ; cb=cb->next){
188 188
 		cb->cbf(msg, flags, cb->param);
189 189
 	}
190 190
 	return 1;