# # $Id$ # # iptel's voicemail config script # # ----------- global configuration parameters ------------------------ debug=7 # debug level (cmd line: -dddddddddd) fork=no log_stderror=yes # (cmd line: -E) check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) port=5060 children=4 fifo="/tmp/ser_fifo" # ------------------ module loading ---------------------------------- loadmodule "modules/sl/sl.so" loadmodule "modules/tm/tm.so" loadmodule "modules/maxfwd/maxfwd.so" loadmodule "modules/rr/rr.so" loadmodule "modules/textops/textops.so" loadmodule "modules/vm/vm.so" loadmodule "modules/dbtext/dbtext.so" # ----------------- setting module-specific parameters --------------- modparam("voicemail", "db_url","/home/rco/cvs/ser/sip_router/modules/vm/db") # ------------------------- 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 == myself) { # Voicemail specific configuration - begin if(method=="ACK" || method=="INVITE" || method=="BYE" || method=="REFER"){ if(t_newtran()){ t_reply("100","Trying -- just wait a minute !"); if(method=="INVITE" || method=="REFER"){ log("**************** vm start - begin ******************\n"); if( uri =~ "conference" ){ if(!vm("/tmp/am_fifo","conference")){ log("could not contact conference server\n"); t_reply("500","could not contact conference server"); }; } else if( uri =~ "echo" ){ if(!vm("/tmp/am_fifo","echo")){ log("could not contact echo\n"); t_reply("500","could not contact echo"); }; } else { if(!vm("/tmp/am_fifo","voicemail")){ log("could not contact voicemail\n"); t_reply("500","could not contact voicemail"); }; }; log("**************** vm start - end ******************\n"); break; }; if(method=="BYE"){ log("**************** vm end/refer - begin ******************\n"); if(!vm("/tmp/am_fifo","bye")){ log("could not contact the media server\n"); t_reply("500","could not contact the media server"); }; log("**************** vm end/refer - end ********************\n"); break; }; } else { log("could not create new transaction\n"); sl_send_reply("500","could not create new transaction"); }; }; # Voicemail specific configuration - end } else { if (!t_relay()) { sl_reply_error(); }; }; }