<html><div style='background-color:'><DIV class=RTE>Hello</DIV>
<DIV class=RTE>I've got an easy configuration for SER and all I want it to do is to forward to a PSTN GW in 10.140.0.4 all the calls that are not 331xxx. The inside calls work alright, and I can also make calls to PSTN phones, the problem is that SER keeps sending INVITEs even after the caller has hanged up, or even after a conversation, so the callee rings (but noone is calling, and if you answer there's no communication). I enclose my ser.cfg, please help!! Thank you,</DIV>
<DIV class=RTE>Llanos</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE><BR># ----------- global configuration parameters ------------------------</DIV>
<DIV class=RTE>#debug=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # debug level (cmd line: -dddddddddd)<BR>#fork=yes<BR>#log_stderror=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd line: -E)</DIV>
<DIV class=RTE>/* Uncomment these lines to enter debugging mode<BR>debug=7<BR>fork=no<BR>log_stderror=yes<BR>*/</DIV>
<DIV class=RTE>check_via=no&nbsp;&nbsp;&nbsp; # (cmd. line: -v)<BR>dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: -r)<BR>rev_dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: -R)<BR>#port=5060<BR>#children=4<BR>fifo="/tmp/ser_fifo"<BR>#fifo_db_url="mysql://ser:heslo@localhost/ser"</DIV>
<DIV class=RTE># ------------------ module loading ----------------------------------</DIV>
<DIV class=RTE># Uncomment this if you want to use SQL database<BR>loadmodule "/usr/local/lib/ser/modules/mysql.so"</DIV>
<DIV class=RTE>loadmodule "/usr/local/lib/ser/modules/sl.so"<BR>loadmodule "/usr/local/lib/ser/modules/tm.so"<BR>loadmodule "/usr/local/lib/ser/modules/rr.so"<BR>loadmodule "/usr/local/lib/ser/modules/maxfwd.so"<BR>loadmodule "/usr/local/lib/ser/modules/usrloc.so"<BR>loadmodule "/usr/local/lib/ser/modules/registrar.so"</DIV>
<DIV class=RTE># Uncomment this if you want digest authentication<BR># mysql.so must be loaded !<BR>#loadmodule "/usr/local/lib/ser/modules/auth.so"<BR>#loadmodule "/usr/local/lib/ser/modules/auth_db.so"</DIV>
<DIV class=RTE>#loadmodule "/usr/local/lib/ser/modules/acc.so"<BR>#loadmodule "/usr/local/lib/ser/modules/uri.so"</DIV>
<DIV class=RTE># ----------------- setting module-specific parameters ---------------</DIV>
<DIV class=RTE># -- usrloc params --</DIV>
<DIV class=RTE>modparam("usrloc","db_mode",1)<BR>#segun ultimo parametro:<BR>#mode 0:disables writes to the database, contact info won't be preserved if the server is restarted<BR>#mode 1:writes all changes to the db immediately and contact info is saved, but can be slow<BR>#mode2:periodically writes contact info to the db based in the memory cache</DIV>
<DIV class=RTE># -- auth params --<BR># Uncomment if you are using auth module<BR>#<BR>#modparam("auth_db", "calculate_ha1", yes)<BR>#<BR># If you set "calculate_ha1" parameter to yes (which true in this config),<BR># uncomment also the following parameter)<BR>#<BR>#modparam("auth_db", "password_column", "password")</DIV>
<DIV class=RTE># -- rr params --<BR># add value to ;lr param to make some broken UAs happy<BR>modparam("rr", "enable_full_lr", 1)</DIV>
<DIV class=RTE># -------------------------&nbsp; request routing logic -------------------</DIV>
<DIV class=RTE># main routing logic</DIV>
<DIV class=RTE>route{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup("aliases");<BR>&nbsp;&nbsp;&nbsp;&nbsp; # ROUTINE CHECKS<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # initial sanity checks -- messages with<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # max_forwards==0, or excessively long requests<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!mf_process_maxfwd_header("10")) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("483","Too Many Hops");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( msg:len &gt; max_len ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("513", "Message too 
big");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>&nbsp;&nbsp;&nbsp;&nbsp; # END OF ROUTINE CHECKS</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # we record-route all messages -- to make sure that<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # subsequent messages will go through our proxy; that's<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # particularly good if upstream and downstream entities<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # use different transport protocol<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record_route();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # loose-route processing<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (loose_route()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # if the request is for other domain use UsrLoc<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (in case, it does not work, use the following command<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # with proper names and addresses in it)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (uri==myself) {</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method=="REGISTER") {</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Uncomment this if you want to use digest authentication<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!www_authorize("sipproxy.plczar.endesa.es", "subscriber")) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; www_challenge("", "0");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save("location");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # native SIP destinations are handled using our USRLOC DB</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # if requests URI isn't 331xxx numerical <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # forward statelessly to a static destination<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!uri=~"^sip:331[0-9][0-9][0-9]@*"){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; forward( 10.140.0.4, 5060 );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
<DIV class=RTE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # forward to current uri now; use stateful forwarding; that<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # works reliably even if we forward from TCP to UDP<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!t_relay()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply_error();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</DIV>
<DIV class=RTE>}</DIV></div></html>