[asterisk-users] SER+Asterisk integration
Arnd Vehling
av at nethead.de
Sun Sep 3 11:19:51 MST 2006
have a look at the nathelper examples in SER distribution. This is from
an rather old installation of mine.
--
# !! Nathelper
# Special handling for NATed clients; first, NAT test is
# executed: it looks for via!=received and RFC1918 addresses
# in Contact (may fail if line-folding is used); also,
# the received test should, if completed, should check all
# vias for rpesence of received
if (nat_uac_test("3")) {
# Allow RR-ed requests, as these may indicate that
# a NAT-enabled proxy takes care of it; unless it is
# a REGISTER
if (method == "REGISTER" || ! search("^Record-Route:")) {
xlog("L_ERR", "LOG: Someone trying to register from private
IP, rewriting\n");
# This will work only for user agents that support symmetric
# communication. We tested quite many of them and majority i
s
# smart enough to be symmetric. In some phones it takes a co
nfiguration
# option. With Cisco 7960, it is called NAT_Enable=Yes, with
kphone it is
# called "symmetric media" and "symmetric signalling".
fix_nated_contact(); # Rewrite contact with source IP of sig
nalling
if (method == "INVITE") {
fix_nated_sdp("1"); # Add direction=active to SDP
};
force_rport(); # Add rport parameter to topmost Via
setflag(6); # Mark as NATed
};
};
..
# if client or server know to be behind a NAT, enable relay
if (isflagset(6)) {
force_rtp_proxy();
};
--
More information about the asterisk-users
mailing list