<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Maybe:</p>
<p>if (loose_route()) {<br>
route(DLGURI);<br>
if (is_method("BYE")) {<br>
setflag(FLT_ACC); # do accounting ...<br>
setflag(FLT_ACCFAILED); # ... even if the
transaction fails<br>
} else if ( is_method("ACK") ) {<br>
# ACK is forwarded statelessly<br>
route(NATMANAGE);<br>
<b>} else if ( is_method("NOTIFY") ) {</b><b><br>
</b><b> # Add Record-Route for in-dialog
NOTIFY as per RFC 6665.</b><b><br>
</b><b> record_route();</b><b><br>
</b><b> }</b><br>
route(RELAY);<br>
exit;<br>
}<br>
</p>
<pre class="moz-signature" cols="72">---
I'm SoCIaL, MayBe</pre>
<div class="moz-cite-prefix">El 7/09/2022 a las 12:01 a. m., Jerry
Kendall escribió:<br>
</div>
<blockquote type="cite"
cite="mid:b2cb0117-768c-1037-84ee-7ecd3ead0cff@BishopHosting.com">
<br>
Hi There....
<br>
<br>
Hope someone can point me in the right direction.
<br>
<br>
<br>
The config below allows the device to register and will send the
200 OK without issue
<br>
<br>
It also allows the SUBSCRIBES to get in and a 202 Accepted is
returned properly.
<br>
<br>
It also allows the device to send OPTION keepalives and they get
in/out OK
<br>
<br>
<br>
The issue I am having at the moment is the outbount NOTIFY ofr the
SUBS and outbound OPTIONS for heartbeat.
<br>
<br>
<br>
Can someone please point me at what I need to change so the
OUTBOUND messages get delivered.
<br>
<br>
<br>
The issue I see is NAT related as the devices are behind firewalls
at location A.
<br>
<br>
The Kamailio system and the inner PBX are all on Public IP.
<br>
<br>
<br>
<br>
################
<br>
<br>
debug=3
<br>
memdbg=5
<br>
memlog=5
<br>
<br>
log_facility=LOG_LOCAL0
<br>
<br>
fork=yes
<br>
children=4
<br>
<br>
listen=udp:192.168.1.3:8081
<br>
port=8081
<br>
<br>
#!define FLAG_FROM_SWITCH 1
<br>
#!define FLAG_FROM_DEVICE 2
<br>
<br>
mpath="/usr/lib/x86_64-linux-gnu/kamailio/modules/"
<br>
loadmodule "tm.so"
<br>
loadmodule "sl.so"
<br>
loadmodule "pv.so"
<br>
loadmodule "rr.so"
<br>
loadmodule "textops.so"
<br>
loadmodule "textopsx.so"
<br>
loadmodule "usrloc.so"
<br>
loadmodule "xlog.so"
<br>
loadmodule "path.so"
<br>
loadmodule "nathelper.so"
<br>
loadmodule "siputils.so"
<br>
<br>
# ----- nathelper params -----
<br>
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
<br>
<br>
<br>
####### Routing Logic ########
<br>
<br>
request_route {
<br>
<br>
route(CHECK_SOURCE_IP);
<br>
<br>
# CANCEL processing
<br>
if (is_method("CANCEL")) {
<br>
if (t_check_trans()) {
<br>
route(RELAY);
<br>
}
<br>
exit;
<br>
}
<br>
<br>
route(WITHINDLG);
<br>
<br>
t_check_trans();
<br>
<br>
if( is_method("OPTIONS") ) {
<br>
t_relay();
<br>
}
<br>
<br>
if( is_method("REGISTER|SUBSCRIBE") ) {
<br>
add_path();
<br>
}
<br>
<br>
if( is_method("INVITE|REFER") ) {
<br>
record_route();
<br>
}
<br>
<br>
if( isflagset(FLAG_FROM_SWITCH) ) {
<br>
t_on_reply("OUTBOUND_REPLY");
<br>
} else {
<br>
$du = <a class="moz-txt-link-rfc2396E" href="sip:192.168.3.3:5060">"sip:192.168.3.3:5060"</a>;
<br>
}
<br>
<br>
route(RELAY);
<br>
}
<br>
<br>
# SIP dialogs
<br>
route[WITHINDLG] {
<br>
<br>
if (has_totag()) {
<br>
# sequential request withing a dialog should
<br>
# take the path determined by record-routing
<br>
if (loose_route()) {
<br>
route(RELAY);
<br>
} else {
<br>
if (is_method("NOTIFY")) {
<br>
route(RELAY);
<br>
}
<br>
if (is_method("SUBSCRIBE") && uri == myself) {
<br>
# in-dialog subscribe requests
<br>
exit;
<br>
}
<br>
if (is_method("ACK")) {
<br>
if (t_check_trans()) {
<br>
# no loose-route, but stateful ACK;
<br>
# must be an ACK after a 487
<br>
# or e.g. 404 from upstream server
<br>
t_relay();
<br>
exit;
<br>
} else {
<br>
# ACK without matching transaction ... ignore
and discard
<br>
#xlog("ACK without matching transaction ...
ignore and discard");
<br>
exit;
<br>
}
<br>
}
<br>
sl_send_reply("404","Not here");
<br>
}
<br>
exit;
<br>
}
<br>
}
<br>
<br>
onreply_route[OUTBOUND_REPLY]
<br>
{
<br>
route(NAT_TEST_AND_CORRECT);
<br>
}
<br>
<br>
route[NAT_TEST_AND_CORRECT]
<br>
{
<br>
if (nat_uac_test("3")) {
<br>
if (is_method("REGISTER|SUBSCRIBE")) {
<br>
fix_nated_register();
<br>
} else {
<br>
fix_nated_contact();
<br>
}
<br>
force_rport();
<br>
}
<br>
<br>
if (has_body("application/sdp") && nat_uac_test("8"))
{
<br>
fix_nated_sdp("10");
<br>
}
<br>
}
<br>
<br>
route[RELAY]
<br>
{
<br>
if (!t_relay()) {
<br>
sl_reply_error();
<br>
}
<br>
exit;
<br>
}
<br>
<br>
route[LOGIT] {
<br>
<br>
xlog("L_INFO", "LOGIT: $var(spot) - $rm");
<br>
<br>
if( $ft == $null )
<br>
xlog("L_INFO", "LOGIT: $var(spot) - From:$fU @ $fd - $fu");
<br>
else
<br>
xlog("L_INFO", "LOGIT: $var(spot) - From:$fU @ $fd -
$fu:$ft");
<br>
<br>
if( $tt == $null )
<br>
xlog("L_INFO", "LOGIT: $var(spot) - To:$tU @ $td - $tu");
<br>
else
<br>
xlog("L_INFO", "LOGIT: $var(spot) - To:$tU @ $td -
$tu:$tt");
<br>
<br>
xlog("L_INFO", "LOGIT: $var(spot) - REQ:$rm @ $ru");
<br>
xlog("L_INFO", "LOGIT: $var(spot) -
ACT:$(rd{s.select,0,.})");
<br>
xlog("L_INFO", "LOGIT: $var(spot) -
HST:$(rd{s.select,1,.})");
<br>
xlog("L_INFO", "LOGIT: $var(spot) - CNT:$ct");
<br>
xlog("L_INFO", "LOGIT: $var(spot) - UAC:$ua");
<br>
<br>
if( $du != $null )
<br>
xlog("L_INFO", "LOGIT: $var(spot) - DURI:$du");
<br>
}
<br>
<br>
route[CHECK_SOURCE_IP]
<br>
{
<br>
$var(spot) = 'CHECK_SOURCE_IP';
<br>
route(LOGIT);
<br>
<br>
switch($si) {
<br>
case "192.168.3.2":
<br>
setflag(FLAG_FROM_SWITCH);
<br>
return;
<br>
default:
<br>
setflag(FLAG_FROM_DEVICE);
<br>
return;
<br>
}
<br>
}
<br>
<br>
<br>
<br>
<br>
__________________________________________________________
<br>
Kamailio - Users Mailing List - Non Commercial Discussions
<br>
* <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<br>
Important: keep the mailing list in the recipients, do not reply
only to the sender!
<br>
Edit mailing list options or unsubscribe:
<br>
* <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
<br>
</blockquote>
</body>
</html>