[Asterisk-Dev] Re: [Asterisk-Users] Asterisk and SIP phones

Benjamin on Asterisk Mailing Lists benjk.on.asterisk.ml at gmail.com
Thu Oct 7 12:09:56 MST 2004


On Thu, 7 Oct 2004 11:17:51 -0700, John Paul Morrison
<jmorrison at bogomips.com> wrote:
> NAT is unfortunately a necessary evil and will never go away,

I agree about the evil nature of NAT, should never have been let loose
on mankind ;-) However, I don't think it will never go away. It will
eventually. Just not as fast as them IETF folks think. It will take a
very long time until the last IPv4 node is shut down.

In any event, NAT is far more likely to outlive SIP than the other way round.

> I think the best approach is to create a new sip.conf entry like
> "natcontext" so you can have "natcontext=customer-1" for a group of devices,
> "natcontext=customer-2" etc. so that an Asterisk adminstrator can better
> control the way reinvites are issued.

I think the idea to selectively set when reinvites are allowed is a
good idea and I have myself been asking why there is no such thing.
However, I don't think you should make this as complicated as you seem
to be doing.

There should be a simple-and-stupid-covers-90%-of-cases setting and a
more sophisticated but still relatively simple way for the remaining
10%.

I venture to say that in most cases the requirement will be extremely simple:

"allow reinvites between anything on the same subnet and disallow to
anywhere else"

this setting should be configurable with something like

reinvite=local

So, if we have Asterisk A and two phones B and C, ...

[remote SIP gw]----SIP---[A]-----B-and-C

then sip.conf should have

[PhoneB]
reinvite=local   ; allow reinvites if both parties are on the local subnet

[PhoneC]
reinvite=local   ; allow reinvites if both parties are on the local subnet

[remoteSIPgw]
reinvite=yes   ; setting if Asterisk has its own public IP
OR
renivte=no      ; setting if Asterisk is behind NAT

The other 10% would be cases where it is not obvious what is local and
what is not, as would be the case with a number of VPN tunnels of
which the Asterisk server is not an end point and therefore could not
know what the routing table of the router says.

But here again, the configuration could be made fairly easy by simply
telling Asterisk who is local and who is not, replicating the
information in the router's routing table so to speak.

This could look like the following in sip.conf ...

[SIPphoneB]
reinvite=1.2.3.4/29,5.6.7.8/24,192.168.0.0/16
ALSO
reinvite=sip.server.net

In any event, it may be best to implement the local subnet only method
first and have a play with it for a while, then look at more
sophisticated scenarios with the experience gained.

just my 2 yen.

rgds
benjk

-- 
Sunrise Telephone Systems, 9F Shibuya Daikyo Bldg., 1-13-5 Shibuya,
Tokyo, Japan.

NB: Spam filters in place. Messages unrelated to the * mailing lists
may get trashed.



More information about the asterisk-dev mailing list