[OpenSIPS-Users] OpenSIPS mhomed
Yuri Kirsanov
y.kirsanov at gmail.com
Tue Dec 7 10:38:08 CET 2010
Hi community,
I have following setup:
Public IP (eth0) < OpenSIPS > Private IP (eth1) <------> Private IP (eth0)
Asterisk.
I'm trying to relay all the initial packets received by OpenSIPS to
Asterisk, so I record-route initial packets and process all responses using
loose routing. OpenSIPS is restricted to use only two UDP IP addresses -
private & public ones. It all works fine on SIP layer, I do understand that
I also need RTP proxy, but at this stage I've got strange problem - with
mhomed=1 in configuration file OpenSIPS still sends packets using public IP
address, while Contact, To and Via fields are set correctly, to private IP
address of OpenSIPS. I have tried to use force_send_socket but without any
luck. Could you please help me with this configuration? At least - why does
OpenSIPS uses public IP? Thanks!
Here's my configuration:
####### Global Parameters #########
log_facility=LOG_LOCAL4
fork=yes
children=4
debug=9
disable_tcp=yes
auto_aliases=no
mhomed=1
port=5066
listen=udp:XXX.XXX.XXX.XXX:5066
listen=udp:10.22.10.254:5068
####### Modules Section ########
#set module path
mpath="/opt/opensips/lib64/opensips/modules/"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
modparam("rr", "append_fromtag", 1)
# ----- uri params -----
modparam("uri", "use_uri_table", 0)
####### Routing Logic ########
# main request routing logic
route{
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
if (is_method("BYE")) {
setflag(1); # do accounting ...
setflag(3); # ... even if the transaction
fails
} else if (is_method("INVITE")) {
# even if in most of the cases is useless,
do RR for
# re-INVITEs alos, as some buggy clients do
change route set
# during the dialog.
record_route();
}
# route it out to whatever destination was set by
loose_route()
# in $du (destination URI).
route(1);
} else {
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route, but stateful ACK;
must be an ACK after
# a 487 or e.g. 404 from upstream
server
t_relay();
exit;
} else {
# ACK without matching transaction
->
# ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
#initial requests
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
# preloaded route checking
if (loose_route()) {
xlog("L_ERR",
"Attempt to route with preloaded Route's
[$fu/$tu/$ru/$ci]");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}
record_route();
route(1);
}
route[1] {
rewritehostport("10.22.10.1:6000");
force_send_socket(10.22.10.254);
if (!t_relay()) {
sl_reply_error();
};
exit;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20101207/96f9a61f/attachment-0001.htm>
More information about the Users
mailing list