1# 2# iptel.org real world configuration 3# 4# $Id$ 5# 6 7# ----------- global configuration parameters ------------ 8 9debug=4 # debug level (cmd line: -dddddddddd) 10#fork=yes 11fork=no 12#log_stderror=no # (cmd line: -E) 13log_stderror=yes # (cmd line: -E) 14check_via=yes # (cmd. line: -v) 15dns=on # (cmd. line: -r) 16rev_dns=yes # (cmd. line: -R) 17port=5060 18children=1 19 20# advertise IP address in Via (as opposed to advertising DNS name 21# which is annoying for downstream servers and some phones can 22# not handle DNS at all) 23listen=195.37.77.100 24 25# ------------------ module loading ---------------- 26 27loadmodule "../sip_router/modules/print/print.so" 28#loadmodule "../sip_router/modules/tm/tm.so" 29loadmodule "../sip_router/modules/sl/sl.so" 30loadmodule "../sip_router/modules/maxfwd/maxfwd.so" 31 32# ----------------- setting module-specific parameters ------- 33 34# -- tm params -- 35modparam("tm", "fr_timer", 10 ) 36modparam("tm", "fr_inv_timer", 10 ) 37modparam("tm", "wt_timer", 10 ) 38 39 40route{ 41 # filter local stateless ACK generated by authentication of mf replies 42 sl_filter_ACK(); 43 44 if (len_gt( max_len )) { 45# if (len_gt( 100 )) { 46 sl_send_reply("513", "Riesengross -- Message too large"); 47 log("XXX Riessengross: dropped\n"); 48 break; 49 }; 50 51 52 # filter too old messages 53# log("LOG: Checking maxfwd\n"); 54# if (!mf_process_maxfwd_header("0")) { 55# log("LOG: Too many hops\n"); 56# sl_send_reply("483","Too Many Hops"); 57# break; 58# }; 59 60 # UAS script implementation 61 62 # if that is not a new transaction... (t_newtran is a new 63 # function which atomicaly adds a transaction if there is 64 # none) 65 if (! t_newtran()) { 66 # retransmit whatever we have 67 t_retransmit_reply(); 68 } else { 69 # do what you want to do 70 # if (send_sms()) { 71 # this is just a thing which stands for sth real 72 if (len_gt( max_len )) { 73 # things went well, send ok upstream 74 if (!t_send_reply("200", "yes sir, SMS sent over")) { 75 # if replying failed, retry statelessly 76 sl_reply_error(); 77 }; 78 } else { 79 if (!t_send_reply("500", "SMS error :-(")) { 80 # if replying failed, retry statelessly 81 sl_reply_error(); 82 }; 83 }; 84 # transaction conclude it -- junk it now (it will 85 # stay there until WAIT timer hits) 86 t_release(); 87 }; 88 t_unref(); 89} 90 91