fabc6dea6afad658b7d15e4da8838ee99bbfd7b6
[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 fork=yes          # (cmd. line: -D)
9 #fork=no
10 log_stderror=yes # (cmd line: -E)
11 #log_stderror=no        # (cmd line: -E)
12
13
14 children=4
15 check_via=yes     # (cmd. line: -v)
16 dns=on           # (cmd. line: -r)
17 rev_dns=yes      # (cmd. line: -R)
18 port=5080
19 #listen=127.0.0.1
20 listen=192.168.99.100
21 loop_checks=1
22 # for more info: sip_router -h
23
24 #modules
25 loadmodule "modules/print/print.so"
26 #loadmodule "modules/tm/tm.so"
27
28 route[0]{
29                         forward("bat.iptel.org", 5090);
30                         break;
31 }
32
33 route[1]{
34         log("SER: new request reveived\n");
35         if ( t_lookup_request()) {
36                 if ( method=="ACK" )    {
37                         log("SER: ACK for an existing transaction received\n");
38                         if (! t_forward("bat.iptel.org", "5090" )) {
39                                 log("SER: WARNING: bad forward\n");
40                         } else log("SER: t_forward ok\n");
41                         if (! t_release()) {
42                                 log("SER: WARNING: bad t_release\n");
43                         } else log("SER: t_release ok\n");
44                 } else {
45                         if (method=="INVITE" ) { log("SER: it's an INVITE retranmission\n"); }
46                         else if (method=="BYE") log( "SER: it's a BYE retransmission\n")
47                         else log("SER: it's a retransmission (neither INVITE nor BYE\n");
48                         if (! t_retransmit_reply()) {
49                                 log("SER: WARNING: bad t_retransmit_reply\n");
50                         } else log("SER: t_retransmit ok\n");
51                 };
52                 t_unref();
53         } else {
54                 log("SER: transaction not found\n");
55                 if (method=="ACK") {
56                         # no established transaction ... forward ACK just statelessly
57                         log("SER: ACK received\n");
58                         forward("bat.iptel.org", 5090);
59                 } else {
60                         # establish transaction
61                         log("SER: adding new transaction\n");
62                         if (method=="INVITE" ) { log("SER: it's a new INVITE \n"); }
63                         else if (method=="BYE") log( "SER: it's a new BYE \n")
64                         else log("SER: it is a new transaction (neither INVITE nor BYE)\n");
65                         if (! t_add_transaction()){
66                                 log("SER t_add_transaction failed\n");
67                         } else log("SER: t_add_Transactio ok\n");
68                         # reply
69                         if (method=="CANCEL") {
70                                 log("SER: new CANCEL\n");
71                                 if (! t_send_reply( "200", "glad to cancel")){
72                                         log("SER:ERROR: t_send_reply\n");
73                                 };
74                         } else {
75                                 log("SER: replying\n");
76                                 if (! t_send_reply("100", "trying -- your call is important to us")
77                                         ){
78                                         log("SER: ERROR: t_send_reply (100)\n");
79                                 } else log("SER: t_send_reply ok\n");
80                         };
81                         if (! t_forward("bat.iptel.org", "5090")){
82                                 log("SER:ERROR: t_forward (..., 5555)\n");
83                         } else log("SER: t_forward ok\n");
84                         t_unref();
85                 };
86         };
87 }