<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>I have a setup where
Asterisk is deployed at a central location, and SIP phones</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>have to pass through
NAT in order to reach a PSTN gateway.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>This works with
nat=yes and canreinivite=no in the sip.conf. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>But if two phones
need to talk to each other, they must go out to Asterisk to be
bridged</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>and then back. On a
local LAN this is no big deal, but across WAN links this is
awful.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>I've done some tests
and this seems to do the trick. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>If the administrator
puts </SPAN></FONT><FONT face=Arial size=2><SPAN class=746411906-12092004>phones
in a different context, then asterisk will not reinvite, </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>otherwise if they
are in the same </SPAN></FONT><FONT face=Arial size=2><SPAN
class=746411906-12092004>context, canreinivite is honored. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>This is just a hack,
perhaps I'm abusing the context. Any opinions as to how this should be
implemented for real?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>I can implement a
config setting in sip.conf, but should I just add it to the sip_pvt structure?
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>(but this would seem
messy if you are looking at it in rtp.c)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=746411906-12092004>--- rtp.c.orig
Sat Aug 7 07:22:09 2004<BR>+++ rtp.c
Sat Sep 11 20:03:00 2004<BR>@@ -1371,6 +1371,14
@@<BR>
return
-2;<BR>
}<BR> }<BR>+/* hack for testing
*/<BR>+ if
(strncasecmp(c0->context,c1->context,AST_MAX_EXTENSION))
{<BR>+
ast_log(LOG_WARNING, "context0 = %s does not match context1 =
%s.\n",c0->context,c1->context);<BR>+
ast_mutex_unlock(&c0->lock);<BR>+
ast_mutex_unlock(&c1->lock);<BR>+
return -2;<BR>+ }<BR>+/* hack for
testing */<BR> if
(pr0->set_rtp_peer(c0, p1, vp1, codec1))
<BR>
ast_log(LOG_WARNING, "Channel '%s' failed to talk to '%s'\n", c0->name,
c1->name);<BR> else
{<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=746411906-12092004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><FONT face=Arial size=2>John Paul
Morrison<BR>1-866-286-0342 604-787-7098</FONT></DIV>
<DIV> </DIV>
<DIV align=left><FONT face=Arial size=2>John Paul Morrison CCIE #8191,
CCNP/Security, CCDP<BR><A
href="mailto:johnpaulmorrison@bogomips.com">johnpaulmorrison@bogomips.com</A> <A
href="http://www.bogomips.com/">http://www.bogomips.com/</A></FONT></DIV>
<DIV> </DIV></BODY></HTML>