Discussion:
[SR-Users] NATMANAGE quirks
aft
2014-10-21 12:29:14 UTC
Permalink
Hi,

I'm trying to re packet rtp streams based on Destination IP. I've
implemented it like below :

route[NATMANAGE] {
#!ifdef WITH_NAT
if (is_request()) {
if(has_totag()) {
if(check_route_param("nat=yes")) {
setbflag(FLB_NATB);
}
}
}
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;
if (is_request()) {
if (!has_totag()) {
add_rr_param(";nat=yes");
}
xlog("Destination [$du]...");
if ($du == "108.59.14.153")
rtpproxy_manage("coz20");
else
rtpproxy_manage("coz100");
}
if (is_reply()) {
if(isbflagset(FLB_NATB)) {

fix_nated_contact();
}
rtpproxy_manage("coz100");
}
#!endif
return;
}

But its not working, and the log comes up like :

Oct 21 08:12:33 srv4617 /usr/local/sbin/kamailio[28346]: ERROR: <script>:
Destination...... <null>
Daniel-Constantin Mierla
2014-10-21 14:38:57 UTC
Permalink
Hello,

the error message is what you printed from config and $du was not set.

If you want to troubleshoot better, set debug=3 in kamailio.cfg and
watch the log messages -- there will be plenty of them and you should
get a better idea of what happens there.

Cheers,
Daniel
Post by aft
Hi,
I'm trying to re packet rtp streams based on Destination IP. I've
route[NATMANAGE] {
#!ifdef WITH_NAT
if (is_request()) {
if(has_totag()) {
if(check_route_param("nat=yes")) {
setbflag(FLB_NATB);
}
}
}
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;
if (is_request()) {
if (!has_totag()) {
add_rr_param(";nat=yes");
}
xlog("Destination [$du]...");
if ($du == "108.59.14.153")
rtpproxy_manage("coz20");
else
rtpproxy_manage("coz100");
}
if (is_reply()) {
if(isbflagset(FLB_NATB)) {
fix_nated_contact();
}
rtpproxy_manage("coz100");
}
#!endif
return;
}
<script>: Destination...... <null>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
aft
2014-10-22 11:53:10 UTC
Permalink
Post by Daniel-Constantin Mierla
Hello,
the error message is what you printed from config and $du was not set.
If you want to troubleshoot better, set debug=3 in kamailio.cfg and watch
the log messages -- there will be plenty of them and you should get a
better idea of what happens there.
When $du is set? I mean if it's set elsewhere, i can save it in a variable
and then use it in NATMANAGE route
Post by Daniel-Constantin Mierla
Cheers,
Daniel
Hi,
I'm trying to re packet rtp streams based on Destination IP. I've
route[NATMANAGE] {
#!ifdef WITH_NAT
if (is_request()) {
if(has_totag()) {
if(check_route_param("nat=yes")) {
setbflag(FLB_NATB);
}
}
}
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;
if (is_request()) {
if (!has_totag()) {
add_rr_param(";nat=yes");
}
xlog("Destination [$du]...");
if ($du == "108.59.14.153")
rtpproxy_manage("coz20");
else
rtpproxy_manage("coz100");
}
if (is_reply()) {
if(isbflagset(FLB_NATB)) {
fix_nated_contact();
}
rtpproxy_manage("coz100");
}
#!endif
return;
}
<script>: Destination...... <null>
_______________________________________________
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...