nick wrote:
-------- Original Message --------
Subject: Re: [Users] Why is fix_nated_sdp appending 127.0.0.1 at the end
of my c= lines?
Date: Tue, 21 Nov 2006 16:46:42 +0100
From: nick <nick(a)mobilia.it>
To: Ovidiu Sas <sip.nslu(a)gmail.com>
References: <4562E2D7.7010403(a)mobilia.it>
<4562E82E.4070503(a)pernau.at> <45631216.3000800(a)mobilia.it>
<6f497e130611210650i409e6cfblfb39b0d8a0b9f2e2(a)mail.gmail.com>
<45631873.8010400(a)mobilia.it>
<6f497e130611210724p4b3ead9bha95cb848c29d276c(a)mail.gmail.com>
Ovidiu Sas wrote:
It seems that you are trying to do a double
processing of the SDP
(that's why you have 2 IPs inside SDP). Check you script if you use
force_rtp_proxy and fix_nated_sdp at the same time.
Regards,
Ovidiu Sas
On 11/21/06, nick <nick(a)mobilia.it> wrote:
Ovidiu Sas wrote:
check the '-d' argument. If you
don't specify '-d', ngrep will only
listen to one interface. '-d any' will force ngrep to listen to all
interfaces, including the loopback.
Hope this helps,
Ovidiu Sas
BTW, I changed my fix_nated_sdp() command to fix_nated_sdp("10") only,
which is adding the origin IP instead of the mediaproxy one.. I don't
mind this, but it still seems to be adding the 127.0.0.1
Actually, I'm using mediaproxy and fix_nated_sdp at the same time, I
am
using fix_nated_sdp because for some reason, mediaproxy isn't changing
the SDP information in the SIP requests (or at least, it wasn't
beforehand).
I'll have a look at where it might be overlapping.
whoops forgot to cc
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users
I'm not sure where it's overlapping, the only place I call both
fix_nated_sdp() and use_media_proxy() together are in the reply route
section..
The strange thing is, before I added in fix_nated_sdp(), there were no
changes at all to the sdp string (they remained private IP addresses).
My .cfg is attached, can anyone point out where I might be forcing a loop?
Nick
#
# ----------- global configuration parameters ------------------------
debug=4 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
log_facility=LOG_LOCAL6
/* Uncomment these lines to enter debugging mode
fork=no
log_stderror=yes
*/
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
listen=udp:89.XXX.XXX.16:5060
fifo="/tmp/openser_fifo"
fifo_db_url="mysql://openser:SuEUbQ@localhost/openser"
# ------------------ module loading ----------------------------------
loadmodule "/usr/local/lib64/openser/modules/mysql.so"
loadmodule "/usr/local/lib64/openser/modules/domain.so"
loadmodule "/usr/local/lib64/openser/modules/mediaproxy.so"
loadmodule "/usr/local/lib64/openser/modules/sl.so"
loadmodule "/usr/local/lib64/openser/modules/tm.so"
loadmodule "/usr/local/lib64/openser/modules/acc.so"
loadmodule "/usr/local/lib64/openser/modules/rr.so"
loadmodule "/usr/local/lib64/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib64/openser/modules/usrloc.so"
loadmodule "/usr/local/lib64/openser/modules/registrar.so"
loadmodule "/usr/local/lib64/openser/modules/textops.so"
loadmodule "/usr/local/lib64/openser/modules/xlog.so"
loadmodule "/usr/local/lib64/openser/modules/uri.so"
loadmodule "/usr/local/lib64/openser/modules/group.so"
loadmodule "/usr/local/lib64/openser/modules/nathelper.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib64/openser/modules/auth.so"
loadmodule "/usr/local/lib64/openser/modules/auth_db.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
modparam("group|domain|auth_db|usrloc|acc","db_url","mysql://openser:XXXX@localhost/openser")
# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
modparam("auth_db", "password_column", "password")
#modparam("domain", "db_mode", 1) # Use caching
modparam("domain", "domain_table", "domain")
modparam("domain", "domain_col", "domain")
# -- acc params --
modparam("acc", "log_level", 3)
# modparam("acc", "radius_flag", 1)
# modparam("acc", "radius_missed_flag", 2)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 1)
modparam("acc", "service_type", 15)
modparam("acc|group_radius|avp_radius", "radius_config",
"/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("acc", "db_flag", 3)
modparam("acc", "db_missed_flag", 4)
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
modparam("mediaproxy", "sip_asymmetrics",
"/usr/local/etc/openser/sip-asymmetrics-clients")
modparam("mediaproxy", "rtp_asymmetrics",
"/usr/local/etc/openser/rtp-asymmetrics-clients")
modparam("registrar", "nat_flag", 5)
modparam("mediaproxy", "natping_interval", 0)
modparam("nathelper", "rtpproxy_disable", 1)
modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "sipping_from",
"sip:ping@mobilia.it")
modparam("registrar", "sip_natping_flag", 4)
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER")
setflag(1);
record_route();
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
exit;
};
# check for PSTN calls
if(uri=~"sip:\+?[0-9]{8,24}+@.*") {
append_hf("P-hint: outbound\r\n");
route(2);
exit;
};
if (!is_uri_host_local()) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
exit;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (is_uri_host_local()) {
if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication
if (!www_authorize("sipserver.mobilia.it",
"subscriber")) {
www_challenge("sipserver.mobilia.it",
"0");
exit;
};
if (client_nat_test("3")) {
setflag(5);
setflag(4);
force_rport();
fix_contact();
};
save("location");
exit;
};
lookup("aliases");
if (!is_uri_host_local()) {
append_hf("P-hint: outbound alias\r\n");
route(1);
exit;
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
};
if (method=="INVITE") {
if (nat_uac_test("8")) {
fix_nated_sdp("10");
};
t_on_failure("1");
} else if (method == "BYE" || method == "CANCEL") {
end_media_session();
};
if (loose_route()) {
if (method=="INVITE" || method=="ACK") {
use_media_proxy();
};
t_relay();
exit;
};
if (client_nat_test("3") && !search("^Record-Route:")) {
# Mark as NAT'ed
force_rport();
fix_contact();
};
if (method=="INVITE") {
t_on_reply("1");
};
if (method=="INVITE" || method=="ACK") {
use_media_proxy();
};
if (!t_relay()) {
if (method=="INVITE" || method=="ACK") {
end_media_session();
};
sl_reply_error();
};
append_hf("P-hint: usrloc applied\r\n");
route(1);
}
route[1]
{
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
}
route[2]
{
# calls to pstn
if(is_method("INVITE") && !has_totag()) {
if (!is_user_in("From", "PSTN")) {
sl_send_reply("403", "Forbidden PSTN");
exit;
};
# set gateway address
rewritehostport("84.XXX.XXX.XXX:5060");
route(1);
};
}
failure_route[1] {
end_media_session();
}
onreply_route[1] {
if (status=~"(183)|(2[0-9][0-9])") {
if (client_nat_test("1")) {
fix_contact();
};
if (nat_uac_test("8")) {
fix_nated_sdp("10");
};
use_media_proxy();
};
}