Browse code

- sctp support - added t_relay_to_sctp(). t_replicate_sctp(), t_forward_nonack_sctp()

Andrei Pelinescu-Onciul authored on 11/08/2008 17:41:16
Showing 5 changed files
... ...
@@ -1,4 +1,4 @@
1
-TM Module
1
+1. TM Module
2 2
 
3 3
 Jiri Kuthan
4 4
 
... ...
@@ -9,7 +9,83 @@ Jiri Kuthan
9 9
    Revision $Revision$ $Date$
10 10
      __________________________________________________________________
11 11
 
12
-Overview
12
+   1.1. Overview
13
+   1.2. Known Issues
14
+   1.3. Parameters
15
+
16
+        1.3.1. fr_timer (integer)
17
+        1.3.2. fr_inv_timer (integer)
18
+        1.3.3. max_inv_lifetime (integer)
19
+        1.3.4. max_noninv_lifetime (integer)
20
+        1.3.5. wt_timer (integer)
21
+        1.3.6. delete_timer (integer)
22
+        1.3.7. retr_timer1 (integer)
23
+        1.3.8. retr_timer2 (integer)
24
+        1.3.9. noisy_ctimer (integer)
25
+        1.3.10. restart_fr_on_each_reply (integer)
26
+        1.3.11. auto_inv_100 (integer)
27
+        1.3.12. unix_tx_timeout (integer)
28
+        1.3.13. aggregate_challenges (integer)
29
+        1.3.14. reparse_invite (integer)
30
+        1.3.15. ac_extra_hdrs (string)
31
+        1.3.16. blst_503 (integer)
32
+        1.3.17. blst_503_def_timeout (integer)
33
+        1.3.18. blst_503_min_timeout (integer)
34
+        1.3.19. blst_503_max_timeout (integer)
35
+        1.3.20. blst_methods_add (unsigned integer)
36
+        1.3.21. blst_methods_lookup (unsigned integer)
37
+        1.3.22. cancel_b_method (integer)
38
+        1.3.23. reparse_on_dns_failover (integer)
39
+        1.3.24. on_sl_reply (string)
40
+
41
+   1.4. Functions
42
+
43
+        1.4.1. t_relay_to_udp(ip, port), t_relay_to_udp(),
44
+                t_relay_to_tcp(ip, port) t_relay_to_tcp()
45
+                t_relay_to_tls(ip, port) t_relay_to_tls()
46
+                t_relay_to_sctp(ip, port) t_relay_to_sctp()
47
+
48
+        1.4.2. t_relay() t_relay(host, port)
49
+        1.4.3. t_on_failure(failure_route)
50
+        1.4.4. t_on_reply(onreply_route)
51
+        1.4.5. t_on_branch(branch_route)
52
+        1.4.6. append_branch()
53
+        1.4.7. t_newtran()
54
+        1.4.8. t_reply(code, reason_phrase)
55
+        1.4.9. t_lookup_request()
56
+        1.4.10. t_retransmit_reply()
57
+        1.4.11. t_release()
58
+        1.4.12. t_forward_nonack() t_forward_nonack(ip, port)
59
+                t_forward_nonack_udp(ip, port) t_forward_nonack_tcp(ip,
60
+                port) t_forward_nonack_tls(ip, port)
61
+                t_forward_nonack_sctp(ip, port)
62
+
63
+        1.4.13. t_set_fr(fr_inv_timeout [, fr_timeout])
64
+        1.4.14. t_reset_fr()
65
+        1.4.15. t_set_max_lifetime(inv_lifetime, noninv_lifetime)
66
+        1.4.16. t_reset_max_lifetime()
67
+        1.4.17. t_set_retr(retr_t1_interval, retr_t2_interval)
68
+        1.4.18. t_reset_retr()
69
+        1.4.19. t_set_auto_inv_100(0|1)
70
+        1.4.20. t_branch_timeout()
71
+        1.4.21. t_branch_replied()
72
+        1.4.22. t_any_timeout()
73
+        1.4.23. t_any_replied()
74
+        1.4.24. t_grep_status("code")
75
+        1.4.25. t_is_canceled()
76
+        1.4.26. t_relay_cancel()
77
+        1.4.27. t_drop_replies()
78
+        1.4.28. t_save_lumps()
79
+
80
+   1.5. TM Module API
81
+
82
+        1.5.1. Defines
83
+        1.5.2. Functions
84
+
85
+              1.5.2.1. register_tmcb(cb_type, cb_func)
86
+              1.5.2.2. load_tm(*import_structure)
87
+
88
+1.1. Overview
13 89
 
14 90
    TM module enables stateful processing of SIP transactions. The main use
15 91
    of stateful logic, which is costly in terms of memory and CPU, is some
... ...
@@ -58,7 +134,7 @@ Overview
58 134
    timeouts, forking, etc. See t_uac prototype in uac.h for more details.
59 135
    Who wants to see the transaction result may register for a callback.
60 136
 
61
-Known Issues
137
+1.2. Known Issues
62 138
 
63 139
      * Possibly, performance could be improved by not parsing non-INVITEs,
64 140
        as they do not be replied with 100, and do not result in
... ...
@@ -74,12 +150,12 @@ Known Issues
74 150
        be removed from a message prior to replicating it (well, does not
75 151
        matter any longer so much as there is a new replication module).
76 152
 
77
-Parameters
153
+1.3. Parameters
78 154
 
79 155
    Revision History
80 156
    Revision $Revision$ $Date$
81 157
 
82
-fr_timer (integer)
158
+1.3.1. fr_timer (integer)
83 159
 
84 160
    Timer which hits if no final reply for a request or ACK for a negative
85 161
    INVITE reply arrives (in milliseconds).
... ...
@@ -93,7 +169,7 @@ fr_timer (integer)
93 169
 modparam("tm", "fr_timer", 10000)
94 170
 ...
95 171
 
96
-fr_inv_timer (integer)
172
+1.3.2. fr_inv_timer (integer)
97 173
 
98 174
    Timer which hits if no final reply for an INVITE arrives after a
99 175
    provisional message was received (in milliseconds).
... ...
@@ -110,7 +186,7 @@ fr_inv_timer (integer)
110 186
 modparam("tm", "fr_inv_timer", 180000)
111 187
 ...
112 188
 
113
-max_inv_lifetime (integer)
189
+1.3.3. max_inv_lifetime (integer)
114 190
 
115 191
    Maximum time an INVITE transaction is allowed to be active (in
116 192
    milliseconds). After this interval has passed from the transaction
... ...
@@ -146,7 +222,7 @@ max_inv_lifetime (integer)
146 222
 modparam("tm", "max_inv_lifetime", 150000)
147 223
 ...
148 224
 
149
-max_noninv_lifetime (integer)
225
+1.3.4. max_noninv_lifetime (integer)
150 226
 
151 227
    Maximum time a non-INVITE transaction is allowed to be active (in
152 228
    milliseconds). After this interval has passed from the transaction
... ...
@@ -176,7 +252,7 @@ max_noninv_lifetime (integer)
176 252
 modparam("tm", "max_inv_lifetime", 30000)
177 253
 ...
178 254
 
179
-wt_timer (integer)
255
+1.3.5. wt_timer (integer)
180 256
 
181 257
    Time for which a transaction stays in memory to absorb delayed messages
182 258
    after it completed (in milliseconds); also, when this timer hits,
... ...
@@ -191,7 +267,7 @@ wt_timer (integer)
191 267
 modparam("tm", "wt_timer", 1000)
192 268
 ...
193 269
 
194
-delete_timer (integer)
270
+1.3.6. delete_timer (integer)
195 271
 
196 272
    Time after which a to-be-deleted transaction currently ref-ed by a
197 273
    process will be tried to be deleted again (in milliseconds).
... ...
@@ -206,7 +282,7 @@ delete_timer (integer)
206 282
 modparam("tm", "delete_timer", 100)
207 283
 ...
208 284
 
209
-retr_timer1 (integer)
285
+1.3.7. retr_timer1 (integer)
210 286
 
211 287
    Initial retransmission period (in milliseconds).
212 288
 
... ...
@@ -217,7 +293,7 @@ retr_timer1 (integer)
217 293
 modparam("tm", "retr_timer1", 1000)
218 294
 ...
219 295
 
220
-retr_timer2 (integer)
296
+1.3.8. retr_timer2 (integer)
221 297
 
222 298
    Maximum retransmission period (in milliseconds). The retransmission
223 299
    interval starts with retr_timer1 and increases until it reaches this
... ...
@@ -230,7 +306,7 @@ retr_timer2 (integer)
230 306
 modparam("tm", "retr_timer2", 2000)
231 307
 ...
232 308
 
233
-noisy_ctimer (integer)
309
+1.3.9. noisy_ctimer (integer)
234 310
 
235 311
    If set, INVITE transactions that time-out (FR INV timer) will be always
236 312
    replied. If it's not set, the transaction has only one branch and no
... ...
@@ -249,7 +325,7 @@ noisy_ctimer (integer)
249 325
 modparam("tm", "noisy_ctimer", 1)
250 326
 ...
251 327
 
252
-restart_fr_on_each_reply (integer)
328
+1.3.10. restart_fr_on_each_reply (integer)
253 329
 
254 330
    If set (default), the fr_inv_timer for an INVITE transaction will be
255 331
    restarted for each provisional reply received (rfc3261 mandated
... ...
@@ -271,7 +347,7 @@ restart_fr_on_each_reply (integer)
271 347
 modparam("tm", "restart_fr_on_each_reply", 0)
272 348
 ...
273 349
 
274
-auto_inv_100 (integer)
350
+1.3.11. auto_inv_100 (integer)
275 351
 
276 352
    If set (default) tm will automatically send and 100 reply to INVITEs.
277 353
 
... ...
@@ -291,7 +367,7 @@ auto_inv_100 (integer)
291 367
 modparam("tm", "auto_inv_100", 0)
292 368
 ...
293 369
 
294
-unix_tx_timeout (integer)
370
+1.3.12. unix_tx_timeout (integer)
295 371
 
296 372
    Unix socket transmission timeout, in milliseconds.
297 373
 
... ...
@@ -306,7 +382,7 @@ unix_tx_timeout (integer)
306 382
 modparam("tm", "unix_tx_timeout", 250)
307 383
 ...
308 384
 
309
-aggregate_challenges (integer)
385
+1.3.13. aggregate_challenges (integer)
310 386
 
311 387
    If set (default), the final reply is a 401 or a 407 and more then one
312 388
    branch received a 401 or 407, then all the WWW-Authenticate and
... ...
@@ -323,7 +399,7 @@ aggregate_challenges (integer)
323 399
 modparam("tm", "aggregate_challenges", 0)
324 400
 ...
325 401
 
326
-reparse_invite (integer)
402
+1.3.14. reparse_invite (integer)
327 403
 
328 404
    If set (default), the CANCEL and negative ACK requests are constructed
329 405
    from the INVITE message which was sent out instead of building them
... ...
@@ -349,7 +425,7 @@ reparse_invite (integer)
349 425
 modparam("tm", "reparse_invite", 0)
350 426
 ...
351 427
 
352
-ac_extra_hdrs (string)
428
+1.3.15. ac_extra_hdrs (string)
353 429
 
354 430
    Header fields prefixed by this parameter value are included in the
355 431
    CANCEL and negative ACK messages if they were present in the outgoing
... ...
@@ -367,7 +443,7 @@ ac_extra_hdrs (string)
367 443
 modparam("tm", "ac_extra_hdrs", "myfavoriteheaders-")
368 444
 ...
369 445
 
370
-blst_503 (integer)
446
+1.3.16. blst_503 (integer)
371 447
 
372 448
    If set and the blacklist support is enabled, every 503 reply source is
373 449
    added to the blacklist. The initial blacklist timeout (or ttl) depends
... ...
@@ -385,7 +461,7 @@ blst_503 (integer)
385 461
 modparam("tm", "blst_503", 1)
386 462
 ...
387 463
 
388
-blst_503_def_timeout (integer)
464
+1.3.17. blst_503_def_timeout (integer)
389 465
 
390 466
    Blacklist interval in seconds for a 503 reply with no Retry-After
391 467
    header. See also blst_503, blst_503_min_timeout and
... ...
@@ -400,7 +476,7 @@ blst_503_def_timeout (integer)
400 476
 modparam("tm", "blst_503_def_timeout", 120)
401 477
 ...
402 478
 
403
-blst_503_min_timeout (integer)
479
+1.3.18. blst_503_min_timeout (integer)
404 480
 
405 481
    Minimum blacklist interval in seconds for a 503 reply with a
406 482
    Retry-After header. It will be used if the Retry-After value is
... ...
@@ -414,7 +490,7 @@ blst_503_min_timeout (integer)
414 490
 modparam("tm", "blst_503_min_timeout", 30)
415 491
 ...
416 492
 
417
-blst_503_max_timeout (integer)
493
+1.3.19. blst_503_max_timeout (integer)
418 494
 
419 495
    Maximum blacklist interval in seconds for a 503 reply with a
420 496
    Retry-After header. It will be used if the Retry-After value is
... ...
@@ -428,7 +504,7 @@ blst_503_max_timeout (integer)
428 504
 modparam("tm", "blst_503_max_timeout", 604800)
429 505
 ...
430 506
 
431
-blst_methods_add (unsigned integer)
507
+1.3.20. blst_methods_add (unsigned integer)
432 508
 
433 509
    Bitmap of method types that trigger blacklisting on transaction
434 510
    timeouts. (This setting has no effect on blacklisting because of send
... ...
@@ -453,7 +529,7 @@ blst_methods_add (unsigned integer)
453 529
 modparam("tm", "blst_methods_add", 33)
454 530
 ...
455 531
 
456
-blst_methods_lookup (unsigned integer)
532
+1.3.21. blst_methods_lookup (unsigned integer)
457 533
 
458 534
    Bitmap of method types that are looked-up in the blacklist before
459 535
    statefull forwarding. See also blst_methods_add
... ...
@@ -467,7 +543,7 @@ blst_methods_lookup (unsigned integer)
467 543
 modparam("tm", "blst_methods_lookup", 1)
468 544
 ...
469 545
 
470
-cancel_b_method (integer)
546
+1.3.22. cancel_b_method (integer)
471 547
 
472 548
    Method used when attempting to CANCEL an unreplied transaction branch
473 549
    (a branch where no reply greater the 99 was received). The possible
... ...
@@ -505,7 +581,7 @@ cancel_b_method (integer)
505 581
 modparam("tm", "cancel_b_method", 1)
506 582
 ...
507 583
 
508
-reparse_on_dns_failover (integer)
584
+1.3.23. reparse_on_dns_failover (integer)
509 585
 
510 586
    If set to 1, the SIP message after a DNS failover is constructed from
511 587
    the outgoing message buffer of the failed branch instead of from the
... ...
@@ -533,7 +609,7 @@ reparse_on_dns_failover (integer)
533 609
 modparam("tm", "reparse_on_dns_failover", 0)
534 610
 ...
535 611
 
536
-on_sl_reply (string)
612
+1.3.24. on_sl_reply (string)
537 613
 
538 614
    Sets reply route block, to which control is passed when a reply is
539 615
    received that has no associated transaction. The reply is passed to the
... ...
@@ -550,13 +626,14 @@ onreply_route["stateless_replies"] {
550 626
         return 0;
551 627
 }
552 628
 
553
-Functions
629
+1.4. Functions
554 630
 
555 631
    Revision History
556 632
    Revision $Revision$ $Date$
557 633
 
558
-t_relay_to_udp(ip, port), t_relay_to_udp(), t_relay_to_tcp(ip, port)
634
+1.4.1.  t_relay_to_udp(ip, port), t_relay_to_udp(), t_relay_to_tcp(ip, port)
559 635
 t_relay_to_tcp() t_relay_to_tls(ip, port) t_relay_to_tls()
636
+t_relay_to_sctp(ip, port) t_relay_to_sctp()
560 637
 
561 638
    Relay a message statefully using a fixed protocol either to the
562 639
    specified fixed destination or to a destination derived from the
... ...
@@ -582,7 +659,7 @@ else
582 659
         t_relay_to_tcp(); # relay to msg. uri, but over tcp
583 660
 ...
584 661
 
585
-t_relay() t_relay(host, port)
662
+1.4.2.  t_relay() t_relay(host, port)
586 663
 
587 664
    Relay a message statefully either to the destination indicated in the
588 665
    current URI (if called without any parameters) or to the specified host
... ...
@@ -610,7 +687,7 @@ if (!t_relay())
610 687
 };
611 688
 ...
612 689
 
613
-t_on_failure(failure_route)
690
+1.4.3.  t_on_failure(failure_route)
614 691
 
615 692
    Sets failure routing block, to which control is passed after a
616 693
    transaction completed with a negative result but before sending a final
... ...
@@ -647,7 +724,7 @@ failure_route[1] {
647 724
    See test/onr.cfg for a more complex example of combination of serial
648 725
    with parallel forking.
649 726
 
650
-t_on_reply(onreply_route)
727
+1.4.4.  t_on_reply(onreply_route)
651 728
 
652 729
    Sets the reply routing block, to which control is passed when a reply
653 730
    for the current transaction is received. Note that the set of commands
... ...
@@ -677,7 +754,7 @@ es');
677 754
         }
678 755
 }
679 756
 
680
-t_on_branch(branch_route)
757
+1.4.5.  t_on_branch(branch_route)
681 758
 
682 759
    Sets the branch routing block, to which control is passed after forking
683 760
    (when a new branch is created). For now branch routes are intended only
... ...
@@ -701,7 +778,7 @@ branch_route[1] {
701 778
         }
702 779
 }
703 780
 
704
-append_branch()
781
+1.4.6.  append_branch()
705 782
 
706 783
    Similarly to t_fork_to, it extends destination set by a new entry. The
707 784
    difference is that current URI is taken as new entry.
... ...
@@ -715,7 +792,7 @@ t_fork();
715 792
 t_relay();
716 793
 ...
717 794
 
718
-t_newtran()
795
+1.4.7.  t_newtran()
719 796
 
720 797
    Creates a new transaction, returns a negative value on error. This is
721 798
    the only way a script can add a new transaction in an atomic way.
... ...
@@ -731,7 +808,7 @@ if (t_newtran()) {
731 808
 
732 809
    See test/uas.cfg for more examples.
733 810
 
734
-t_reply(code, reason_phrase)
811
+1.4.8.  t_reply(code, reason_phrase)
735 812
 
736 813
    Sends a stateful reply after a transaction has been established. See
737 814
    t_newtran for usage.
... ...
@@ -745,7 +822,7 @@ t_reply(code, reason_phrase)
745 822
 t_reply("404", "Not found");
746 823
 ...
747 824
 
748
-t_lookup_request()
825
+1.4.9.  t_lookup_request()
749 826
 
750 827
    Checks if a transaction exists. Returns a positive value if so,
751 828
    negative otherwise. Most likely you will not want to use it, as a
... ...
@@ -760,7 +837,7 @@ if (t_lookup_request()) {
760 837
 };
761 838
 ...
762 839
 
763
-t_retransmit_reply()
840
+1.4.10.  t_retransmit_reply()
764 841
 
765 842
    Retransmits a reply sent previously by UAS transaction.
766 843
 
... ...
@@ -769,7 +846,7 @@ t_retransmit_reply()
769 846
 t_retransmit_reply();
770 847
 ...
771 848
 
772
-t_release()
849
+1.4.11.  t_release()
773 850
 
774 851
    Remove transaction from memory (it will be first put on a wait timer to
775 852
    absorb delayed messages).
... ...
@@ -779,7 +856,9 @@ t_release()
779 856
 t_release();
780 857
 ...
781 858
 
782
-t_forward_nonack(ip, port)
859
+1.4.12.  t_forward_nonack() t_forward_nonack(ip, port)
860
+t_forward_nonack_udp(ip, port) t_forward_nonack_tcp(ip, port)
861
+t_forward_nonack_tls(ip, port) t_forward_nonack_sctp(ip, port)
783 862
 
784 863
    mainly for internal usage--forward a non-ACK request statefully.
785 864
 
... ...
@@ -792,7 +871,7 @@ t_forward_nonack(ip, port)
792 871
 t_forward_nonack("1.2.3.4", "5060");
793 872
 ...
794 873
 
795
-t_set_fr(fr_inv_timeout [, fr_timeout])
874
+1.4.13.  t_set_fr(fr_inv_timeout [, fr_timeout])
796 875
 
797 876
    Sets the fr_inv_timeout and optionally fr_timeout for the current
798 877
    transaction or for transactions created during the same script
... ...
@@ -826,7 +905,7 @@ branch_route[1] {
826 905
         }
827 906
 }
828 907
 
829
-t_reset_fr()
908
+1.4.14.  t_reset_fr()
830 909
 
831 910
    Resets the fr_inv_timer and fr_timer for the current transaction to the
832 911
    default values (set using the tm module parameters fr_inv_timer and
... ...
@@ -845,7 +924,7 @@ route {
845 924
 ...
846 925
 }
847 926
 
848
-t_set_max_lifetime(inv_lifetime, noninv_lifetime)
927
+1.4.15.  t_set_max_lifetime(inv_lifetime, noninv_lifetime)
849 928
 
850 929
    Sets the maximum lifetime for the current INVITE or non-INVITE
851 930
    transaction, or for transactions created during the same script
... ...
@@ -874,7 +953,7 @@ route {
874 953
                                           # INVITE and to 15s if not
875 954
 }
876 955
 
877
-t_reset_max_lifetime()
956
+1.4.16.  t_reset_max_lifetime()
878 957
 
879 958
    Resets the the maximum lifetime for the current INVITE or non-INVITE
880 959
    transaction to the default value (set using the tm module parameter
... ...
@@ -893,7 +972,7 @@ route {
893 972
 ...
894 973
 }
895 974
 
896
-t_set_retr(retr_t1_interval, retr_t2_interval)
975
+1.4.17.  t_set_retr(retr_t1_interval, retr_t2_interval)
897 976
 
898 977
    Sets the retr_t1_interval and retr_t2_interval for the current
899 978
    transaction or for transactions created during the same script
... ...
@@ -939,7 +1018,7 @@ branch_route[1] {
939 1018
         }
940 1019
 }
941 1020
 
942
-t_reset_retr()
1021
+1.4.18.  t_reset_retr()
943 1022
 
944 1023
    Resets the retr_timer1 and retr_timer2 for the current transaction to
945 1024
    the default values (set using the tm module parameters retr_timer1 and
... ...
@@ -958,7 +1037,7 @@ route {
958 1037
 ...
959 1038
 }
960 1039
 
961
-t_set_auto_inv_100(0|1)
1040
+1.4.19.  t_set_auto_inv_100(0|1)
962 1041
 
963 1042
    Switch automatically sending 100 replies to INVITEs on/off on a per
964 1043
    transaction basis. It overrides the auto_inv_100 value for the current
... ...
@@ -975,7 +1054,7 @@ route {
975 1054
 ...
976 1055
 }
977 1056
 
978
-t_branch_timeout()
1057
+1.4.20.  t_branch_timeout()
979 1058
 
980 1059
    Returns true if the failure route is executed for a branch that did
981 1060
    timeout. It can be used only from the failure_route.
... ...
@@ -989,7 +1068,7 @@ failure_route[0]{
989 1068
         }
990 1069
 }
991 1070
 
992
-t_branch_replied()
1071
+1.4.21.  t_branch_replied()
993 1072
 
994 1073
    Returns true if the failure route is executed for a branch that did
995 1074
    receive at least one reply in the past (the "current" reply is not
... ...
@@ -1007,7 +1086,7 @@ failure_route[0]{
1007 1086
         }
1008 1087
 }
1009 1088
 
1010
-t_any_timeout()
1089
+1.4.22.  t_any_timeout()
1011 1090
 
1012 1091
    Returns true if at least one of the current transactions branches did
1013 1092
    timeout.
... ...
@@ -1023,7 +1102,7 @@ failure_route[0]{
1023 1102
         }
1024 1103
 }
1025 1104
 
1026
-t_any_replied()
1105
+1.4.23.  t_any_replied()
1027 1106
 
1028 1107
    Returns true if at least one of the current transactions branches did
1029 1108
    receive some reply in the past. If called from a failure or onreply
... ...
@@ -1038,7 +1117,7 @@ onreply_route[0]{
1038 1117
         }
1039 1118
 }
1040 1119
 
1041
-t_grep_status("code")
1120
+1.4.24.  t_grep_status("code")
1042 1121
 
1043 1122
    Returns true if "code" is the final reply received (or locally
1044 1123
    generated) in at least one of the current transactions branches.
... ...
@@ -1052,7 +1131,7 @@ onreply_route[0]{
1052 1131
         }
1053 1132
 }
1054 1133
 
1055
-t_is_canceled()
1134
+1.4.25.  t_is_canceled()
1056 1135
 
1057 1136
    Returns true if the current transaction was canceled.
1058 1137
 
... ...
@@ -1065,7 +1144,7 @@ failure_route[0]{
1065 1144
         }
1066 1145
 }
1067 1146
 
1068
-t_relay_cancel()
1147
+1.4.26.  t_relay_cancel()
1069 1148
 
1070 1149
    Forwards the CANCEL if the corresponding INVITE transaction exists. The
1071 1150
    function is supposed to be used at the very beginning of the script,
... ...
@@ -1090,7 +1169,7 @@ if (method == CANCEL) {
1090 1169
         # do the same as for INVITEs
1091 1170
 }
1092 1171
 
1093
-t_drop_replies()
1172
+1.4.27.  t_drop_replies()
1094 1173
 
1095 1174
    Drops all the previously received replies in failure_route block to
1096 1175
    make sure that none of them is picked up again. Works only if a new
... ...
@@ -1113,7 +1192,7 @@ failure_route[0]{
1113 1192
         }
1114 1193
 }
1115 1194
 
1116
-t_save_lumps()
1195
+1.4.28.  t_save_lumps()
1117 1196
 
1118 1197
    Forces the modifications of the processed SIP message to be saved in
1119 1198
    shared memory before t_relay() is called. The new branches which are
... ...
@@ -1153,7 +1232,7 @@ failure_route[1] {
1153 1232
         t_relay();
1154 1233
 }
1155 1234
 
1156
-TM Module API
1235
+1.5. TM Module API
1157 1236
 
1158 1237
    Revision History
1159 1238
    Revision $Revision$ $Date$
... ...
@@ -1202,7 +1281,7 @@ end of body
1202 1281
 
1203 1282
    or cat test/transaction.fifo > /tmp/ser_fifo
1204 1283
 
1205
-Defines
1284
+1.5.1. Defines
1206 1285
 
1207 1286
      * ACK_TAG enables stricter matching of acknowledgments including
1208 1287
        to-tags. Without it, to-tags are ignored. It is disabled by default
... ...
@@ -1221,9 +1300,9 @@ Defines
1221 1300
        ACK_TAG, all this complex transactions matching goes with RFC3261's
1222 1301
        magic cookie away anyway.
1223 1302
 
1224
-Functions
1303
+1.5.2. Functions
1225 1304
 
1226
-register_tmcb(cb_type, cb_func)
1305
+1.5.2.1.  register_tmcb(cb_type, cb_func)
1227 1306
 
1228 1307
    For programmatic use only--register a function to be called back on an
1229 1308
    event. See t_hooks.h for more details.
... ...
@@ -1232,7 +1311,7 @@ register_tmcb(cb_type, cb_func)
1232 1311
      * cb_type - Callback type.
1233 1312
      * cb_func - Callback function.
1234 1313
 
1235
-load_tm(*import_structure)
1314
+1.5.2.2.  load_tm(*import_structure)
1236 1315
 
1237 1316
    For programmatic use only--import exported TM functions. See the acc
1238 1317
    module for an example of use.
... ...
@@ -22,6 +22,8 @@
22 22
 	    <function>t_relay_to_tcp()</function>
23 23
 	    <function>t_relay_to_tls(ip, port)</function>
24 24
 	    <function>t_relay_to_tls()</function>
25
+	    <function>t_relay_to_sctp(ip, port)</function>
26
+	    <function>t_relay_to_sctp()</function>
25 27
 	</title>
26 28
 	<para>
27 29
 	    Relay a message statefully using a fixed protocol either to the 
... ...
@@ -371,7 +373,12 @@ t_release();
371 373
 
372 374
     <section id="t_forward_nonack">
373 375
 	<title>
376
+	    <function>t_forward_nonack()</function>
374 377
 	    <function>t_forward_nonack(ip, port)</function>
378
+	    <function>t_forward_nonack_udp(ip, port)</function>
379
+	    <function>t_forward_nonack_tcp(ip, port)</function>
380
+	    <function>t_forward_nonack_tls(ip, port)</function>
381
+	    <function>t_forward_nonack_sctp(ip, port)</function>
375 382
 	</title>
376 383
 	<para>
377 384
 	    mainly for internal usage--forward a non-ACK request statefully.
... ...
@@ -89,6 +89,8 @@
89 89
  *  2008-05-15  added t_relay(host, port) (similar to forward(host, port)) &
90 90
  *               t_relay_to_{udp,tcp,tls}(<no param>) (force protocol, but 
91 91
  *               forward to uri)  (andrei)
92
+ *  2008-08-11  sctp support: t_relay_to_sctp, t_replicate_sctp,
93
+ *               t_forward_nonack_sctp (andrei
92 94
  */
93 95
 
94 96
 
... ...
@@ -168,6 +170,11 @@ inline static int w_t_relay_to_tls( struct sip_msg  *p_msg , char *proxy,
168 170
 				char *);
169 171
 inline static int w_t_relay_to_tls_uri( struct sip_msg  *p_msg , char*, char*);
170 172
 #endif
173
+#ifdef USE_SCTP
174
+inline static int w_t_relay_to_sctp( struct sip_msg  *p_msg , char *proxy,
175
+				char *);
176
+inline static int w_t_relay_to_sctp_uri( struct sip_msg*, char*, char*);
177
+#endif
171 178
 inline static int w_t_relay_to_avp(struct sip_msg* msg, char* str,char*);
172 179
 inline static int w_t_replicate( struct sip_msg  *p_msg ,
173 180
 				char *proxy, /* struct proxy_l *proxy expected */
... ...
@@ -185,15 +192,23 @@ inline static int w_t_replicate_tls( struct sip_msg  *p_msg ,
185 192
 				char *proxy, /* struct proxy_l *proxy expected */
186 193
 				char *_foo       /* nothing expected */ );
187 194
 #endif
195
+#ifdef USE_SCTP
196
+inline static int w_t_replicate_sctp( struct sip_msg  *p_msg ,
197
+				char *proxy, /* struct proxy_l *proxy expected */
198
+				char *_foo       /* nothing expected */ );
199
+#endif
188 200
 inline static int w_t_replicate_to(struct sip_msg* msg, char* str,char*);
189 201
 inline static int w_t_forward_nonack(struct sip_msg* msg, char* str, char* );
190 202
 inline static int w_t_forward_nonack_uri(struct sip_msg* msg, char* str,char*);
191 203
 inline static int w_t_forward_nonack_udp(struct sip_msg* msg, char* str,char*);
192 204
 #ifdef USE_TCP
193
-inline static int w_t_forward_nonack_tcp(struct sip_msg* msg, char* str,char*);
205
+inline static int w_t_forward_nonack_tcp(struct sip_msg*, char* str,char*);
194 206
 #endif
195 207
 #ifdef USE_TLS
196
-inline static int w_t_forward_nonack_tls(struct sip_msg* msg, char* str,char*);
208
+inline static int w_t_forward_nonack_tls(struct sip_msg*, char* str,char*);
209
+#endif
210
+#ifdef USE_SCTP
211
+inline static int w_t_forward_nonack_sctp(struct sip_msg*, char* str,char*);
197 212
 #endif
198 213
 inline static int w_t_forward_nonack_to(struct sip_msg* msg, char* str,char*);
199 214
 inline static int w_t_relay_cancel(struct sip_msg *p_msg, char *_foo, char *_bar);
... ...
@@ -256,6 +271,12 @@ static cmd_export_t cmds[]={
256 271
 			REQUEST_ROUTE|FAILURE_ROUTE},
257 272
 	{T_RELAY_TO_TLS,       w_t_relay_to_tls_uri,    0, 0,
258 273
 			REQUEST_ROUTE|FAILURE_ROUTE},
274
+#endif
275
+#ifdef USE_SCTP
276
+	{T_RELAY_TO_SCTP,       w_t_relay_to_sctp,       2, fixup_hostport2proxy,
277
+			REQUEST_ROUTE|FAILURE_ROUTE},
278
+	{T_RELAY_TO_SCTP,       w_t_relay_to_sctp_uri,    0, 0,
279
+			REQUEST_ROUTE|FAILURE_ROUTE},
259 280
 #endif
260 281
 	{"t_replicate",        w_t_replicate,           2, fixup_hostport2proxy,
261 282
 			REQUEST_ROUTE},
... ...
@@ -268,6 +289,10 @@ static cmd_export_t cmds[]={
268 289
 #ifdef USE_TLS
269 290
 	{"t_replicate_tls",    w_t_replicate_tls,       2, fixup_hostport2proxy,
270 291
 			REQUEST_ROUTE},
292
+#endif
293
+#ifdef USE_SCTP
294
+	{"t_replicate_sctp",    w_t_replicate_sctp,     2, fixup_hostport2proxy,
295
+			REQUEST_ROUTE},
271 296
 #endif
272 297
 	{"t_replicate_to", w_t_replicate_to,  		2, fixup_proto_hostport2proxy,
273 298
 			REQUEST_ROUTE},
... ...
@@ -290,6 +315,10 @@ static cmd_export_t cmds[]={
290 315
 #ifdef USE_TLS
291 316
 	{T_FORWARD_NONACK_TLS, w_t_forward_nonack_tls,  2, fixup_hostport2proxy,
292 317
 			REQUEST_ROUTE},
318
+#endif
319
+#ifdef USE_SCTP
320
+	{T_FORWARD_NONACK_SCTP, w_t_forward_nonack_sctp, 2, fixup_hostport2proxy,
321
+			REQUEST_ROUTE},
293 322
 #endif
294 323
 	{"t_forward_nonack_to", w_t_forward_nonack_to,  2, fixup_proto_hostport2proxy,
295 324
 			REQUEST_ROUTE},
... ...
@@ -882,6 +911,8 @@ inline static int str2proto(char *s, int len) {
882 911
 		return PROTO_TCP;
883 912
 	else if (len == 3 && !strncasecmp(s, "tls", 3))
884 913
 		return PROTO_TLS;	
914
+	else if (len == 4 && !strncasecmp(s, "sctp", 4))
915
+		return PROTO_SCTP;
885 916
 	else
886 917
 		return PROTO_NONE;
887 918
 }
... ...
@@ -1031,6 +1062,16 @@ inline static int w_t_forward_nonack_tls( struct sip_msg* msg, char* proxy,
1031 1062
 }
1032 1063
 #endif
1033 1064
 
1065
+
1066
+#ifdef USE_SCTP
1067
+inline static int w_t_forward_nonack_sctp( struct sip_msg* msg, char* proxy,
1068
+										char* foo)
1069
+{
1070
+	return _w_t_forward_nonack(msg, ( struct proxy_l *) proxy, PROTO_SCTP);
1071
+}
1072
+#endif
1073
+
1074
+
1034 1075
 inline static int w_t_forward_nonack_to( struct sip_msg  *p_msg ,
1035 1076
 	char *proto_par, 
1036 1077
 	char *addr_par   )
... ...
@@ -1242,6 +1283,24 @@ inline static int w_t_relay_to_tls_uri( struct sip_msg  *p_msg ,
1242 1283
 }
1243 1284
 #endif
1244 1285
 
1286
+
1287
+#ifdef USE_SCTP
1288
+inline static int w_t_relay_to_sctp( struct sip_msg  *p_msg ,
1289
+									char *proxy, /* struct proxy_l* */
1290
+									char *_foo       /* nothing expected */ )
1291
+{
1292
+	return _w_t_relay_to( p_msg, ( struct proxy_l *) proxy, PROTO_SCTP);
1293
+}
1294
+
1295
+/* forward to uri, but force tcp as transport */
1296
+inline static int w_t_relay_to_sctp_uri( struct sip_msg  *p_msg ,
1297
+										char *_foo, char *_bar   )
1298
+{
1299
+	return _w_t_relay_to(p_msg, (struct proxy_l *)0, PROTO_SCTP);
1300
+}
1301
+#endif
1302
+
1303
+
1245 1304
 inline static int w_t_relay_to_avp( struct sip_msg  *p_msg ,
1246 1305
 									char *proto_par, 
1247 1306
 									char *addr_par   )
... ...
@@ -1292,6 +1351,17 @@ inline static int w_t_replicate_tls( struct sip_msg  *p_msg ,
1292 1351
 }
1293 1352
 #endif
1294 1353
 
1354
+
1355
+#ifdef USE_SCTP
1356
+inline static int w_t_replicate_sctp( struct sip_msg  *p_msg ,
1357
+	char *proxy, /* struct proxy_l *proxy expected */
1358
+	char *_foo       /* nothing expected */ )
1359
+{
1360
+	return t_replicate(p_msg, ( struct proxy_l *) proxy, PROTO_SCTP );
1361
+}
1362
+#endif
1363
+
1364
+
1295 1365
 inline static int w_t_replicate_to( struct sip_msg  *p_msg ,
1296 1366
 	char *proto_par, 
1297 1367
 	char *addr_par   )
... ...
@@ -55,6 +55,7 @@
55 55
 #define T_RELAY_TO_UDP       "t_relay_to_udp"
56 56
 #define T_RELAY_TO_TCP       "t_relay_to_tcp"
57 57
 #define T_RELAY_TO_TLS       "t_relay_to_tls"
58
+#define T_RELAY_TO_SCTP      "t_relay_to_sctp"
58 59
 #define T_RELAY              "t_relay"
59 60
 #define T_REPLY              "t_reply"
60 61
 #define T_REPLY_WB           "t_reply_with_body"
... ...
@@ -66,6 +67,7 @@
66 67
 #define T_FORWARD_NONACK_UDP "t_forward_nonack_udp"
67 68
 #define T_FORWARD_NONACK_TCP "t_forward_nonack_tcp"
68 69
 #define T_FORWARD_NONACK_TLS "t_forward_nonack_tls"
70
+#define T_FORWARD_NONACK_SCTP "t_forward_nonack_sctp"
69 71
 #define T_GET_TI             "t_get_trans_ident"
70 72
 #define T_LOOKUP_IDENT       "t_lookup_ident"
71 73
 #define T_IS_LOCAL           "t_is_local"
... ...
@@ -77,6 +77,9 @@ inline static enum sip_protos get_proto(enum sip_protos force_proto,
77 77
 #endif
78 78
 #ifdef USE_TLS
79 79
 				case PROTO_TLS:
80
+#endif
81
+#ifdef USE_SCTP
82
+				case PROTO_SCTP:
80 83
 #endif
81 84
 						return proto;
82 85
 				default:
... ...
@@ -90,6 +93,9 @@ inline static enum sip_protos get_proto(enum sip_protos force_proto,
90 93
 #endif
91 94
 #ifdef USE_TLS
92 95
 		case PROTO_TLS:
96
+#endif
97
+#ifdef USE_SCTP
98
+		case PROTO_SCTP:
93 99
 #endif
94 100
 			return force_proto;
95 101
 		default: