change to return value convention
[sip-router] / test / tx.cfg
1 #
2 # configuration for TurboSIP testing
3 #
4 # $ID: $
5 #
6
7 debug=9          # 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                 log("SER: transaction found\n");
29                 if ( method=="ACK" )    {
30                         log("SER: ACK received -> t_release\n");
31                         if (! t_forward("bat.iptel.org", "5090" )) {
32                                 log("SER: WARNING: bad forward\n");
33                         };
34                         if (! t_release()) {
35                                 log("SER: WARNING: bad t_release\n");
36                         };
37                 } else {
38                         if (! t_retransmit_reply()) {
39                                 log("SER: WARNING: bad t_retransmit_reply\n");
40                         };
41                         log("SER: yet another annoying retranmission\n");
42                 };
43                 t_unref();
44         } else {
45                 log("SER: transaction not found\n");
46                 if (method=="ACK") {
47                         # no established transaction ... forward ACK just statelessly
48                         forward("bat.iptel.org", 5090);
49                 } else {
50                         # establish transaction
51                         if (! t_add_transaction()){
52                                 log("ERROR in ser: t_add_transaction\n");
53                         };
54                         # reply
55                         if (method=="CANCEL") {
56                                 log("SER: new CANCEL\n");
57                                 if (! t_send_reply( "200", "glad to cancel")){
58                                         log("SER:ERROR: t_send_reply\n");
59                                 };
60                         } else {
61                                 log("SER: new transaction\n");
62                                 if (! t_send_reply("100", "trying -- your call is important to us")
63                                         ){
64                                         log("SER: ERROR: t_send_reply (100)\n");
65                                 };
66                         };
67                         if (! t_forward("bat.iptel.org", "5090")){
68                                 log("SER:ERROR: t_forward (..., 5555)\n");
69                         };
70                         t_unref();
71                 };
72         };
73 }