# # $Id: ser.cfg,v 1.10 2003/04/27 12:10:14 rco Exp $ # # iptel's voicemail config script # # ----------- global configuration parameters ------------------------ #debug=7 # debug level (cmd line: -dddddddddd) #fork=no #log_stderror=yes # (cmd line: -E) debug=3 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=no # (cmd line: -E) check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) port=5090 children=4 fifo="/tmp/vm_ser_fifo" # ------------------ module loading ---------------------------------- loadmodule "/usr/local/lib/ser/modules/dbtext/dbtext.so" loadmodule "/usr/local/lib/ser/modules/sl/sl.so" loadmodule "/usr/local/lib/ser/modules/tm/tm.so" loadmodule "/usr/local/lib/ser/modules/maxfwd/maxfwd.so" loadmodule "/usr/local/lib/ser/modules/mysql/mysql.so" loadmodule "/usr/local/lib/ser/modules/rr/rr.so" loadmodule "/usr/local/lib/ser/modules/textops/textops.so" loadmodule "/usr/local/lib/ser/modules/vm/vm.so" # ----------------- setting module-specific parameters --------------- modparam("voicemail", "db_url","sql://ser:heslo@dbhost/ser") # ------------------------- request routing logic ------------------- # main routing logic route{ # initial sanity checks -- messages with # max_forwars==0, or excessively long requests if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); break; }; if (len_gt( max_len )) { sl_send_reply("513", "Message too big"); break; }; # we record-route all messages -- to make sure that # subsequent messages will go through our proxy; that's # particularly good if upstream and downstream entities # use different transport protocol record_route(); # loose-route processing loose_route(); # Make MSN Messenger happy... if (method=="REGISTER") { sl_send_reply("200","ok"); break; }; if (uri =~ "HOSTNAME.OF.YOUR.SERVER.HERE") { # Voicemail specific configuration - begin if(method=="ACK" || method=="INVITE" || method=="BYE"){ if(t_newtran()){ t_reply("100","Trying -- just wait a minute !"); if(method=="INVITE"){ log("**************** vm start - begin ******************\n"); if(!vm("/tmp/am_fifo","voicemail")){ log("could not contact the answer machine\n"); t_reply("500","could not contact the answer machine"); }; log("**************** vm start - end ******************\n"); break; }; if(method=="BYE"){ log("**************** vm end - begin ******************\n"); if(!vm("/tmp/am_fifo","bye")){ log("could not contact the answer machine\n"); t_reply("500","could not contact the answer machine"); }; log("**************** vm end - end ******************\n"); break; }; } else { log("could not create new transaction\n"); sl_send_reply("500","could not create new transaction"); }; }; # Voicemail specific configuration - end }; }