<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2656.60">
<TITLE>Please help with PSTN</TITLE>
</HEAD>
<BODY>
<P ALIGN=LEFT><FONT COLOR="#000080" FACE="Times New Roman">All,</FONT></P>
<P ALIGN=LEFT><FONT COLOR="#000080" SIZE=2 FACE="Arial">Please take a look at my ser.cfg . My sip domain is sipserv.foo.com. I can dial</FONT> <A HREF="mailto:3603@foo.com"><U></U><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">3603@foo.com</FONT></U></A><FONT COLOR="#000080" SIZE=2 FACE="Arial"></FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">which is a PSTN</FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">number</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"></FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">off of a PBX</FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial"> but can</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">'</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">t dial</FONT> <A HREF="mailto:3603@sipserv.foo.com"><U></U><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">3603@sipserv.foo.com</FONT></U></A><FONT COLOR="#000080" SIZE=2 FACE="Arial">.</FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">I</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"></FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">get 404 not found. What can</FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">I</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"></FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">change in my c</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial">onfig file so</FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">I</FONT><FONT COLOR="#000080" SIZE=2 FACE="Arial"></FONT> <FONT COLOR="#000080" SIZE=2 FACE="Arial">can dial</FONT> <A HREF="mailto:3603@sipserv.foo.com"><U></U><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">3603@sipserv.foo.com</FONT></U></A><FONT COLOR="#000080" SIZE=2 FACE="Arial">.</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp $</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># simple quick-start config script</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># ----------- global configuration parameters ------------------------</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#debug=3 # debug level (cmd line: -dddddddddd)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#fork=yes</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#log_stderror=no # (cmd line: -E)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">/* Uncomment these lines to enter debugging mode </FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">debug=7</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">fork=no</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">log_stderror=yes</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">*</FONT><FONT SIZE=2 FACE="Courier New">/</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">check_via=no # (cmd. line: -v)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">dns=yes # (cmd. line: -r)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">rev_dns=no # (cmd. line: -R)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#port=5060</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#children=4</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">fifo="/tmp/ser_fifo"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># ------------------ module loading ----------------------------------</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># Uncomment this if you want to use SQL database</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/mysql.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/sl.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/tm.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/rr.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/maxfwd.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/usrloc.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/registrar.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># Uncomment this if you want digest authentication</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># mysql.so must be loaded !</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/auth.so"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">loadmodule "/usr/lib/ser/modules/auth_db.s</FONT><FONT SIZE=2 FACE="Courier New">o"</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># ----------------- setting module-specific parameters ---------------</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># -- usrloc params --</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#modparam("usrloc", "db_mode", 0)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># Uncomment this if you want to use SQL database </FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># for persistent storage and comment the previous line</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">modparam("usrlo</FONT><FONT SIZE=2 FACE="Courier New">c", "db_mode", 2)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># -- auth params --</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># Uncomment if you are using auth module</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">modparam("auth_db", "calculate_ha1", yes)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># If you set "calculate_ha1" parameter to yes (which true in this config), </FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># uncomment also the following parameter)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">#</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">modparam("auth_db", "password_column", "password")</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># -- rr params --</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># add value to ;lr param to make some broken UAs happy</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">modparam("rr", "enable_full_lr", 1)</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># ------------------------- request routing logic -------------------</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># main routing logic</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">ro</FONT><FONT SIZE=2 FACE="Courier New">ute{</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># initial sanity checks -- messages with</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># max_forwards==0, or excessively long requests</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if (!mf_process_maxfwd_header("10")) {</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">sl_send_reply("483","Too Many Hops");</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">break;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if ( msg:len > max_len ) {</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">sl_send_reply("513", "Message too bi</FONT><FONT SIZE=2 FACE="Courier New">g");</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">break;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># we record-route all messages -- to make sure that</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># subsequent messages will go through our proxy; that's</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># particularly good if upstream and downstream entities</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># use different transport protocol</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">record_route(); </FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># loose-route processing</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if (loose_route()) {</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">t_relay();</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">break;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># if the request is for other domain use UsrLoc</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># (in case, it does not work, use the following command</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># with proper names and addresses in it)</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if (uri==myself) {</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if (method=</FONT><FONT SIZE=2 FACE="Courier New">="REGISTER") {</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># Uncomment this if you want to use digest authentication</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if (!www_authorize("sipserv.foo.com", "subscriber")) {</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">www_challenge("sipserv.foo.com", "0");</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">break;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">save("location");</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">break;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># native SIP destinations</FONT> <FONT SIZE=2 FACE="Courier New">are handled using our USRLOC DB</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if (!lookup("location")) {</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">sl_send_reply("404", "Not Found");</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">break;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"># forward to current uri now; use stateful forwarding; that</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New"># works reliably even if we forward from TCP to UDP</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">if (!t_relay()) {</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">sl_reply_error();</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"> attempt handoff to PSTN</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">if (uri=~"^sip:3[0-9]*") { ## This assumes that the caller is</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"> log("Forwarding to PSTN\n"); ## registered in our realm</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"> forward( 156.151.96.253, 5060 ); ## Our Cisco router</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New"> break;</FONT></P>
<P ALIGN=LEFT> <FONT SIZE=2 FACE="Courier New">}</FONT><FONT SIZE=2 FACE="Courier New">;</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">}</FONT></P>
<P ALIGN=LEFT> </P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">Plea</FONT><FONT SIZE=2 FACE="Courier New">se help</FONT></P>
<P ALIGN=LEFT><FONT SIZE=2 FACE="Courier New">Thanks</FONT></P>
<BR>
</BODY>
</HTML>