<br><br><div><span class="gmail_quote">On 7/9/07, <b class="gmail_sendername">Noah Miller</b> &lt;<a href="mailto:noahisaacmiller@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">noahisaacmiller@gmail.com
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Stefan -<br><br>&gt; What I want to accomplish:<br>&gt; - calls within the LAN are re-invited (RTP goes from endpoint to endpoint)<br>&gt; - asterisk detects when a call is going beyond the local LAN (over the NAT),<br>


&gt; and then stays in the middle.<br>&gt;<br>&gt; I&#39;m wondering if this is hard to do and how I&#39;m supposed to configure this.<br><br>I don&#39;t really know how hard it would be to do what you describe, but<br>if you&#39;re interested in getting the results you want with a minimum of
<br>effort, just keep asterisk in the media path all the time.&nbsp;&nbsp;Set<br>canreinvite=no, and your calls should work consistently whether they<br>stay inside the NAT or go outside.</blockquote><div><br>This is what I ended up doing. Until I ran into issues again with outgoing calls. Current setup = asterisk 
1.4.11, installed on a host connected to the internet (internet route able IP-address) and my internal network (<a href="http://192.168.254.254">192.168.254.254</a>). SIP phones are on the internal network, STUN and such hasn&#39;t been configured.
<br><br>SIP.conf:<br>
externhost = &lt;external hostname --&gt; <a href="http://ddns.org">ddns.org</a>&gt;<br>canreinvite = no<br>localnet = <a href="http://192.168.254.0/24">192.168.254.0/24</a><br>; nat = option is not set<br><br>Outgoing call to our sip provider ends up being setup like this:
<br><br>outbound RTP stream:<br>SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>) --&gt; asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>)<br>asterisk external (internet IP) --&gt; asterisk external (internet IP) (!!!)
<br><br>inbound RTP stream:<br>SIP provider (internet IP) --&gt; asterisk external (internet IP)<br>asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>) --&gt; SIP phone (<a href="http://192.168.254.104">
192.168.254.104</a>)<br><br>I have no idea why asterisk is trying to send the outbound RTP stream to itself. Removing the externhost and localnet settings doesn&#39;t help either. Neither does setting &quot;nat = yes&quot;, even in the example below.
<br><br><br><br><br>SIP.conf:<br>
externhost = &lt;external hostname --&gt; <a href="http://ddns.org">ddns.org</a>&gt;<br>
canreinvite = nonat<br>
localnet = <a href="http://192.168.254.0/24">192.168.254.0/24</a><br>
; nat = option is not set.<br>
<br>Outgoing call to our sip provider ends up being setup like this:<br><br>
outbound RTP stream:<br>
SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>) --&gt; asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>)<br>
asterisk external (internet IP) --&gt; SIP provider (internet IP)<br>
<br>
inbound RTP stream:<br>
SIP provider (internet IP) --&gt; asterisk external (internet IP)<br>
asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>) --&gt; SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>)<br>
<br>The inbound RTP stream goes well for +/- 1 second, then the SIP provider responds to a re-invite sent by my asterisk box to send the trafic to <a href="http://192.168.254.104">192.168.254.104</a> (the SIP phone on my internal network).
<br><br>
outbound RTP stream:<br>

SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>) --&gt; asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>)<br>

asterisk external (internet IP) --&gt; SIP provider (internet IP)<br><br>inbound RTP stream:<br>SIP provider (internet IP) --&gt; SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>)<br><br>I don&#39;t understand the logic of Asterisk sending the re-invite for inbound RTP stream. I would be more logical if Asterisk would send an invite for the outbound RTP stream:
<br><br>
outbound RTP stream:<br>

SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>) --&gt; SIP provider (internet IP)<br>

<br>

inbound RTP stream:<br>

SIP provider (internet IP) --&gt; asterisk external (internet IP)<br>

asterisk internal IP (<a href="http://192.168.254.254">192.168.254.254</a>) --&gt; SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>)<br>

<br>Does the logic have anything to do with in which order the interfaces are defined on the box? In my case, ETH0 = <a href="http://192.168.254.254">192.168.254.254</a>, ETH1 = internet IP.<br><br>
I can&#39;t find any configuration examples of my kind of setup, where a dual-homed host running asterisk has one NIC on the Internet and one on the internal (RFC1918 space) network. All examples I&#39;ve bumped into have either the asterisk box behind a NAT router (
i.e. it only has a RFC1918 IP-address) or the asterisk box is on a real IP.<br><br>with kind regards,<br><br>Stefan</div></div>