Browse code

script callback: modules updated to the new API

Miklos Tirpak authored on 01/06/2009 12:38:45
Showing 29 changed files
... ...
@@ -635,13 +635,13 @@ static int fixup_t_check_status(void** param, int param_no)
635 635
 
636 636
 
637 637
 /***************************** init functions *****************************/
638
-static int w_t_unref( struct sip_msg *foo, void *bar)
638
+static int w_t_unref( struct sip_msg *foo, unsigned int flags, void *bar)
639 639
 {
640 640
 	return t_unref(foo);
641 641
 }
642 642
 
643 643
 
644
-static int script_init( struct sip_msg *foo, void *bar)
644
+static int script_init( struct sip_msg *foo, unsigned int flags, void *bar)
645 645
 {
646 646
 	/* we primarily reset all private memory here to make sure
647 647
 	 * private values left over from previous message will
... ...
@@ -756,12 +756,12 @@ static int mod_init(void)
756 756
 	}
757 757
 
758 758
 	/* register post-script clean-up function */
759
-	if (register_script_cb( w_t_unref, POST_SCRIPT_CB|REQ_TYPE_CB, 0)<0 ) {
759
+	if (register_script_cb( w_t_unref, POST_SCRIPT_CB|REQUEST_CB, 0)<0 ) {
760 760
 		LOG(L_ERR,"ERROR:tm:mod_init: failed to register POST request "
761 761
 			"callback\n");
762 762
 		return -1;
763 763
 	}
764
-	if (register_script_cb( script_init, PRE_SCRIPT_CB|REQ_TYPE_CB , 0)<0 ) {
764
+	if (register_script_cb( script_init, PRE_SCRIPT_CB|REQUEST_CB , 0)<0 ) {
765 765
 		LOG(L_ERR,"ERROR:tm:mod_init: failed to register PRE request "
766 766
 			"callback\n");
767 767
 		return -1;
... ...
@@ -136,7 +136,7 @@ static int init_shmlock(void)
136 136
 }
137 137
 
138 138
 
139
-static int pre_script_filter(struct sip_msg *msg, void *unused)
139
+static int pre_script_filter(struct sip_msg *msg, unsigned int flags, void *unused)
140 140
 {
141 141
 	/* use id 0 for pre script callback */
142 142
 	utils_forward(msg, 0, PROTO_UDP);
... ...
@@ -198,11 +198,11 @@ static int mod_init(void)
198 198
 
199 199
 	if (forward_active == 1) {
200 200
 		/* register callback for id 0 */
201
-		if (register_script_cb(pre_script_filter, PRE_SCRIPT_CB|REQ_TYPE_CB, 0) < 0) {
201
+		if (register_script_cb(pre_script_filter, PRE_SCRIPT_CB|ONREPLY_CB, 0) < 0) {
202 202
 			LM_CRIT("cannot register script callback for requests.\n");
203 203
 			return -1;
204 204
 		}
205
-		if (register_script_cb(pre_script_filter, PRE_SCRIPT_CB|RPL_TYPE_CB, 0) < 0) {
205
+		if (register_script_cb(pre_script_filter, PRE_SCRIPT_CB|ONREPLY_CB, 0) < 0) {
206 206
 			LM_CRIT("cannot register script callback for replies.\n");
207 207
 			return -1;
208 208
 		}
... ...
@@ -488,18 +488,18 @@ static int mod_init(void)
488 488
 		return -1;
489 489
 	}
490 490
 
491
-	if (register_script_cb( profile_cleanup, POST_SCRIPT_CB|REQ_TYPE_CB,0)<0) {
491
+	if (register_script_cb( profile_cleanup, POST_SCRIPT_CB|REQUEST_CB,0)<0) {
492 492
 		LM_ERR("cannot regsiter script callback");
493 493
 		return -1;
494 494
 	}
495 495
 	if (register_script_cb(dlg_cfg_cb,
496
-				PRE_SCRIPT_CB|REQ_TYPE_CB,0)<0)
496
+				PRE_SCRIPT_CB|REQUEST_CB,0)<0)
497 497
 	{
498 498
 		LM_ERR("cannot regsiter pre-script ctx callback\n");
499 499
 		return -1;
500 500
 	}
501 501
 	if (register_script_cb(dlg_cfg_cb,
502
-				POST_SCRIPT_CB|REQ_TYPE_CB,0)<0)
502
+				POST_SCRIPT_CB|REQUEST_CB,0)<0)
503 503
 	{
504 504
 		LM_ERR("cannot regsiter post-script ctx callback\n");
505 505
 		return -1;
... ...
@@ -627,7 +627,7 @@ int dlg_new_dialog(struct sip_msg *msg, struct cell *t)
627 627
 	return 0;
628 628
 error:
629 629
 	unref_dlg(dlg,1);
630
-	profile_cleanup(msg, NULL);
630
+	profile_cleanup(msg, 0, NULL);
631 631
 	update_stat(failed_dlgs, 1);
632 632
 	return -1;
633 633
 }
... ...
@@ -969,12 +969,12 @@ void dlg_ontimeout( struct dlg_tl *tl)
969 969
 	{
970 970
 		dlg_set_ctx_dialog(dlg);
971 971
 		fmsg = faked_msg_next();
972
-		if (exec_pre_req_cb(fmsg)>0)
972
+		if (exec_pre_script_cb(fmsg, REQUEST_CB_TYPE)>0)
973 973
 		{
974 974
 			LM_DBG("executing route %d on timeout\n", dlg->toroute);
975 975
 			set_route_type(REQUEST_ROUTE);
976 976
 			run_top_route(main_rt.rlist[dlg->toroute], fmsg);
977
-			exec_post_req_cb(fmsg);
977
+			exec_post_script_cb(fmsg, REQUEST_CB_TYPE);
978 978
 		}
979 979
 	}
980 980
 
... ...
@@ -296,10 +296,11 @@ void destroy_linkers(struct dlg_profile_link *linker)
296 296
 /*!
297 297
  * \brief Cleanup a profile
298 298
  * \param msg SIP message
299
+ * \param flags unused
299 300
  * \param unused
300 301
  * \return 1
301 302
  */
302
-int profile_cleanup( struct sip_msg *msg, void *param )
303
+int profile_cleanup( struct sip_msg *msg, unsigned int flags, void *param )
303 304
 {
304 305
 	current_dlg_msg_id = 0;
305 306
 	if (current_dlg_pointer) {
... ...
@@ -107,10 +107,11 @@ struct dlg_profile_table* search_dlg_profile(str *name);
107 107
 /*!
108 108
  * \brief Cleanup a profile
109 109
  * \param msg SIP message
110
+ * \param flags unused
110 111
  * \param unused
111 112
  * \return 1
112 113
  */
113
-int profile_cleanup( struct sip_msg *msg, void *param );
114
+int profile_cleanup( struct sip_msg *msg, unsigned int flags, void *param );
114 115
 
115 116
 
116 117
 /*!
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 dlg_ctx_t _dlg_ctx;
28 28
 
29
-int dlg_cfg_cb(struct sip_msg *foo, void *bar)
29
+int dlg_cfg_cb(struct sip_msg *foo, unsigned int flags, void *bar)
30 30
 {
31 31
 	memset(&_dlg_ctx, 0, sizeof(dlg_ctx_t));
32 32
 
... ...
@@ -50,7 +50,7 @@ int pv_get_dlg(struct sip_msg *msg,  pv_param_t *param,
50 50
 		pv_value_t *res);
51 51
 int pv_parse_dlg_name(pv_spec_p sp, str *in);
52 52
 
53
-int dlg_cfg_cb(struct sip_msg *foo, void *bar);
53
+int dlg_cfg_cb(struct sip_msg *foo, unsigned int flags, void *bar);
54 54
 
55 55
 void dlg_set_ctx_dialog(struct dlg_cell *dlg);
56 56
 struct dlg_cell* dlg_get_ctx_dialog(void);
... ...
@@ -183,7 +183,7 @@ static INLINE char* shm_strdup(char *source);
183 183
 
184 184
 static int  mod_init(void);
185 185
 static void mod_destroy(void);
186
-static int  preprocess_request(struct sip_msg *msg, void *param);
186
+static int  preprocess_request(struct sip_msg *msg, unsigned int flags, void *param);
187 187
 static int  reply_filter(struct sip_msg *reply);
188 188
 
189 189
 static int pv_parse_nat_contact_name(pv_spec_p sp, str *in);
... ...
@@ -1745,7 +1745,7 @@ mod_init(void)
1745 1745
         }
1746 1746
 
1747 1747
         // register a pre-script callback to automatically enable dialog tracing
1748
-        if (register_script_cb(preprocess_request, PRE_SCRIPT_CB|REQ_TYPE_CB, 0)!=0) {
1748
+        if (register_script_cb(preprocess_request, PRE_SCRIPT_CB|REQUEST_CB, 0)!=0) {
1749 1749
             LM_ERR("could not register request preprocessing callback\n");
1750 1750
             return -1;
1751 1751
         }
... ...
@@ -1815,7 +1815,7 @@ mod_destroy(void)
1815 1815
 // during the dialog and it is not renewed.
1816 1816
 //
1817 1817
 static int
1818
-preprocess_request(struct sip_msg *msg, void *_param)
1818
+preprocess_request(struct sip_msg *msg, unsigned int flags, void *_param)
1819 1819
 {
1820 1820
     str totag;
1821 1821
 
... ...
@@ -182,7 +182,7 @@ static int mod_init(void)
182 182
 	pua_send_subscribe= pua.send_subscribe;
183 183
 	
184 184
 	/* register post-script pua_unset_publish unset function */
185
-	if(register_script_cb(pua_unset_publish, POST_SCRIPT_CB|REQ_TYPE_CB, 0)<0)
185
+	if(register_script_cb(pua_unset_publish, POST_SCRIPT_CB|REQUEST_CB, 0)<0)
186 186
 	{
187 187
 		LM_ERR("failed to register POST request callback\n");
188 188
 		return -1;
... ...
@@ -29,7 +29,7 @@
29 29
 extern send_publish_t pua_send_publish;
30 30
 extern send_subscribe_t pua_send_subscribe;
31 31
 void ul_publish(ucontact_t* c, int type, void* param);
32
-int pua_unset_publish(struct sip_msg* msg , void* param);
32
+int pua_unset_publish(struct sip_msg* msg, unsigned int flags, void* param);
33 33
 
34 34
 extern str pres_prefix;
35 35
 #endif
... ...
@@ -45,7 +45,7 @@ int pua_set_publish(struct sip_msg* msg , char* s1, char* s2)
45 45
 	return 1;
46 46
 }
47 47
 
48
-int pua_unset_publish(struct sip_msg* msg , void* param)
48
+int pua_unset_publish(struct sip_msg* msg, unsigned int flags, void* param)
49 49
 {
50 50
 	pua_ul_publish= 0;
51 51
 	return 1;
... ...
@@ -188,11 +188,11 @@ void stm_timer_exec(unsigned int ticks, void *param)
188 188
 		/* update local parameters */
189 189
 		_stm_msg.id=_stm_msg_no++;
190 190
 		clear_branches();
191
-		if (exec_pre_req_cb(&_stm_msg)==0 )
191
+		if (exec_pre_script_cb(&_stm_msg, REQUEST_CB_TYPE)==0 )
192 192
 			continue; /* drop the request */
193 193
 		set_route_type(REQUEST_ROUTE);
194 194
 		run_top_route(main_rt.rlist[rt->route], &_stm_msg);
195
-		exec_post_req_cb(&_stm_msg);
195
+		exec_post_script_cb(&_stm_msg, REQUEST_CB_TYPE);
196 196
 	}
197 197
 }
198 198
 
... ...
@@ -318,10 +318,11 @@ static int conv183(struct sip_msg *msg)
318 318
 /*!
319 319
  * \brief Callback function that does the work inside the server.
320 320
  * \param msg SIP message
321
+ * \param flags unused
321 322
  * \param bar unused
322 323
  * \return 1 on success, -1 on failure
323 324
  */
324
-int ring_filter(struct sip_msg *msg, void *bar)
325
+int ring_filter(struct sip_msg *msg, unsigned int flags, void *bar)
325 326
 {
326 327
 	int contains_callid;
327 328
 
... ...
@@ -70,10 +70,11 @@ void ring_destroy_hashtable(void);
70 70
 /*!
71 71
  * \brief Callback function that does the work inside the server.
72 72
  * \param msg SIP message
73
+ * \param flags unused
73 74
  * \param bar unused
74 75
  * \return 1 on success, -1 on failure
75 76
  */
76
-int ring_filter(struct sip_msg *msg, void *bar);
77
+int ring_filter(struct sip_msg *msg, unsigned int flags, void *bar);
77 78
 
78 79
 
79 80
 /*!
... ...
@@ -129,7 +129,7 @@ static int mod_init(void)
129 129
 			LM_CRIT("cannot initialize lock.\n");
130 130
 			return -1;
131 131
 		}
132
-		if (register_script_cb(ring_filter, PRE_SCRIPT_CB|RPL_TYPE_CB, 0) != 0) {
132
+		if (register_script_cb(ring_filter, PRE_SCRIPT_CB|ONREPLY_CB, 0) != 0) {
133 133
 			LM_ERR("could not insert callback");
134 134
 			return -1;
135 135
 		}
... ...
@@ -166,7 +166,7 @@ static int mod_init(void)
166 166
 #endif
167 167
 
168 168
 	/* filter all ACKs before script */
169
-	if (register_script_cb(sl_filter_ACK, PRE_SCRIPT_CB|REQ_TYPE_CB, 0 )!=0) {
169
+	if (register_script_cb(sl_filter_ACK, PRE_SCRIPT_CB|REQUEST_CB, 0 )!=0) {
170 170
 		LM_ERR("register_script_cb failed\n");
171 171
 		return -1;
172 172
 	}
... ...
@@ -295,7 +295,7 @@ int sl_reply_error(struct sip_msg *msg )
295 295
  * Filter ACKs
296 296
  * \return 0 for ACKs to a local reply, -1 on error, 1 is not an ACK or a non-local ACK
297 297
  */
298
-int sl_filter_ACK(struct sip_msg *msg, void *bar )
298
+int sl_filter_ACK(struct sip_msg *msg, unsigned int flags, void *bar )
299 299
 {
300 300
 	str *tag_str;
301 301
 
... ...
@@ -40,7 +40,7 @@ int sl_startup(void);
40 40
 int sl_shutdown(void);
41 41
 int sl_send_reply( struct sip_msg *msg, int code, str *reason);
42 42
 int sl_send_reply_dlg( struct sip_msg *msg, int code, str *reason, str *tag);
43
-int sl_filter_ACK( struct sip_msg *msg, void *foo );
43
+int sl_filter_ACK( struct sip_msg *msg, unsigned int flags, void *foo );
44 44
 int sl_reply_error( struct sip_msg *msg );
45 45
 int sl_get_reply_totag(struct sip_msg *msg, str *totag);
46 46
 
... ...
@@ -426,7 +426,7 @@ int extra_attrs_fixup(void** param, int param_no)
426 426
 gen_lock_t *locks = NULL; /* set of mutexes allocated in shared memory */
427 427
 int lock_counters[LOCK_CNT]; /* set of counters (each proces has its own counters) */
428 428
 
429
-static int avpdb_post_script_cb(struct sip_msg *msg, void *param) {
429
+static int avpdb_post_script_cb(struct sip_msg *msg, unsigned int flags, void *param) {
430 430
 	int i;
431 431
 
432 432
 	for (i=0; i<LOCK_CNT; i++) {
... ...
@@ -468,7 +468,7 @@ int init_extra_avp_locks()
468 468
 		t = t->next;
469 469
 	}
470 470
 
471
-	register_script_cb(avpdb_post_script_cb, REQ_TYPE_CB | RPL_TYPE_CB| POST_SCRIPT_CB, 0);
471
+	register_script_cb(avpdb_post_script_cb, REQUEST_CB | ONREPLY_CB | POST_SCRIPT_CB, 0);
472 472
 
473 473
 	return 0;
474 474
 }
... ...
@@ -963,12 +963,12 @@ static int dbops_close_query_func(struct sip_msg* m, char* handle, char* dummy)
963 963
 	return 1;
964 964
 }
965 965
 
966
-static int dbops_pre_script_cb(struct sip_msg *msg, void *param) {
966
+static int dbops_pre_script_cb(struct sip_msg *msg, unsigned int flags, void *param) {
967 967
 	xlbuf_tail = xlbuf;
968 968
 	return 1;
969 969
 }
970 970
 
971
-static int dbops_post_script_cb(struct sip_msg *msg, void *param) {
971
+static int dbops_post_script_cb(struct sip_msg *msg, unsigned int flags, void *param) {
972 972
 	struct dbops_handle *a;
973 973
 	for (a = dbops_handles; a; a=a->next) {
974 974
 		dbops_close_query_func(msg, (char*) a, 0);
... ...
@@ -1051,8 +1051,8 @@ static int mod_init(void) {
1051 1051
 			return res;
1052 1052
 	}
1053 1053
 
1054
-	register_script_cb(dbops_pre_script_cb, REQ_TYPE_CB | RPL_TYPE_CB| PRE_SCRIPT_CB, 0);
1055
-	register_script_cb(dbops_post_script_cb, REQ_TYPE_CB | RPL_TYPE_CB| POST_SCRIPT_CB, 0);
1054
+	register_script_cb(dbops_pre_script_cb, REQUEST_CB | ONREPLY_CB | PRE_SCRIPT_CB, 0);
1055
+	register_script_cb(dbops_post_script_cb, REQUEST_CB | ONREPLY_CB | POST_SCRIPT_CB, 0);
1056 1056
 	register_select_table(sel_declaration);
1057 1057
 
1058 1058
 	return 0;
... ...
@@ -1492,8 +1492,8 @@ static int declare_handle(modparam_t type, char* param) {
1492 1492
 }
1493 1493
 
1494 1494
 static int dbops_proper_func(struct sip_msg* m, char* dummy1, char* dummy2) {
1495
-	dbops_pre_script_cb(m, NULL);
1496
-	dbops_post_script_cb(m, NULL);
1495
+	dbops_pre_script_cb(m, 0, NULL);
1496
+	dbops_post_script_cb(m, 0, NULL);
1497 1497
 	return 1;
1498 1498
 }
1499 1499
 
... ...
@@ -361,7 +361,7 @@ static int declare_register(modparam_t type, char* param) {
361 361
 	return 0;
362 362
 }
363 363
 
364
-static int mod_pre_script_cb(struct sip_msg *msg, void *param) {
364
+static int mod_pre_script_cb(struct sip_msg *msg, unsigned int flags, void *param) {
365 365
 	destroy_stack();
366 366
 	destroy_register_values();
367 367
 	return 1;
... ...
@@ -2000,7 +2000,7 @@ select_row_t sel_declaration[] = {
2000 2000
 
2001 2001
 static int mod_init() {
2002 2002
 
2003
-	register_script_cb(mod_pre_script_cb, REQ_TYPE_CB | RPL_TYPE_CB| PRE_SCRIPT_CB, 0);
2003
+	register_script_cb(mod_pre_script_cb, REQUEST_CB | ONREPLY_CB | PRE_SCRIPT_CB, 0);
2004 2004
 	register_select_table(sel_declaration);
2005 2005
 	return 0;
2006 2006
 }
... ...
@@ -728,7 +728,7 @@ select_row_t sel_declaration[] = {
728 728
 	{ NULL, SEL_PARAM_INT, STR_NULL, NULL, 0}
729 729
 };
730 730
 
731
-static int mod_pre_script_cb(struct sip_msg *msg, void *param) {
731
+static int mod_pre_script_cb(struct sip_msg *msg, unsigned int flags, void *param) {
732 732
 	sdp_ip.s = "";
733 733
 	sdp_ip.len = 0;
734 734
 	global_session_ids = NULL;
... ...
@@ -758,7 +758,7 @@ static int mod_init(void) {
758 758
 		xt_RTPPROXY_release_switchboards(&handle, out_switchboard);
759 759
 	}
760 760
 
761
-	register_script_cb(mod_pre_script_cb, REQ_TYPE_CB | RPL_TYPE_CB| PRE_SCRIPT_CB, 0);
761
+	register_script_cb(mod_pre_script_cb, REQUEST_CB | ONREPLY_CB | PRE_SCRIPT_CB, 0);
762 762
 	register_select_table(sel_declaration);
763 763
 	return 0;
764 764
 err:
... ...
@@ -130,7 +130,7 @@ static int mod_init(void)
130 130
 	}
131 131
 
132 132
 	     /* if SL loaded, filter ACKs on beginning */
133
-	if (register_script_cb( sl_filter_ACK, PRE_SCRIPT_CB|REQ_TYPE_CB, 0 )<0) {
133
+	if (register_script_cb( sl_filter_ACK, PRE_SCRIPT_CB|REQUEST_CB, 0 )<0) {
134 134
 		ERR("Failed to install SCRIPT callback\n");
135 135
 		return -1;
136 136
 	}
... ...
@@ -213,7 +213,7 @@ int sl_reply_error(struct sip_msg *msg )
213 213
     -1 : error
214 214
     1  : is not an ACK  or a non-local ACK
215 215
 */
216
-int sl_filter_ACK(struct sip_msg *msg, void *bar )
216
+int sl_filter_ACK(struct sip_msg *msg, unsigned int flags, void *bar )
217 217
 {
218 218
 	str *tag_str;
219 219
 
... ...
@@ -42,7 +42,7 @@ int sl_shutdown();
42 42
 typedef int (*sl_send_reply_f)(struct sip_msg* msg, int code, char* reason);
43 43
 int sl_send_reply(struct sip_msg* msg, int code, char* reason);
44 44
 
45
-int sl_filter_ACK(struct sip_msg*, void *bar );
45
+int sl_filter_ACK(struct sip_msg*, unsigned int flags, void *bar );
46 46
 int sl_reply_error(struct sip_msg *msg );
47 47
 
48 48
 
... ...
@@ -184,7 +184,7 @@ static ticks_t timer_handler(ticks_t ticks, struct timer_ln* tl, void* data) {
184 184
 		/* ... clear branches from previous message */
185 185
 		clear_branches();
186 186
 		reset_static_buffer();
187
-		if (exec_pre_req_cb(msg)==0 )
187
+		if (exec_pre_script_cb(msg, REQUEST_CB_TYPE)==0 )
188 188
 			goto end; /* drop the request */
189 189
 		/* exec the routing script */
190 190
 		timer_executed = a;
... ...
@@ -192,7 +192,7 @@ static ticks_t timer_handler(ticks_t ticks, struct timer_ln* tl, void* data) {
192 192
 		run_actions(&ra_ctx, main_rt.rlist[a->route_no], msg);
193 193
 		timer_executed = 0;
194 194
 		/* execute post request-script callbacks */
195
-		exec_post_req_cb(msg);
195
+		exec_post_script_cb(msg, REQUEST_CB_TYPE);
196 196
 	end:
197 197
 		reset_avps();
198 198
 		DEBUG(MODULE_NAME": handler: cleaning up\n");
... ...
@@ -58,7 +58,7 @@
58 58
 #include "../sl/sl.h"
59 59
 #include "../../nonsip_hooks.h"
60 60
 #include "../../action.h" /* run_actions */
61
-#include "../../script_cb.h" /* exec_*_req_cb */
61
+#include "../../script_cb.h" /* exec_*_script_cb */
62 62
 #include "../../route.h" /* route_get */
63 63
 #include "http.h"
64 64
 
... ...
@@ -1742,7 +1742,7 @@ static int em_receive_request(sip_msg_t* orig_msg,
1742 1742
 		BUG("xmlrpc: strange message: %.*s\n", msg->len, msg->buf);
1743 1743
 		goto error;
1744 1744
 	}
1745
-	if (exec_pre_req_cb(msg) == 0) {
1745
+	if (exec_pre_script_cb(msg, REQUEST_CB_TYPE) == 0) {
1746 1746
 		goto end; /* drop request */
1747 1747
 	}
1748 1748
 	/* exec routing script */
... ...
@@ -1752,7 +1752,7 @@ static int em_receive_request(sip_msg_t* orig_msg,
1752 1752
 		goto end;
1753 1753
 	}
1754 1754
  end:
1755
-	exec_post_req_cb(msg); /* needed for example if tm is used */
1755
+	exec_post_script_cb(msg, REQUEST_CB_TYPE); /* needed for example if tm is used */
1756 1756
 	/* reset_avps(); non needed, performed by the real receive_msg */
1757 1757
 	if (msg != orig_msg) { /* avoid double free (freed from receive_msg
1758 1758
 							  too) */
... ...
@@ -164,7 +164,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
164 164
 		   (like presence of at least one via), so you can count
165 165
 		   on via1 being parsed in a pre-script callback --andrei
166 166
 		*/
167
-		if (exec_pre_req_cb(msg)==0 )
167
+		if (exec_pre_script_cb(msg, REQUEST_CB_TYPE)==0 )
168 168
 			goto end; /* drop the request */
169 169
 
170 170
 		set_route_type(REQUEST_ROUTE);
... ...
@@ -185,7 +185,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
185 185
 #endif
186 186
 
187 187
 		/* execute post request-script callbacks */
188
-		exec_post_req_cb(msg);
188
+		exec_post_script_cb(msg, REQUEST_CB_TYPE);
189 189
 	}else if (msg->first_line.type==SIP_REPLY){
190 190
 		/* sanity checks */
191 191
 		if ((msg->via1==0) || (msg->via1->error!=PARSE_OK)){
... ...
@@ -206,7 +206,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
206 206
 		   (like presence of at least one via), so you can count
207 207
 		   on via1 being parsed in a pre-script callback --andrei
208 208
 		*/
209
-		if (exec_pre_rpl_cb(msg)==0 )
209
+		if (exec_pre_script_cb(msg, ONREPLY_CB_TYPE)==0 )
210 210
 			goto end; /* drop the request */
211 211
 
212 212
 		/* exec the onreply routing script */
... ...
@@ -232,7 +232,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
232 232
 #endif
233 233
 
234 234
 		/* execute post reply-script callbacks */
235
-		exec_post_rpl_cb(msg);
235
+		exec_post_script_cb(msg, ONREPLY_CB_TYPE);
236 236
 	}
237 237
 
238 238
 end:
... ...
@@ -250,13 +250,13 @@ end:
250 250
 	return 0;
251 251
 error_rpl:
252 252
 	/* execute post reply-script callbacks */
253
-	exec_post_rpl_cb(msg);
253
+	exec_post_script_cb(msg, ONREPLY_CB_TYPE);
254 254
 	reset_avps();
255 255
 	goto error02;
256 256
 error_req:
257 257
 	DBG("receive_msg: error:...\n");
258 258
 	/* execute post request-script callbacks */
259
-	exec_post_req_cb(msg);
259
+	exec_post_script_cb(msg, REQUEST_CB_TYPE);
260 260
 	/* free possible loaded avps -bogdan */
261 261
 	reset_avps();
262 262
 error02: