<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">Thanks Daniel.&nbsp; I got it basically working with the following config.&nbsp; But there is one last bug.&nbsp; If client B connected and registered, then disconnected without
 proper unregister, it seems the location table didn&#8217;t get prompt update.&nbsp; If client A sends Invite right after that,&nbsp; the sip server will try to connect to B(which will surely fail since B is behind the firewall), instead of sending 480 to A right away.&nbsp; Is
 there a way to fix this?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">JJ<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">if (is_method(&quot;REGISTER&quot;))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # authenticate the REGISTER requests (uncomment to enable auth)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!www_authorize(&quot;&quot;, &quot;subscriber&quot;))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&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(&quot;&quot;, &quot;0&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!db_check_to())<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!save(&quot;location&quot;, &quot;m&quot;))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply_error();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!lookup(&quot;location&quot;)) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #if (!registered(&quot;location&quot;)) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;480&quot;,&quot;Not Found&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!registered(&quot;location&quot;)) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;480&quot;,&quot;Not Found&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!t_relay()) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;500&quot;, &quot;relaying failed&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:windowtext">From:</span></b><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;;color:windowtext"> Daniel-Constantin Mierla [mailto:miconda@gmail.com]
<br>
<b>Sent:</b> Wednesday, September 28, 2011 2:49 AM<br>
<b>To:</b> SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List<br>
<b>Cc:</b> JJ Zeng<br>
<b>Subject:</b> Re: [SR-Users] simple question but can't find the answer<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">Hello,<br>
<br>
On 9/28/11 2:43 AM, JJ Zeng wrote: <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">I am really new to ser(just installed it today).&nbsp; My situation is here:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">Both A and B make tcp connection to ser proxy server.&nbsp; If A sends &#8220;Invite&#8221; to B, ser would look up the tcp connection of B, and relay the sip request.&nbsp; If B is not connected,
 then 480 is returned to A.&nbsp; When B sends back the response, ser would relay &nbsp;it to A.&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">It looks really simple, but I just can&#8217;t figure out how to do it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">what default config file you started with?<br>
<br>
Apart of that when the user is not online, the default config replies with 404 Not Found, the relaying between phones when they are online is done there, being a combination of calling function from registrar and tm modules. So, if you start with the default
 config, no matter is Kamailio or SER flavour, routing of the calls between online users is provided there, just go through it in order to understand better.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<o:p></o:p></span></p>
<pre><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">-- <o:p></o:p></span></pre>
<pre><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">Daniel-Constantin Mierla -- <a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></span></pre>
<pre><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;">Kamailio Advanced Training, Oct 10-13, Berlin: <a href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><o:p></o:p></span></pre>
<pre><span style="font-size:14.0pt;font-family:&quot;Cambria&quot;,&quot;serif&quot;"><a href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda">http://twitter.com/miconda</a><o:p></o:p></span></pre>
</div>
</body>
</html>