Browse code

tm: removed the defines of cfg and api functions

Daniel-Constantin Mierla authored on 06/05/2010 18:17:08
Showing 3 changed files
... ...
@@ -314,32 +314,32 @@ static cmd_export_t cmds[]={
314 314
 			REQUEST_ROUTE},
315 315
 	{"t_lookup_cancel",    w_t_lookup_cancel,       1, fixup_int_1,
316 316
 			REQUEST_ROUTE},
317
-	{T_REPLY,              w_t_reply,               2, fixup_t_reply,
317
+	{"t_reply",              w_t_reply,               2, fixup_t_reply,
318 318
 			REQUEST_ROUTE | ONREPLY_ROUTE | FAILURE_ROUTE },
319 319
 	{"t_retransmit_reply", w_t_retransmit_reply,    0, 0,
320 320
 			REQUEST_ROUTE},
321 321
 	{"t_release",          w_t_release,             0, 0,
322 322
 			REQUEST_ROUTE},
323
-	{T_RELAY_TO_UDP,       w_t_relay_to_udp,        2, fixup_hostport2proxy,
323
+	{"t_relay_to_udp",       w_t_relay_to_udp,        2, fixup_hostport2proxy,
324 324
 			REQUEST_ROUTE|FAILURE_ROUTE},
325
-	{T_RELAY_TO_UDP,       w_t_relay_to_udp_uri,    0, 0,
325
+	{"t_relay_to_udp",       w_t_relay_to_udp_uri,    0, 0,
326 326
 			REQUEST_ROUTE|FAILURE_ROUTE},
327 327
 #ifdef USE_TCP
328
-	{T_RELAY_TO_TCP,       w_t_relay_to_tcp,        2, fixup_hostport2proxy,
328
+	{"t_relay_to_tcp",       w_t_relay_to_tcp,        2, fixup_hostport2proxy,
329 329
 			REQUEST_ROUTE|FAILURE_ROUTE},
330
-	{T_RELAY_TO_TCP,       w_t_relay_to_tcp_uri,    0, 0,
330
+	{"t_relay_to_tcp",       w_t_relay_to_tcp_uri,    0, 0,
331 331
 			REQUEST_ROUTE|FAILURE_ROUTE},
332 332
 #endif
333 333
 #ifdef USE_TLS
334
-	{T_RELAY_TO_TLS,       w_t_relay_to_tls,        2, fixup_hostport2proxy,
334
+	{"t_relay_to_tls",       w_t_relay_to_tls,        2, fixup_hostport2proxy,
335 335
 			REQUEST_ROUTE|FAILURE_ROUTE},
336
-	{T_RELAY_TO_TLS,       w_t_relay_to_tls_uri,    0, 0,
336
+	{"t_relay_to_tls",       w_t_relay_to_tls_uri,    0, 0,
337 337
 			REQUEST_ROUTE|FAILURE_ROUTE},
338 338
 #endif
339 339
 #ifdef USE_SCTP
340
-	{T_RELAY_TO_SCTP,       w_t_relay_to_sctp,       2, fixup_hostport2proxy,
340
+	{"t_relay_to_sctp",       w_t_relay_to_sctp,       2, fixup_hostport2proxy,
341 341
 			REQUEST_ROUTE|FAILURE_ROUTE},
342
-	{T_RELAY_TO_SCTP,       w_t_relay_to_sctp_uri,    0, 0,
342
+	{"t_relay_to_sctp",       w_t_relay_to_sctp_uri,    0, 0,
343 343
 			REQUEST_ROUTE|FAILURE_ROUTE},
344 344
 #endif
345 345
 	{"t_replicate",        w_t_replicate_uri,       1, fixup_var_str_1,
... ...
@@ -362,9 +362,9 @@ static cmd_export_t cmds[]={
362 362
 #endif
363 363
 	{"t_replicate_to", w_t_replicate_to,  		2, fixup_proto_hostport2proxy,
364 364
 			REQUEST_ROUTE},
365
-	{T_RELAY,              w_t_relay,               0, 0,
365
+	{"t_relay",              w_t_relay,               0, 0,
366 366
 			REQUEST_ROUTE | FAILURE_ROUTE },
367
-	{T_RELAY,              w_t_relay2,              2, fixup_hostport2proxy,
367
+	{"t_relay",              w_t_relay2,              2, fixup_hostport2proxy,
368 368
 			REQUEST_ROUTE | FAILURE_ROUTE },
369 369
 	{"t_relay_to_avp", w_t_relay_to_avp,  		2, fixup_proto_hostport2proxy,
370 370
 			REQUEST_ROUTE},
... ...
@@ -374,22 +374,22 @@ static cmd_export_t cmds[]={
374 374
 			REQUEST_ROUTE | FAILURE_ROUTE },
375 375
 	{"t_relay_to",			w_t_relay_to,           2, fixup_t_relay_to,
376 376
 			REQUEST_ROUTE | FAILURE_ROUTE },
377
-	{T_FORWARD_NONACK,     w_t_forward_nonack,      2, fixup_hostport2proxy,
377
+	{"t_forward_nonack",     w_t_forward_nonack,      2, fixup_hostport2proxy,
378 378
 			REQUEST_ROUTE},
379
-	{T_FORWARD_NONACK_URI, w_t_forward_nonack_uri,  0, 0,
379
+	{"t_forward_nonack_uri", w_t_forward_nonack_uri,  0, 0,
380 380
 			REQUEST_ROUTE},
381
-	{T_FORWARD_NONACK_UDP, w_t_forward_nonack_udp,  2, fixup_hostport2proxy,
381
+	{"t_forward_nonack_udp", w_t_forward_nonack_udp,  2, fixup_hostport2proxy,
382 382
 			REQUEST_ROUTE},
383 383
 #ifdef USE_TCP
384
-	{T_FORWARD_NONACK_TCP, w_t_forward_nonack_tcp,  2, fixup_hostport2proxy,
384
+	{"t_forward_nonack_tcp", w_t_forward_nonack_tcp,  2, fixup_hostport2proxy,
385 385
 			REQUEST_ROUTE},
386 386
 #endif
387 387
 #ifdef USE_TLS
388
-	{T_FORWARD_NONACK_TLS, w_t_forward_nonack_tls,  2, fixup_hostport2proxy,
388
+	{"t_forward_nonack_tls", w_t_forward_nonack_tls,  2, fixup_hostport2proxy,
389 389
 			REQUEST_ROUTE},
390 390
 #endif
391 391
 #ifdef USE_SCTP
392
-	{T_FORWARD_NONACK_SCTP, w_t_forward_nonack_sctp, 2, fixup_hostport2proxy,
392
+	{"t_forward_nonack_sctp", w_t_forward_nonack_sctp, 2, fixup_hostport2proxy,
393 393
 			REQUEST_ROUTE},
394 394
 #endif
395 395
 	{"t_forward_nonack_to", w_t_forward_nonack_to,  2, fixup_proto_hostport2proxy,
... ...
@@ -457,11 +457,11 @@ static cmd_export_t cmds[]={
457 457
 	/* not applicable from the script */
458 458
 	{"register_tmcb",      (cmd_function)register_tmcb,     NO_SCRIPT,   0, 0},
459 459
 	{"load_tm",            (cmd_function)load_tm,           NO_SCRIPT,   0, 0},
460
-	{T_REPLY_WB,           (cmd_function)t_reply_with_body, NO_SCRIPT,   0, 0},
461
-	{T_IS_LOCAL,           (cmd_function)t_is_local,        NO_SCRIPT,   0, 0},
462
-	{T_GET_TI,             (cmd_function)t_get_trans_ident, NO_SCRIPT,   0, 0},
463
-	{T_LOOKUP_IDENT,       (cmd_function)t_lookup_ident,    NO_SCRIPT,   0, 0},
464
-	{T_ADDBLIND,           (cmd_function)add_blind_uac,     NO_SCRIPT,   0, 0},
460
+	{"t_reply_with_body",  (cmd_function)t_reply_with_body, NO_SCRIPT,   0, 0},
461
+	{"t_is_local",         (cmd_function)t_is_local,        NO_SCRIPT,   0, 0},
462
+	{"t_get_trans_ident",  (cmd_function)t_get_trans_ident, NO_SCRIPT,   0, 0},
463
+	{"t_lookup_ident",     (cmd_function)t_lookup_ident,    NO_SCRIPT,   0, 0},
464
+	{"t_add_blind",        (cmd_function)add_blind_uac,     NO_SCRIPT,   0, 0},
465 465
 	{"t_request_within",   (cmd_function)req_within,        NO_SCRIPT,   0, 0},
466 466
 	{"t_request_outside",  (cmd_function)req_outside,       NO_SCRIPT,   0, 0},
467 467
 	{"t_request",          (cmd_function)request,           NO_SCRIPT,   0, 0},
... ...
@@ -473,7 +473,7 @@ static cmd_export_t cmds[]={
473 473
 	{"set_dlg_target",     (cmd_function)set_dlg_target,    NO_SCRIPT,   0, 0},
474 474
 	{"free_dlg",           (cmd_function)free_dlg,          NO_SCRIPT,   0, 0},
475 475
 	{"print_dlg",          (cmd_function)print_dlg,         NO_SCRIPT,   0, 0},
476
-	{T_GETT,               (cmd_function)get_t,             NO_SCRIPT,   0, 0},
476
+	{"t_gett",             (cmd_function)get_t,             NO_SCRIPT,   0, 0},
477 477
 	{"calculate_hooks",    (cmd_function)w_calculate_hooks, NO_SCRIPT,   0, 0},
478 478
 	{"t_uac",              (cmd_function)t_uac,             NO_SCRIPT,   0, 0},
479 479
 	{"t_uac_with_ids",     (cmd_function)t_uac_with_ids,    NO_SCRIPT,   0, 0},
... ...
@@ -59,16 +59,16 @@ int load_tm( struct tm_binds *tmb)
59 59
 		return -1;
60 60
 	}
61 61
 #ifdef USE_TCP
62
-	if (!( tmb->t_relay_to_tcp=find_export(T_RELAY_TO_TCP, 2, 0)) ) {
62
+	if (!( tmb->t_relay_to_tcp=find_export("t_relay_to_tcp", 2, 0)) ) {
63 63
 		LOG(L_ERR, LOAD_ERROR "'t_relay_to_tcp' not found\n");
64 64
 		return -1;
65 65
 	}
66 66
 #endif
67
-	if (!( tmb->t_relay_to_udp=find_export(T_RELAY_TO_UDP, 2, 0)) ) {
67
+	if (!( tmb->t_relay_to_udp=find_export("t_relay_to_udp", 2, 0)) ) {
68 68
 		LOG(L_ERR, LOAD_ERROR "'t_relay_to_udp' not found\n");
69 69
 		return -1;
70 70
 	}
71
-	if (!( tmb->t_relay=find_export(T_RELAY, 0, 0)) ) {
71
+	if (!( tmb->t_relay=find_export("t_relay", 0, 0)) ) {
72 72
 		LOG(L_ERR, LOAD_ERROR "'t_relay' not found\n");
73 73
 		return -1;
74 74
 	}
... ...
@@ -79,29 +79,29 @@ int load_tm( struct tm_binds *tmb)
79 79
 	tmb->t_reply = w_t_reply_wrp;
80 80
 	
81 81
 	if (!(tmb->t_reply_with_body=(treply_wb_f)find_export
82
-	(T_REPLY_WB, NO_SCRIPT, 0)) ) {
82
+	("t_reply_with_body", NO_SCRIPT, 0)) ) {
83 83
 		LOG( L_ERR, LOAD_ERROR "'t_reply_with_body' not found\n");
84 84
 		return -1;
85 85
 	}
86
-	if (!(tmb->t_is_local=(tislocal_f)find_export(T_IS_LOCAL,NO_SCRIPT,0)) ) {
86
+	if (!(tmb->t_is_local=(tislocal_f)find_export("t_is_local",NO_SCRIPT,0)) ) {
87 87
 		LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
88 88
 		return -1;
89 89
 	}
90 90
 	if (!(tmb->t_get_trans_ident=(tget_ti_f)find_export
91
-	(T_GET_TI, NO_SCRIPT, 0)) ) {
91
+	("t_get_trans_ident", NO_SCRIPT, 0)) ) {
92 92
 		LOG( L_ERR, LOAD_ERROR "'t_get_trans_ident' not found\n");
93 93
 		return -1;
94 94
 	}
95 95
 	if (!(tmb->t_lookup_ident=(tlookup_ident_f)find_export
96
-	(T_LOOKUP_IDENT, NO_SCRIPT, 0)) ) {
96
+	("t_lookup_ident", NO_SCRIPT, 0)) ) {
97 97
 		LOG( L_ERR, LOAD_ERROR "'t_lookup_ident' not found\n");
98 98
 		return -1;
99 99
 	}
100
-	if (!(tmb->t_addblind=(taddblind_f)find_export(T_ADDBLIND,NO_SCRIPT,0))) {
100
+	if (!(tmb->t_addblind=(taddblind_f)find_export("t_add_blind",NO_SCRIPT,0))) {
101 101
 		LOG( L_ERR, LOAD_ERROR "'addblind' not found\n");
102 102
 		return -1;
103 103
 	}
104
-	if (!(tmb->t_forward_nonack=(tfwd_f)find_export(T_FORWARD_NONACK,2,0))) {
104
+	if (!(tmb->t_forward_nonack=(tfwd_f)find_export("t_forward_nonack",2,0))) {
105 105
 		LOG( L_ERR, LOAD_ERROR "'t_forward_nonack' not found\n");
106 106
 		return -1;
107 107
 	}
... ...
@@ -157,8 +157,8 @@ int load_tm( struct tm_binds *tmb)
157 157
 		LOG( L_ERR, LOAD_ERROR "'print_dlg' not found\n");
158 158
 		return -1;
159 159
 	}
160
-	if (!(tmb->t_gett=(tgett_f)find_export(T_GETT,NO_SCRIPT,0))) {
161
-		LOG( L_ERR, LOAD_ERROR "'" T_GETT "' not found\n");
160
+	if (!(tmb->t_gett=(tgett_f)find_export("t_gett",NO_SCRIPT,0))) {
161
+		LOG( L_ERR, LOAD_ERROR "'t_gett' not found\n");
162 162
 		return -1;
163 163
 	}
164 164
 	if (!(tmb->calculate_hooks=(calculate_hooks_f)find_export("calculate_hooks",NO_SCRIPT,0))) {
... ...
@@ -55,32 +55,6 @@
55 55
 /* export not usable from scripts */
56 56
 #define NO_SCRIPT	-1
57 57
 
58
-#define T_RELAY_TO           "t_relay_to"
59
-#define T_RELAY_TO_UDP       "t_relay_to_udp"
60
-#define T_RELAY_TO_TCP       "t_relay_to_tcp"
61
-#define T_RELAY_TO_TLS       "t_relay_to_tls"
62
-#define T_RELAY_TO_SCTP      "t_relay_to_sctp"
63
-#define T_RELAY              "t_relay"
64
-#define T_REPLY              "t_reply"
65
-#define T_REPLY_WB           "t_reply_with_body"
66
-#define T_REPLY_UNSAFE       "t_reply_unsafe"
67
-#define T_ADDBLIND           "t_add_blind"
68
-#define T_REPLY_UNSAFE       "t_reply_unsafe"
69
-#define T_FORWARD_NONACK     "t_forward_nonack"
70
-#define T_FORWARD_NONACK_URI "t_forward_nonack_uri"
71
-#define T_FORWARD_NONACK_UDP "t_forward_nonack_udp"
72
-#define T_FORWARD_NONACK_TCP "t_forward_nonack_tcp"
73
-#define T_FORWARD_NONACK_TLS "t_forward_nonack_tls"
74
-#define T_FORWARD_NONACK_SCTP "t_forward_nonack_sctp"
75
-#define T_GET_TI             "t_get_trans_ident"
76
-#define T_LOOKUP_IDENT       "t_lookup_ident"
77
-#define T_IS_LOCAL           "t_is_local"
78
-#define T_REQUEST_WITHIN     "request_within"
79
-#define T_REQUEST_OUTSIDE    "request_outside"
80
-#define T_GETT               "t_gett"
81
-
82
-
83
-
84 58
 struct tm_binds {
85 59
 	register_tmcb_f  register_tmcb;
86 60
 	cmd_function     t_relay_to_udp; /* WARNING: failure_route unsafe */