performance and bug fixes
[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 children=16
13 #log_stderror=yes # (cmd line: -E)
14 log_stderror=no # (cmd line: -E)
15 port=5080
16 #listen=127.0.0.1
17 listen=192.168.99.100
18 loop_checks=1
19 # for more info: sip_router -h
20
21 #modules
22 loadmodule "modules/print/print.so"
23 #loadmodule "modules/tm/tm.so"
24
25 route{
26         if ( t_lookup_request()) {
27                 if ( method=="ACK" )    {
28                         log("SER: ACK received -> t_release\n");
29                         if (! t_forward("bat.iptel.org", "5090" )) {
30                                 log("SER: WARNING: bad forward\n");
31                         };
32                         if (! t_release()) {
33                                 log("SER: WARNING: bad t_release\n");
34                         };
35                 } else {
36                         if (! t_retransmit_reply()) {
37                                 log("SER: WARNING: bad t_retransmit_reply\n");
38                         };
39                         log("SER: yet another annoying retranmission\n");
40                 };
41                 t_unref();
42         } else {
43                 if (method=="ACK") {
44                         # no established transaction ... forward ACK just statelessly
45                         forward("bat.iptel.org", 5090);
46                 } else {
47                         # establish transaction
48                         if (! t_add_transaction()){
49                                 log("ERROR in ser: t_add_transaction\n");
50                         };
51                         # reply
52                         if (method=="CANCEL") {
53                                 log("SER: new CANCEL\n");
54                                 if (! t_send_reply( "200", "glad to cancel")){
55                                         log("SER:ERROR: t_send_reply\n");
56                                 };
57                         } else {
58                                 log("SER: new transaction\n");
59                                 if (! t_send_reply("100", "trying -- your call is important to us")
60                                         ){
61                                         log("SER: ERROR: t_send_reply (100)\n");
62                                 };
63                         };
64                         if (! t_forward("bat.iptel.org", "5090")){
65                                 log("SER:ERROR: t_forward (..., 5555)\n");
66                         };
67                         t_unref();
68                 };
69         };
70 }