bidirectional
[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 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=195.37.77.101
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 #       if (method=="BYE") { forward("bat.iptel.org", 5000); }
30 #       else forward("bat.iptel.org", 5090);
31 #       break;
32 #}
33
34 route[0]{
35         log("SER: new request reveived\n");
36         if ( t_lookup_request()) {
37                 if ( method=="ACK" )    {
38                         log("SER: ACK for an existing transaction received\n");
39                         if (! t_forward("bat.iptel.org", "5090" )) {
40                                 log("SER: WARNING: bad forward\n");
41                         } else log("SER: t_forward ok\n");
42                         if (! t_release()) {
43                                 log("SER: WARNING: bad t_release\n");
44                         } else log("SER: t_release ok\n");
45                 } else {
46                         if (method=="INVITE" ) { log("SER: it's an INVITE retranmission\n"); }
47                         else if (method=="BYE") log( "SER: it's a BYE retransmission\n")
48                         else log("SER: it's a retransmission (neither INVITE nor BYE\n");
49                         if (! t_retransmit_reply()) {
50                                 log("SER: WARNING: bad t_retransmit_reply\n");
51                         } else log("SER: t_retransmit ok\n");
52                 };
53                 t_unref();
54         } else {
55                 log("SER: transaction not found\n");
56                 if (method=="ACK") {
57                         # no established transaction ... forward ACK just statelessly
58                         log("SER: ACK received\n");
59                         forward("bat.iptel.org", 5090);
60                 } else {
61                         # establish transaction
62                         log("SER: adding new transaction\n");
63                         if (method=="INVITE" ) { log("SER: it's a new INVITE \n"); }
64                         else if (method=="BYE") log( "SER: it's a new BYE \n")
65                         else log("SER: it is a new transaction (neither INVITE nor BYE)\n");
66                         if (! t_add_transaction()){
67                                 log("SER t_add_transaction failed\n");
68                         } else log("SER: t_add_Transactio ok\n");
69                         # reply
70                         if (method=="CANCEL") {
71                                 log("SER: new CANCEL\n");
72                                 if (! t_send_reply( "200", "glad to cancel")){
73                                         log("SER:ERROR: t_send_reply\n");
74                                 };
75                         } else {
76                                 log("SER: replying\n");
77                                 if (! t_send_reply("100", "trying -- your call is important to us")
78                                         ){
79                                         log("SER: ERROR: t_send_reply (100)\n");
80                                 } else log("SER: t_send_reply ok\n");
81                         };
82                         if (method=="INVITE") {
83                                 if (! t_forward("bat.iptel.org", "5090")){
84                                         log("SER:ERROR: t_forward (..., 5555)\n");
85                                 } else log("SER: t_forward ok\n");
86                         } else if (method=="BYE") {
87                                 if (! t_forward("bat.iptel.org", "5090")){
88                                         log("SER:ERROR: t_forward (..., 5555)\n");
89                                 } else log("SER: t_forward ok\n");
90                         } else log("SER: ERROR unknwon request\n");
91                         t_unref();
92                 };
93         };
94 }