# # $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $ # # ser for sems configuration # ----------- global configuration parameters ------------------------ debug=3 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=yes # (cmd line: -E) check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) port=5070 children=4 unix_sock="/tmp/ser_sock" # ------------------ module loading ---------------------------------- loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/rr.so" loadmodule "/usr/local/lib/ser/modules/maxfwd.so" loadmodule "/usr/local/lib/ser/modules/textops.so" loadmodule "/usr/local/lib/ser/modules/avp.so" loadmodule "/usr/local/lib/ser/modules/avpops.so" # ----------------- setting module-specific parameters --------------- # add value to ;lr param to make some broken UAs happy modparam("rr", "enable_full_lr", 1) modparam( "avpops", "avp_aliases", "email=i:67" ) modparam("tm", "pass_provisional_replies", 1) # appends for INVITE to voicemail modparam("tm", "tw_append", "voicemail_headers:hdr[User-Agent];P-Email-Address=avp[$email]") # appends for dtmf per INFO modparam( "tm", "tw_append", "info_append:hdr[Content-Length];hdr[Content-Type];msg[body]") # main routing logic route{ # initial sanity checks -- messages with # max_forwards==0, or excessively long requests if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); break; }; if (msg:len >= 2048 ) { sl_send_reply("513", "Message too big"); break; }; if (method != "ACK" && method != "INVITE" && method != "BYE" && method != "CANCEL" && method != "INFO" ){ log("unsupported method\n"); sl_send_reply("500","unsupported method"); 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(); # subsequent messages withing a dialog should take the # path determined by record-routing if (loose_route()) { # mark routing logic in request append_hf("P-hint: rr-enforced\r\n"); if (!t_relay()) { sl_reply_error(); } break; }; # make transaction if (!t_newtran()){ log("could not create transaction\n"); sl_send_reply("500","could not create transaction"); break; } # actively absorb ACKs if (method == "ACK") { t_relay(); break; } # pass INFO to SEMS if (method=="INFO") { if(!t_write_unix("/tmp/sems_sock","sems/info_append")){ log("could not contact sems\n"); t_reply("500","could not contact media server"); } break; } # pass INFO to SEMS if ((method=="BYE")||(method=="CANCEL")) { if(!t_write_unix("/tmp/sems_sock","sems")){ log("could not contact sems\n"); t_reply("500","could not contact media server"); } break; } if (uri =~ "sip:101.*@") { if (!t_write_unix("/tmp/sems_sock","myapp")){ log("could not contact media server\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:102.*@") { if (!t_write_unix("/tmp/sems_sock","myconfigurableapp")){ log("could not contact media server\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:103.*@") { if (!t_write_unix("/tmp/sems_sock","myannounceapp")){ log("could not contact media server\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:104.*@") { if (!t_write_unix("/tmp/sems_sock","myjukebox")){ log("could not contact media server\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:105.*@") { if (!t_write_unix("/tmp/sems_sock","mycc")){ log("could not contact media server\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:106.*@") { if (!t_write_unix("/tmp/sems_sock","ivr_announce")){ log("could not contact media server\n"); t_reply("500","could not contact media server"); break; } break; } ############ default sems apps if (uri =~ "sip:110.*@") { if (!t_write_unix("/tmp/sems_sock","echo")){ log("could not contact echo\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:111.*@") { if (!t_write_unix("/tmp/sems_sock","announcement")){ log("could not contact announcement\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:112.*@") { if (!t_write_unix("/tmp/sems_sock","conference")){ log("could not contact conference\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:113.*@") { if (!t_write_unix("/tmp/sems_sock","mailbox")){ log("could not contact mailbox\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:114.*@") { if (!t_write_unix("/tmp/sems_sock","early_announce")){ log("could not contact early_announce\n"); t_reply("500","could not contact media server"); break; } break; } if (uri =~ "sip:115.*@") { # load email avp with some email address avp_write("root@localhost","$email"); # use voicemail_headers append to pass it to sems if (!t_write_unix("/tmp/sems_sock","voicemail/voicemail_headers")){ log("could not contact voicemail\n"); t_reply("500","could not contact media server"); break; } break; } t_reply("404","Not found"); }