<br><br><div><span class="gmail_quote">On 7/9/07, <b class="gmail_sendername">Noah Miller</b> <<a href="mailto:noahisaacmiller@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">noahisaacmiller@gmail.com
</a>> 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>> What I want to accomplish:<br>> - calls within the LAN are re-invited (RTP goes from endpoint to endpoint)<br>> - asterisk detects when a call is going beyond the local LAN (over the NAT),<br>
> and then stays in the middle.<br>><br>> I'm wondering if this is hard to do and how I'm supposed to configure this.<br><br>I don't really know how hard it would be to do what you describe, but<br>if you're interested in getting the results you want with a minimum of
<br>effort, just keep asterisk in the media path all the time. 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't been configured.
<br><br>SIP.conf:<br>
externhost = <external hostname --> <a href="http://ddns.org">ddns.org</a>><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>) --> asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>)<br>asterisk external (internet IP) --> asterisk external (internet IP) (!!!)
<br><br>inbound RTP stream:<br>SIP provider (internet IP) --> asterisk external (internet IP)<br>asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>) --> 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't help either. Neither does setting "nat = yes", even in the example below.
<br><br><br><br><br>SIP.conf:<br>
externhost = <external hostname --> <a href="http://ddns.org">ddns.org</a>><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>) --> asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>)<br>
asterisk external (internet IP) --> SIP provider (internet IP)<br>
<br>
inbound RTP stream:<br>
SIP provider (internet IP) --> asterisk external (internet IP)<br>
asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>) --> 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>) --> asterisk internal (<a href="http://192.168.254.254">192.168.254.254</a>)<br>
asterisk external (internet IP) --> SIP provider (internet IP)<br><br>inbound RTP stream:<br>SIP provider (internet IP) --> SIP phone (<a href="http://192.168.254.104">192.168.254.104</a>)<br><br>I don'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>) --> SIP provider (internet IP)<br>
<br>
inbound RTP stream:<br>
SIP provider (internet IP) --> asterisk external (internet IP)<br>
asterisk internal IP (<a href="http://192.168.254.254">192.168.254.254</a>) --> 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'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'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>