# # $Id: ser-isdngw.conf,v 1.2 2003/09/09 17:48:22 ullstar Exp $ # # isdngw sample config script # please direct comments to ullstar@iptel.org # # ----------- global configuration parameters ------------------------ # setup parameters according to your needs. Most people will only have # to adjust the listen and alias parameters below. debug=1 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=no # (cmd line: -E) check_via=yes # (cmd. line: -v) dns=0 # (cmd. line: -r) rev_dns=0 # (cmd. line: -R) port=5060 children=4 fifo="/tmp/ser_fifo" # Add the name of your system here #listen=yourhostname # for more names add alias entries, all that might be used as domain in SIP URI #alias=yourhostname.yourdomain.com #alias=your.ip.addr.ess # ------------------ module loading ---------------------------------- loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/maxfwd.so" loadmodule "/usr/local/lib/ser/modules/rr.so" loadmodule "/usr/local/lib/ser/modules/textops.so" loadmodule "/usr/local/lib/ser/modules/vm.so" loadmodule "/usr/local/lib/ser/modules/dbtext.so" loadmodule "/usr/local/lib/ser/modules/usrloc.so" loadmodule "/usr/local/lib/ser/modules/registrar.so" # ----------------- setting module-specific parameters --------------- # You may want to define things like databases here. Please refer to # the extensive SER documentation for this purpose. Module parameters # are always described in the modules README files. # # For pure isdn gateway functionality only a database is needed, we use # a simple textfile for this purpose. Actually this is only neccessary until # the vm module is reworked. Simply copy the etc/db directory from the isdngw # directory somewhere and specify it in the following statement: modparam("voicemail", "db_url","/root/ser/db") # ------------------------- request routing logic ------------------- # This section describes how SIP messages are handled. # workaround needed for some buggy UAs (e.g. MS Messenger) modparam("rr", "enable_full_lr", 1) # The routing is described now: 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; }; # 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(); # deal with my domain first if (uri==myself) { # the following allows for user-agent registration # in concerns of the isdn gateway this means: # register a SIP phone with @ # and configure the isdn gateway to listen on the number specified as # the user (). # Incoming calls are then directed to this user agent # Note: This sample configuration does not use a persistent storage, so # if you restart SER you have to re-register your SIP client to make this # work. Refer to the userloc module's documentation for setting up # persistent contact storage. if (method=="REGISTER") { save("location"); break; }; if (lookup("location")) { if (!t_relay()) { sl_reply_error(); }; break; }; # ############################## # # isdngw specific configuration # # ############################## # if(t_newtran()){ if(method=="INVITE" || method=="BYE" || method=="CANCEL"){ # send a response right at the start to avoid retransmissions t_reply("100","Trying -- just wait a minute !"); # isdngw only gets activated on invite requests if(method=="INVITE"){ # isdngw feels to be responsible for numeric userparts # all numbers followed by @ and anything after it match # this expression # for example: sip:555123123@yourdomain.com:5061 matches. # The vm command (from module vm) is used to contact the # media server and though it the isdngw. # /tmp/am_fifo is the fifo filename ued for communications, make # shure the permissions are correct and that the same fifo # filename is defined in sems.conf. if(uri=~"sip:[0-9]+@.*"){ if(!vm("/tmp/am_fifo","isdngw")){ log("could not contact isdngw\n"); t_reply("500","could not contact isdngw"); }; # we dont feel responsible for sip addresses not starting with # a number, so send the right error code. } else { t_reply("404","Not Found"); }; # stop routing here, the message is now processed by the media server break; }; # The following handles the call termination, we must pass these requests # to the media server as follows. Again make shure the fifo name and permissions # are set correctly (like im sems.conf). if((method=="BYE")||(method=="CANCEL")){ if(!vm("/tmp/am_fifo","bye")){ log("could not contact the media server\n"); t_reply("500","could not contact the media server"); }; break; }; # other methods than INVITE, BYE and CANCEL are not handled by this SIP Server # so we sent an error message } else { log("ERROR: method not supported\n"); t_reply("500", "sorry, method not supported"); }; } else { # for any reason the transaction could not be created, send error code log("could not create new transaction\n"); sl_send_reply("500","could not create new transaction"); }; # not uri=myself, this SIP request is not directed to us, simply direct it to its # correct destination } else { if (!t_relay()) { sl_reply_error(); }; }; # end of routing. }