Added disable_6xx_block, ruri_matching, via1_matching,
pass_provisional_replies, default_code, default_reason,
t_set_disable_6xx(), t_set_disable_failover().
... | ... |
@@ -87,6 +87,15 @@ new script commands: |
87 | 87 |
set_reply_close() - like set_forward_close(), but it works for replies to |
88 | 88 |
the current message. |
89 | 89 |
|
90 |
+tm: |
|
91 |
+ disable_6xx_block parameter - if set, will treat 6xx replies like normal |
|
92 |
+ replies (non rfc conformant). Default: off. |
|
93 |
+ See also t_set_disable_6xx(). |
|
94 |
+ t_set_disable_6xx(0|1) - can be used to turn off/on the special 6xx handling |
|
95 |
+ on a per transaction basis. |
|
96 |
+ t_set_disable_failover(0|1) - can be used to turn off/on dns failover on a |
|
97 |
+ per transaction basis. |
|
98 |
+ |
|
90 | 99 |
|
91 | 100 |
|
92 | 101 |
2.1.0 changes |
... | ... |
@@ -49,6 +49,12 @@ Juha Heinanen |
49 | 49 |
1.3.28. fr_timer_avp (string) |
50 | 50 |
1.3.29. fr_inv_timer_avp (string) |
51 | 51 |
1.3.30. unmatched_cancel (string) |
52 |
+ 1.3.31. ruri_matching (integer) |
|
53 |
+ 1.3.32. via1_matching (integer) |
|
54 |
+ 1.3.33. pass_provisional_replies (integer) |
|
55 |
+ 1.3.34. default_code (integer) |
|
56 |
+ 1.3.35. default_reason (string) |
|
57 |
+ 1.3.36. disable_6xx_block (integer) |
|
52 | 58 |
|
53 | 59 |
1.4. Functions |
54 | 60 |
|
... | ... |
@@ -93,6 +99,8 @@ Juha Heinanen |
93 | 99 |
1.4.31. t_load_contacts() |
94 | 100 |
1.4.32. t_next_contacts() |
95 | 101 |
1.4.33. t_check_trans() |
102 |
+ 1.4.34. t_set_disable_6xx(0|1) |
|
103 |
+ 1.4.35. t_set_disable_failover(0|1) |
|
96 | 104 |
|
97 | 105 |
1.5. TM Module API |
98 | 106 |
|
... | ... |
@@ -775,6 +783,113 @@ modparam("tm", "fr_inv_timer_avp", "my_fr_inv_timer") |
775 | 783 |
modparam("tm", "unmatched_cancel", "2") |
776 | 784 |
... |
777 | 785 |
|
786 |
+1.3.31. ruri_matching (integer) |
|
787 |
+ |
|
788 |
+ If set it will also try to match the request uri when doing pre-3261 |
|
789 |
+ transaction matching (the via branch parameter does not contain the |
|
790 |
+ 3261 cookie). |
|
791 |
+ |
|
792 |
+ The only reason to have it not set is for interoperability with old, |
|
793 |
+ broken implementations. |
|
794 |
+ |
|
795 |
+ Default value is 1 (on). |
|
796 |
+ |
|
797 |
+ Can be set at runtime, e.g.: |
|
798 |
+ $ sercmd cfg.set_now_int tm ruri_matching 0 |
|
799 |
+ |
|
800 |
+ Example 31. Set ruri_matching parameter |
|
801 |
+... |
|
802 |
+modparam("tm", "ruri_matching", 1) |
|
803 |
+... |
|
804 |
+ |
|
805 |
+1.3.32. via1_matching (integer) |
|
806 |
+ |
|
807 |
+ If set it will also try to match the topmost via when doing pre-3261 |
|
808 |
+ transaction matching (the via branch parameter does not contain the |
|
809 |
+ 3261 cookie). |
|
810 |
+ |
|
811 |
+ The only reason to have it not set is for interoperability with old, |
|
812 |
+ broken implementations. |
|
813 |
+ |
|
814 |
+ Default value is 1 (on). |
|
815 |
+ |
|
816 |
+ Can be set at runtime, e.g.: |
|
817 |
+ $ sercmd cfg.set_now_int tm via1_matching 0 |
|
818 |
+ |
|
819 |
+ Example 32. Set via1_matching parameter |
|
820 |
+... |
|
821 |
+modparam("tm", "via1_matching", 1) |
|
822 |
+... |
|
823 |
+ |
|
824 |
+1.3.33. pass_provisional_replies (integer) |
|
825 |
+ |
|
826 |
+ If set, TMCB_LOCAL_REPONSE_OUT tm registered callbacks will be called |
|
827 |
+ also for provisional replies. |
|
828 |
+ |
|
829 |
+ Default value is 0 (off). |
|
830 |
+ |
|
831 |
+ Can be set at runtime, e.g.: |
|
832 |
+ $ sercmd cfg.set_now_int tm pass_provisional_replies 1 |
|
833 |
+ |
|
834 |
+ Example 33. Set pass_provisional_replies parameter |
|
835 |
+... |
|
836 |
+modparam("tm", "pass_provisional_replies", 1) |
|
837 |
+... |
|
838 |
+ |
|
839 |
+1.3.34. default_code (integer) |
|
840 |
+ |
|
841 |
+ Default response code sent by t_reply() if it cannot retrieve its |
|
842 |
+ parameters (e.g. inexistent avp). Valid values are between 400 and 699. |
|
843 |
+ |
|
844 |
+ Default value is 500. |
|
845 |
+ |
|
846 |
+ Can be set at runtime, e.g.: |
|
847 |
+ $ sercmd cfg.set_now_int tm default_code 505 |
|
848 |
+ |
|
849 |
+ Example 34. Set default_code parameter |
|
850 |
+... |
|
851 |
+modparam("tm", "default_code", 501) |
|
852 |
+... |
|
853 |
+ |
|
854 |
+1.3.35. default_reason (string) |
|
855 |
+ |
|
856 |
+ Default SIP reason phrase sent by t_reply() if it cannot retrieve its |
|
857 |
+ parameters (e.g. inexistent avp). |
|
858 |
+ |
|
859 |
+ Default value is "Server Internal Error". |
|
860 |
+ |
|
861 |
+ Can be set at runtime, e.g.: |
|
862 |
+ $ sercmd cfg.set_now_string tm default_reason "Unknown error" |
|
863 |
+ |
|
864 |
+ Example 35. Set default_reason parameter |
|
865 |
+... |
|
866 |
+modparam("tm", "default_reason", "Unknown reason") |
|
867 |
+... |
|
868 |
+ |
|
869 |
+1.3.36. disable_6xx_block (integer) |
|
870 |
+ |
|
871 |
+ If set tm will treat all the 6xx replies like normal replies (warning: |
|
872 |
+ this would be non-rfc conformant behaviour). |
|
873 |
+ |
|
874 |
+ If not set (default) receiving a 6xx will cancel all the running |
|
875 |
+ parallel branches, will stop dns failover and forking. However serial |
|
876 |
+ forking using append_branch() in the failure_route will still work. |
|
877 |
+ |
|
878 |
+ It can be overwritten on a per transaction basis using |
|
879 |
+ t_set_disable_6xx(). |
|
880 |
+ |
|
881 |
+ Default value is 0 (off, rfc conformant behaviour). |
|
882 |
+ |
|
883 |
+ Can be set at runtime, e.g.: |
|
884 |
+ $ sercmd cfg.set_now_int tm disable_6xx_block 0 |
|
885 |
+ |
|
886 |
+ See also: t_set_disable_6xx(). |
|
887 |
+ |
|
888 |
+ Example 36. Set disable_6xx_block parameter |
|
889 |
+... |
|
890 |
+modparam("tm", "disable_6xx_block", 1) |
|
891 |
+... |
|
892 |
+ |
|
778 | 893 |
1.4. Functions |
779 | 894 |
|
780 | 895 |
Revision History |
... | ... |
@@ -800,7 +915,7 @@ t_relay_to_sctp(ip, port) t_relay_to_sctp() |
800 | 915 |
derived from the message uri (using sip sepcific DNS lookups), but with |
801 | 916 |
the protocol corresponding to the function name. |
802 | 917 |
|
803 |
- Example 31. t_relay_to_udp usage |
|
918 |
+ Example 37. t_relay_to_udp usage |
|
804 | 919 |
... |
805 | 920 |
if (src_ip==10.0.0.0/8) |
806 | 921 |
t_relay_to_udp("1.2.3.4", "5060"); # sent to 1.2.3.4:5060 over udp |
... | ... |
@@ -827,7 +942,7 @@ else |
827 | 942 |
Returns a negative value on failure--you may still want to send a |
828 | 943 |
negative reply upstream statelessly not to leave upstream UAC in lurch. |
829 | 944 |
|
830 |
- Example 32. t_relay usage |
|
945 |
+ Example 38. t_relay usage |
|
831 | 946 |
... |
832 | 947 |
if (!t_relay()) |
833 | 948 |
{ |
... | ... |
@@ -856,7 +971,7 @@ if (!t_relay()) |
856 | 971 |
Meaning of the parameters is as follows: |
857 | 972 |
* failure_route - Failure route block to be called. |
858 | 973 |
|
859 |
- Example 33. t_on_failure usage |
|
974 |
+ Example 39. t_on_failure usage |
|
860 | 975 |
... |
861 | 976 |
route { |
862 | 977 |
t_on_failure("1"); |
... | ... |
@@ -882,7 +997,7 @@ failure_route[1] { |
882 | 997 |
Meaning of the parameters is as follows: |
883 | 998 |
* onreply_route - Onreply route block to be called. |
884 | 999 |
|
885 |
- Example 34. t_on_reply usage |
|
1000 |
+ Example 40. t_on_reply usage |
|
886 | 1001 |
... |
887 | 1002 |
loadmodule "/usr/local/lib/ser/modules/nathelper.so" |
888 | 1003 |
... |
... | ... |
@@ -914,7 +1029,7 @@ es'); |
914 | 1029 |
Meaning of the parameters is as follows: |
915 | 1030 |
* branch_route - branch route block to be called. |
916 | 1031 |
|
917 |
- Example 35. t_on_branch usage |
|
1032 |
+ Example 41. t_on_branch usage |
|
918 | 1033 |
... |
919 | 1034 |
route { |
920 | 1035 |
t_on_branch("1"); |
... | ... |
@@ -932,7 +1047,7 @@ branch_route[1] { |
932 | 1047 |
Similarly to t_fork_to, it extends destination set by a new entry. The |
933 | 1048 |
difference is that current URI is taken as new entry. |
934 | 1049 |
|
935 |
- Example 36. append_branch usage |
|
1050 |
+ Example 42. append_branch usage |
|
936 | 1051 |
... |
937 | 1052 |
set_user("john"); |
938 | 1053 |
t_fork(); |
... | ... |
@@ -947,7 +1062,7 @@ t_relay(); |
947 | 1062 |
the only way a script can add a new transaction in an atomic way. |
948 | 1063 |
Typically, it is used to deploy a UAS. |
949 | 1064 |
|
950 |
- Example 37. t_newtran usage |
|
1065 |
+ Example 43. t_newtran usage |
|
951 | 1066 |
... |
952 | 1067 |
if (t_newtran()) { |
953 | 1068 |
log("UAS logic"); |
... | ... |
@@ -966,7 +1081,7 @@ if (t_newtran()) { |
966 | 1081 |
* code - Reply code number. |
967 | 1082 |
* reason_phrase - Reason string. |
968 | 1083 |
|
969 |
- Example 38. t_reply usage |
|
1084 |
+ Example 44. t_reply usage |
|
970 | 1085 |
... |
971 | 1086 |
t_reply("404", "Not found"); |
972 | 1087 |
... |
... | ... |
@@ -979,7 +1094,7 @@ t_reply("404", "Not found"); |
979 | 1094 |
none was found. However this is safely (atomically) done using |
980 | 1095 |
t_newtran. |
981 | 1096 |
|
982 |
- Example 39. t_lookup_request usage |
|
1097 |
+ Example 45. t_lookup_request usage |
|
983 | 1098 |
... |
984 | 1099 |
if (t_lookup_request()) { |
985 | 1100 |
... |
... | ... |
@@ -990,7 +1105,7 @@ if (t_lookup_request()) { |
990 | 1105 |
|
991 | 1106 |
Retransmits a reply sent previously by UAS transaction. |
992 | 1107 |
|
993 |
- Example 40. t_retransmit_reply usage |
|
1108 |
+ Example 46. t_retransmit_reply usage |
|
994 | 1109 |
... |
995 | 1110 |
t_retransmit_reply(); |
996 | 1111 |
... |
... | ... |
@@ -1000,7 +1115,7 @@ t_retransmit_reply(); |
1000 | 1115 |
Remove transaction from memory (it will be first put on a wait timer to |
1001 | 1116 |
absorb delayed messages). |
1002 | 1117 |
|
1003 |
- Example 41. t_release usage |
|
1118 |
+ Example 47. t_release usage |
|
1004 | 1119 |
... |
1005 | 1120 |
t_release(); |
1006 | 1121 |
... |
... | ... |
@@ -1015,7 +1130,7 @@ t_forward_nonack_tls(ip, port) t_forward_nonack_sctp(ip, port) |
1015 | 1130 |
* ip - IP address where the message should be sent. |
1016 | 1131 |
* port - Port number. |
1017 | 1132 |
|
1018 |
- Example 42. t_forward_nonack usage |
|
1133 |
+ Example 48. t_forward_nonack usage |
|
1019 | 1134 |
... |
1020 | 1135 |
t_forward_nonack("1.2.3.4", "5060"); |
1021 | 1136 |
... |
... | ... |
@@ -1038,7 +1153,7 @@ t_forward_nonack("1.2.3.4", "5060"); |
1038 | 1153 |
|
1039 | 1154 |
See also: fr_timer, fr_inv_timer, t_reset_fr(). |
1040 | 1155 |
|
1041 |
- Example 43. t_set_fr usage |
|
1156 |
+ Example 49. t_set_fr usage |
|
1042 | 1157 |
... |
1043 | 1158 |
route { |
1044 | 1159 |
t_set_fr(10000); # set only fr invite timeout to 10s |
... | ... |
@@ -1065,7 +1180,7 @@ branch_route[1] { |
1065 | 1180 |
|
1066 | 1181 |
See also: fr_timer, fr_inv_timer, t_set_fr. |
1067 | 1182 |
|
1068 |
- Example 44. t_reset_fr usage |
|
1183 |
+ Example 50. t_reset_fr usage |
|
1069 | 1184 |
... |
1070 | 1185 |
route { |
1071 | 1186 |
... |
... | ... |
@@ -1091,7 +1206,7 @@ route { |
1091 | 1206 |
|
1092 | 1207 |
See also: max_inv_lifetime, max_noninv_lifetime, t_reset_max_lifetime. |
1093 | 1208 |
|
1094 |
- Example 45. t_set_max_lifetime usage |
|
1209 |
+ Example 51. t_set_max_lifetime usage |
|
1095 | 1210 |
... |
1096 | 1211 |
route { |
1097 | 1212 |
if (src_ip=1.2.3.4) |
... | ... |
@@ -1113,7 +1228,7 @@ route { |
1113 | 1228 |
|
1114 | 1229 |
See also: max_inv_lifetime, max_noninv_lifetime, t_set_max_lifetime. |
1115 | 1230 |
|
1116 |
- Example 46. t_reset_max_lifetime usage |
|
1231 |
+ Example 52. t_reset_max_lifetime usage |
|
1117 | 1232 |
... |
1118 | 1233 |
route { |
1119 | 1234 |
... |
... | ... |
@@ -1151,7 +1266,7 @@ route { |
1151 | 1266 |
|
1152 | 1267 |
See also: retr_timer1, retr_timer2, t_reset_retr(). |
1153 | 1268 |
|
1154 |
- Example 47. t_set_retr usage |
|
1269 |
+ Example 53. t_set_retr usage |
|
1155 | 1270 |
... |
1156 | 1271 |
route { |
1157 | 1272 |
t_set_retr(250, 0); # set only T1 to 250 ms |
... | ... |
@@ -1178,7 +1293,7 @@ branch_route[1] { |
1178 | 1293 |
|
1179 | 1294 |
See also: retr_timer1, retr_timer2, t_set_retr. |
1180 | 1295 |
|
1181 |
- Example 48. t_reset_retr usage |
|
1296 |
+ Example 54. t_reset_retr usage |
|
1182 | 1297 |
... |
1183 | 1298 |
route { |
1184 | 1299 |
... |
... | ... |
@@ -1194,7 +1309,7 @@ route { |
1194 | 1309 |
|
1195 | 1310 |
See also: auto_inv_100. |
1196 | 1311 |
|
1197 |
- Example 49. t_set_auto_inv_100 usage |
|
1312 |
+ Example 55. t_set_auto_inv_100 usage |
|
1198 | 1313 |
... |
1199 | 1314 |
route { |
1200 | 1315 |
... |
... | ... |
@@ -1208,7 +1323,7 @@ route { |
1208 | 1323 |
Returns true if the failure route is executed for a branch that did |
1209 | 1324 |
timeout. It can be used only from the failure_route. |
1210 | 1325 |
|
1211 |
- Example 50. t_branch_timeout usage |
|
1326 |
+ Example 56. t_branch_timeout usage |
|
1212 | 1327 |
... |
1213 | 1328 |
failure_route[0]{ |
1214 | 1329 |
if (t_branch_timeout()){ |
... | ... |
@@ -1223,7 +1338,7 @@ failure_route[0]{ |
1223 | 1338 |
receive at least one reply in the past (the "current" reply is not |
1224 | 1339 |
taken into account). It can be used only from the failure_route. |
1225 | 1340 |
|
1226 |
- Example 51. t_branch_replied usage |
|
1341 |
+ Example 57. t_branch_replied usage |
|
1227 | 1342 |
... |
1228 | 1343 |
failure_route[0]{ |
1229 | 1344 |
if (t_branch_timeout()){ |
... | ... |
@@ -1240,7 +1355,7 @@ failure_route[0]{ |
1240 | 1355 |
Returns true if at least one of the current transactions branches did |
1241 | 1356 |
timeout. |
1242 | 1357 |
|
1243 |
- Example 52. t_any_timeout usage |
|
1358 |
+ Example 58. t_any_timeout usage |
|
1244 | 1359 |
... |
1245 | 1360 |
failure_route[0]{ |
1246 | 1361 |
if (!t_branch_timeout()){ |
... | ... |
@@ -1257,7 +1372,7 @@ failure_route[0]{ |
1257 | 1372 |
receive some reply in the past. If called from a failure or onreply |
1258 | 1373 |
route, the "current" reply is not taken into account. |
1259 | 1374 |
|
1260 |
- Example 53. t_any_replied usage |
|
1375 |
+ Example 59. t_any_replied usage |
|
1261 | 1376 |
... |
1262 | 1377 |
onreply_route[0]{ |
1263 | 1378 |
if (!t_any_replied()){ |
... | ... |
@@ -1271,7 +1386,7 @@ onreply_route[0]{ |
1271 | 1386 |
Returns true if "code" is the final reply received (or locally |
1272 | 1387 |
generated) in at least one of the current transactions branches. |
1273 | 1388 |
|
1274 |
- Example 54. t_grep_status usage |
|
1389 |
+ Example 60. t_grep_status usage |
|
1275 | 1390 |
... |
1276 | 1391 |
onreply_route[0]{ |
1277 | 1392 |
if (t_grep_status("486")){ |
... | ... |
@@ -1284,7 +1399,7 @@ onreply_route[0]{ |
1284 | 1399 |
|
1285 | 1400 |
Returns true if the current transaction was canceled. |
1286 | 1401 |
|
1287 |
- Example 55. t_is_canceled usage |
|
1402 |
+ Example 61. t_is_canceled usage |
|
1288 | 1403 |
... |
1289 | 1404 |
failure_route[0]{ |
1290 | 1405 |
if (t_is_canceled()){ |
... | ... |
@@ -1298,7 +1413,7 @@ failure_route[0]{ |
1298 | 1413 |
Returns true if the current transaction has already been expired, i.e. |
1299 | 1414 |
the max_inv_lifetime/max_noninv_lifetime interval has already elapsed. |
1300 | 1415 |
|
1301 |
- Example 56. t_is_expired usage |
|
1416 |
+ Example 62. t_is_expired usage |
|
1302 | 1417 |
... |
1303 | 1418 |
failure_route[0]{ |
1304 | 1419 |
if (t_is_expired()){ |
... | ... |
@@ -1319,7 +1434,7 @@ failure_route[0]{ |
1319 | 1434 |
CANCELs were successfully sent to the pending branches, true if the |
1320 | 1435 |
INVITE was not found, and false in case of any error. |
1321 | 1436 |
|
1322 |
- Example 57. t_relay_cancel usage |
|
1437 |
+ Example 63. t_relay_cancel usage |
|
1323 | 1438 |
if (method == CANCEL) { |
1324 | 1439 |
if (!t_relay_cancel()) { # implicit drop if relaying was successful, |
1325 | 1440 |
# nothing to do |
... | ... |
@@ -1346,7 +1461,7 @@ if (method == CANCEL) { |
1346 | 1461 |
overwritten with the flags of the INVITE. isflagset() can be used to |
1347 | 1462 |
check the flags of the previously forwarded INVITE in this case. |
1348 | 1463 |
|
1349 |
- Example 58. t_lookup_cancel usage |
|
1464 |
+ Example 64. t_lookup_cancel usage |
|
1350 | 1465 |
if (method == CANCEL) { |
1351 | 1466 |
if (t_lookup_cancel()) { |
1352 | 1467 |
log("INVITE transaction exists"); |
... | ... |
@@ -1371,7 +1486,7 @@ if (method == CANCEL) { |
1371 | 1486 |
branch is added to the transaction, or it is explicitly replied in the |
1372 | 1487 |
script! |
1373 | 1488 |
|
1374 |
- Example 59. t_drop_replies() usage |
|
1489 |
+ Example 65. t_drop_replies() usage |
|
1375 | 1490 |
... |
1376 | 1491 |
failure_route[0]{ |
1377 | 1492 |
if (t_check_status("5[0-9][0-9]")){ |
... | ... |
@@ -1402,7 +1517,7 @@ failure_route[0]{ |
1402 | 1517 |
The transaction must be created by t_newtran() before calling |
1403 | 1518 |
t_save_lumps(). |
1404 | 1519 |
|
1405 |
- Example 60. t_save_lumps() usage |
|
1520 |
+ Example 66. t_save_lumps() usage |
|
1406 | 1521 |
route { |
1407 | 1522 |
... |
1408 | 1523 |
t_newtran(); |
... | ... |
@@ -1438,7 +1553,7 @@ failure_route[1] { |
1438 | 1553 |
|
1439 | 1554 |
This function can be used from REQUEST_ROUTE. |
1440 | 1555 |
|
1441 |
- Example 61. t_load_contacts usage |
|
1556 |
+ Example 67. t_load_contacts usage |
|
1442 | 1557 |
... |
1443 | 1558 |
if (!t_load_contacts()) { |
1444 | 1559 |
sl_send_reply("500", "Server Internal Error - Cannot load contacts"); |
... | ... |
@@ -1463,7 +1578,7 @@ if (!t_load_contacts()) { |
1463 | 1578 |
|
1464 | 1579 |
This function can be used from REQUEST_ROUTE and FAILURE_ROUTE. |
1465 | 1580 |
|
1466 |
- Example 62. t_next_contacts usage |
|
1581 |
+ Example 68. t_next_contacts usage |
|
1467 | 1582 |
... |
1468 | 1583 |
# First call after t_load_contacts() when transaction does not exist yet |
1469 | 1584 |
# and contacts should be available |
... | ... |
@@ -1527,11 +1642,45 @@ Note |
1527 | 1642 |
|
1528 | 1643 |
See also: t_lookup_request(), t_lookup_cancel(). |
1529 | 1644 |
|
1530 |
- Example 63. t_check_trans usage |
|
1645 |
+ Example 69. t_check_trans usage |
|
1531 | 1646 |
if ( method == "CANCEL" && !t_check_trans()) |
1532 | 1647 |
sl_reply("403", "cancel out of the blue forbidden"); |
1533 | 1648 |
# note: in this example t_check_trans() can be replaced by t_lookup_cancel() |
1534 | 1649 |
|
1650 |
+1.4.34. t_set_disable_6xx(0|1) |
|
1651 |
+ |
|
1652 |
+ Turn off/on 6xx replies special rfc conformant handling on a per |
|
1653 |
+ transaction basis. If turned off (t_set_disable_6xx("1")) 6XXs will be |
|
1654 |
+ treated like normal replies. |
|
1655 |
+ |
|
1656 |
+ It overrides the disable_6xx_block value for the current transaction. |
|
1657 |
+ |
|
1658 |
+ See also: disable_6xx_block. |
|
1659 |
+ |
|
1660 |
+ Example 70. t_set_disable_6xx usage |
|
1661 |
+... |
|
1662 |
+route { |
|
1663 |
+... |
|
1664 |
+ if (src_ip==1.2.3.4) # bad user agent that sends 603 |
|
1665 |
+ t_set_disable_6xx(1); # turn off 6xx special handling |
|
1666 |
+... |
|
1667 |
+} |
|
1668 |
+ |
|
1669 |
+1.4.35. t_set_disable_failover(0|1) |
|
1670 |
+ |
|
1671 |
+ Turn off/on dns failover on a per transaction basis. |
|
1672 |
+ |
|
1673 |
+ See also: use_dns_failover. |
|
1674 |
+ |
|
1675 |
+ Example 71. t_set_disable_failover usage |
|
1676 |
+... |
|
1677 |
+route { |
|
1678 |
+... |
|
1679 |
+ if (uri=~"@foo.bar$") |
|
1680 |
+ t_set_disable_failover(1); # turn off dns failover |
|
1681 |
+... |
|
1682 |
+} |
|
1683 |
+ |
|
1535 | 1684 |
1.5. TM Module API |
1536 | 1685 |
|
1537 | 1686 |
Revision History |
... | ... |
@@ -138,7 +138,7 @@ cfg_def_t tm_cfg_def[] = { |
138 | 138 |
"restart final response timer on each provisional reply"}, |
139 | 139 |
{"pass_provisional_replies", CFG_VAR_INT | CFG_ATOMIC, 0, 1, 0, 0, |
140 | 140 |
"enable/disable passing of provisional replies " |
141 |
- "to FIFO applications"}, |
|
141 |
+ "to TMCB_LOCAL_RESPONSE_OUT callbacks"}, |
|
142 | 142 |
{"aggregate_challenges", CFG_VAR_INT /* not atomic */, 0, 1, 0, 0, |
143 | 143 |
"if the final response is a 401 or a 407, aggregate all the " |
144 | 144 |
"authorization headers (challenges) " |
... | ... |
@@ -1179,4 +1179,59 @@ if ( method == "CANCEL" && !t_check_trans()) |
1179 | 1179 |
</example> |
1180 | 1180 |
</section> |
1181 | 1181 |
|
1182 |
+ <section id="t_set_disable_6xx"> |
|
1183 |
+ <title> |
|
1184 |
+ <function>t_set_disable_6xx(0|1)</function> |
|
1185 |
+ </title> |
|
1186 |
+ <para> |
|
1187 |
+ Turn off/on 6xx replies special rfc conformant handling on a per |
|
1188 |
+ transaction basis. If turned off |
|
1189 |
+ (<function>t_set_disable_6xx("1")</function>) 6XXs will be treated |
|
1190 |
+ like normal replies. |
|
1191 |
+ </para> |
|
1192 |
+ <para> |
|
1193 |
+ It overrides the <varname>disable_6xx_block</varname> value for |
|
1194 |
+ the current transaction. |
|
1195 |
+ </para> |
|
1196 |
+ <para> |
|
1197 |
+ See also: <varname>disable_6xx_block</varname>. |
|
1198 |
+ </para> |
|
1199 |
+ <example> |
|
1200 |
+ <title><function>t_set_disable_6xx</function> usage</title> |
|
1201 |
+ <programlisting> |
|
1202 |
+... |
|
1203 |
+route { |
|
1204 |
+... |
|
1205 |
+ if (src_ip==1.2.3.4) # bad user agent that sends 603 |
|
1206 |
+ t_set_disable_6xx(1); # turn off 6xx special handling |
|
1207 |
+... |
|
1208 |
+} |
|
1209 |
+ </programlisting> |
|
1210 |
+ </example> |
|
1211 |
+ </section> |
|
1212 |
+ |
|
1213 |
+ <section id="t_set_disable_failover"> |
|
1214 |
+ <title> |
|
1215 |
+ <function>t_set_disable_failover(0|1)</function> |
|
1216 |
+ </title> |
|
1217 |
+ <para> |
|
1218 |
+ Turn off/on dns failover on a per transaction basis. |
|
1219 |
+ </para> |
|
1220 |
+ <para> |
|
1221 |
+ See also: <varname>use_dns_failover</varname>. |
|
1222 |
+ </para> |
|
1223 |
+ <example> |
|
1224 |
+ <title><function>t_set_disable_failover</function> usage</title> |
|
1225 |
+ <programlisting> |
|
1226 |
+... |
|
1227 |
+route { |
|
1228 |
+... |
|
1229 |
+ if (uri=~"@foo.bar$") |
|
1230 |
+ t_set_disable_failover(1); # turn off dns failover |
|
1231 |
+... |
|
1232 |
+} |
|
1233 |
+ </programlisting> |
|
1234 |
+ </example> |
|
1235 |
+ </section> |
|
1236 |
+ |
|
1182 | 1237 |
</section> |
... | ... |
@@ -904,4 +904,180 @@ modparam("tm", "unmatched_cancel", "2") |
904 | 904 |
</programlisting> |
905 | 905 |
</example> |
906 | 906 |
</section> |
907 |
+ |
|
908 |
+ <section id="ruri_matching"> |
|
909 |
+ <title><varname>ruri_matching</varname> (integer)</title> |
|
910 |
+ <para> |
|
911 |
+ If set it will also try to match the request uri when doing |
|
912 |
+ pre-3261 transaction matching (the via branch parameter does |
|
913 |
+ not contain the 3261 cookie). |
|
914 |
+ </para> |
|
915 |
+ <para> |
|
916 |
+ The only reason to have it not set is for interoperability with old, |
|
917 |
+ broken implementations. |
|
918 |
+ </para> |
|
919 |
+ <para> |
|
920 |
+ Default value is 1 (on). |
|
921 |
+ </para> |
|
922 |
+ <para> |
|
923 |
+ Can be set at runtime, e.g.: |
|
924 |
+ <programlisting> |
|
925 |
+ $ sercmd cfg.set_now_int tm ruri_matching 0 |
|
926 |
+ </programlisting> |
|
927 |
+ </para> |
|
928 |
+ <example> |
|
929 |
+ <title>Set <varname>ruri_matching</varname> parameter</title> |
|
930 |
+ <programlisting> |
|
931 |
+... |
|
932 |
+modparam("tm", "ruri_matching", 1) |
|
933 |
+... |
|
934 |
+ </programlisting> |
|
935 |
+ </example> |
|
936 |
+ </section> |
|
937 |
+ |
|
938 |
+ <section id="via1_matching"> |
|
939 |
+ <title><varname>via1_matching</varname> (integer)</title> |
|
940 |
+ <para> |
|
941 |
+ If set it will also try to match the topmost via when doing |
|
942 |
+ pre-3261 transaction matching (the via branch parameter does |
|
943 |
+ not contain the 3261 cookie). |
|
944 |
+ </para> |
|
945 |
+ <para> |
|
946 |
+ The only reason to have it not set is for interoperability with old, |
|
947 |
+ broken implementations. |
|
948 |
+ </para> |
|
949 |
+ <para> |
|
950 |
+ Default value is 1 (on). |
|
951 |
+ </para> |
|
952 |
+ <para> |
|
953 |
+ Can be set at runtime, e.g.: |
|
954 |
+ <programlisting> |
|
955 |
+ $ sercmd cfg.set_now_int tm via1_matching 0 |
|
956 |
+ </programlisting> |
|
957 |
+ </para> |
|
958 |
+ <example> |
|
959 |
+ <title>Set <varname>via1_matching</varname> parameter</title> |
|
960 |
+ <programlisting> |
|
961 |
+... |
|
962 |
+modparam("tm", "via1_matching", 1) |
|
963 |
+... |
|
964 |
+ </programlisting> |
|
965 |
+ </example> |
|
966 |
+ </section> |
|
967 |
+ |
|
968 |
+ <section id="pass_provisional_replies"> |
|
969 |
+ <title><varname>pass_provisional_replies</varname> (integer)</title> |
|
970 |
+ <para> |
|
971 |
+ If set, TMCB_LOCAL_REPONSE_OUT tm registered callbacks will be called |
|
972 |
+ also for provisional replies. |
|
973 |
+ </para> |
|
974 |
+ <para> |
|
975 |
+ Default value is 0 (off). |
|
976 |
+ </para> |
|
977 |
+ <para> |
|
978 |
+ Can be set at runtime, e.g.: |
|
979 |
+ <programlisting> |
|
980 |
+ $ sercmd cfg.set_now_int tm pass_provisional_replies 1 |
|
981 |
+ </programlisting> |
|
982 |
+ </para> |
|
983 |
+ <example> |
|
984 |
+ <title>Set <varname>pass_provisional_replies</varname> parameter |
|
985 |
+ </title> |
|
986 |
+ <programlisting> |
|
987 |
+... |
|
988 |
+modparam("tm", "pass_provisional_replies", 1) |
|
989 |
+... |
|
990 |
+ </programlisting> |
|
991 |
+ </example> |
|
992 |
+ </section> |
|
993 |
+ |
|
994 |
+ <section id="default_code"> |
|
995 |
+ <title><varname>default_code</varname> (integer)</title> |
|
996 |
+ <para> |
|
997 |
+ Default response code sent by <function>t_reply()</function> if it |
|
998 |
+ cannot retrieve its parameters (e.g. inexistent avp). |
|
999 |
+ Valid values are between 400 and 699. |
|
1000 |
+ </para> |
|
1001 |
+ <para> |
|
1002 |
+ Default value is 500. |
|
1003 |
+ </para> |
|
1004 |
+ <para> |
|
1005 |
+ Can be set at runtime, e.g.: |
|
1006 |
+ <programlisting> |
|
1007 |
+ $ sercmd cfg.set_now_int tm default_code 505 |
|
1008 |
+ </programlisting> |
|
1009 |
+ </para> |
|
1010 |
+ <example> |
|
1011 |
+ <title>Set <varname>default_code</varname> parameter </title> |
|
1012 |
+ <programlisting> |
|
1013 |
+... |
|
1014 |
+modparam("tm", "default_code", 501) |
|
1015 |
+... |
|
1016 |
+ </programlisting> |
|
1017 |
+ </example> |
|
1018 |
+ </section> |
|
1019 |
+ |
|
1020 |
+ <section id="default_reason"> |
|
1021 |
+ <title><varname>default_reason</varname> (string)</title> |
|
1022 |
+ <para> |
|
1023 |
+ Default SIP reason phrase sent by <function>t_reply()</function> if it |
|
1024 |
+ cannot retrieve its parameters (e.g. inexistent avp). |
|
1025 |
+ </para> |
|
1026 |
+ <para> |
|
1027 |
+ Default value is "Server Internal Error". |
|
1028 |
+ </para> |
|
1029 |
+ <para> |
|
1030 |
+ Can be set at runtime, e.g.: |
|
1031 |
+ <programlisting> |
|
1032 |
+ $ sercmd cfg.set_now_string tm default_reason "Unknown error" |
|
1033 |
+ </programlisting> |
|
1034 |
+ </para> |
|
1035 |
+ <example> |
|
1036 |
+ <title>Set <varname>default_reason</varname> parameter </title> |
|
1037 |
+ <programlisting> |
|
1038 |
+... |
|
1039 |
+modparam("tm", "default_reason", "Unknown reason") |
|
1040 |
+... |
|
1041 |
+ </programlisting> |
|
1042 |
+ </example> |
|
1043 |
+ </section> |
|
1044 |
+ |
|
1045 |
+ <section id="disable_6xx_block"> |
|
1046 |
+ <title><varname>disable_6xx_block</varname> (integer)</title> |
|
1047 |
+ <para> |
|
1048 |
+ If set tm will treat all the 6xx replies like normal replies |
|
1049 |
+ (warning: this would be non-rfc conformant behaviour). |
|
1050 |
+ </para> |
|
1051 |
+ <para> |
|
1052 |
+ If not set (default) receiving a 6xx will cancel all the running |
|
1053 |
+ parallel branches, will stop dns failover and forking. However |
|
1054 |
+ serial forking using <function>append_branch()</function> in the |
|
1055 |
+ <function>failure_route</function> will still work. |
|
1056 |
+ </para> |
|
1057 |
+ <para> |
|
1058 |
+ It can be overwritten on a per transaction basis using |
|
1059 |
+ <function>t_set_disable_6xx()</function>. |
|
1060 |
+ </para> |
|
1061 |
+ <para> |
|
1062 |
+ Default value is 0 (off, rfc conformant behaviour). |
|
1063 |
+ </para> |
|
1064 |
+ <para> |
|
1065 |
+ Can be set at runtime, e.g.: |
|
1066 |
+ <programlisting> |
|
1067 |
+ $ sercmd cfg.set_now_int tm disable_6xx_block 0 |
|
1068 |
+ </programlisting> |
|
1069 |
+ </para> |
|
1070 |
+ <para> |
|
1071 |
+ See also: <function>t_set_disable_6xx()</function>. |
|
1072 |
+ </para> |
|
1073 |
+ <example> |
|
1074 |
+ <title>Set <varname>disable_6xx_block</varname> parameter</title> |
|
1075 |
+ <programlisting> |
|
1076 |
+... |
|
1077 |
+modparam("tm", "disable_6xx_block", 1) |
|
1078 |
+... |
|
1079 |
+ </programlisting> |
|
1080 |
+ </example> |
|
1081 |
+ </section> |
|
1082 |
+ |
|
907 | 1083 |
</section> |