d08711c79b464ca577a3b41c5c2eadec791c0e13
[sip-router] / test / tx.cfg
1 #
2 # configuration for TurboSIP testing
3 #
4 # $ID: $
5 #
6
7 debug=1          # debug level (cmd line: -dddddddddd)
8 check_via=yes     # (cmd. line: -v)
9 dns=on           # (cmd. line: -r)
10 rev_dns=yes      # (cmd. line: -R)
11 #fork=yes          # (cmd. line: -D)
12 fork=no
13 children=16
14 log_stderror=yes # (cmd line: -E)
15 log_stderror=no # (cmd line: -E)
16 port=5080
17 #listen=127.0.0.1
18 listen=192.168.99.100
19 loop_checks=1
20 # for more info: sip_router -h
21
22 #modules
23 loadmodule "modules/print/print.so"
24 #loadmodule "modules/tm/tm.so"
25
26 route{
27         if ( t_lookup_request()) {
28                 if ( method=="ACK" )    {
29                         log("SER: ACK received -> t_release\n");
30                         if (! t_forward("bat.iptel.org", "5090" )) {
31                                 log("SER: WARNING: bad forward\n");
32                         };
33                         if (! t_release()) {
34                                 log("SER: WARNING: bad t_release\n");
35                         };
36                 } else {
37                         if (! t_retransmit_reply()) {
38                                 log("SER: WARNING: bad t_retransmit_reply\n");
39                         };
40                         log("SER: yet another annoying retranmission\n");
41                 };
42                 t_unref();
43         } else {
44                 if (method=="ACK") {
45                         # no established transaction ... forward ACK just statelessly
46                         forward("bat.iptel.org", 5090);
47                 } else {
48                         # establish transaction
49                         if (! t_add_transaction()){
50                                 log("ERROR in ser: t_add_transaction\n");
51                         };
52                         # reply
53                         if (method=="CANCEL") {
54                                 log("SER: new CANCEL\n");
55                                 if (! t_send_reply( "200", "glad to cancel")){
56                                         log("SER:ERROR: t_send_reply\n");
57                                 };
58                         } else {
59                                 log("SER: new transaction\n");
60                                 if (! t_send_reply("100", "trying -- your call is important to us")
61                                         ){
62                                         log("SER: ERROR: t_send_reply (100)\n");
63                                 };
64                         };
65                         if (! t_forward("bat.iptel.org", "5090")){
66                                 log("SER:ERROR: t_forward (..., 5555)\n");
67                         };
68                         t_unref();
69                 };
70         };
71 }