Module: sip-router
Branch: pd/outbound
Commit: 9a4afeecf8d1166533fefd4df2afc850a44c9ec3
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9a4afee…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Wed Mar 13 16:57:11 2013 +0000
Merge branch 'master' into outbound
* master: (68 commits)
modules/permissions: DNS domain names in address table
modules/app_java - New module app_java: Java Native Interface support.
nathelper: Decrease ambiguity by renaming sipping_disable_bflag to natping_disable_bflag
registrar: New set_q_override function
parser,modules/pv,modules/sipcapture: Improved parsing of P-Asserted/Preferred-Identity headers
Makefile.dirs: updated the list with module directories
NEWS Update with reference to Wiki
INSTALL update for release
README - last minute small edits
tm: set proper buffer len when Max-Forward header is not added
core: try to detect ipv6 addresses only when USE_IPV6 is used
pkg: deb specs updated for v4.0.0
INSTALL: updates for v4.0.0
ChangeLog_k: removed obsolete file
ChangeLog: updated content to prepare for v4.0.0
sca: fix regression dropping Expires header from SUBSCRIBE replies.
sca: move SUBSCRIBE response handling to sca_subscription_reply
sca: reject out-of-dialog attempts to seize privately held call.
sca: make sca_reply a generic reply function.
pkg/kamailio/(centos|fedora): added docbook2X build requirement
...
Conflicts:
modules/registrar/save.h
---
usrloc has this var:
3.1. nat_bflag (integer)
The index of the branch flag to be used as NAT marker (if the contact
is or not natted). This is a branch flag and it will be imported and
used by all other modules depending of usrloc module.
it is a fine flag telling that a particular contact is behind nat, but
it does not tell if that particular contact should be nat pinged.
nathelper has this var:
4.3. ping_nated_only (integer)
If this variable is set then only contacts that have "behind_NAT" flag
in user location database set will get ping.
that is not a good var, because not contacts that are behind nat
(e.g. ones that use tcp or outbound) need to be pinged.
now in master a new nathelper var was introduced (i guess for solving
the above problem):
4.10. natping_disable_bflag (integer)
What branch flag should be used by the module to disable NAT pings on a
per-registration basis. If the given flag is set for a particular
registration, then no NAT pings will be sent at all, regardless of any
other conditions.
i my opinion this solution is not good, because it complicates the
decision process by requiring that two flags need to be checked in order
to determine if a contact should be nat pinged.
i would have liked to solve this problem by introducing a new nathelper
var "nat ping this contact bflag" that tells which bflag to check when
deciding if a contact should be nat pinged. that bflag would then be
set before registrar save() is called in addition to setting the "behind
nat" bflag.
in my opinion there should have been discussion on this list before the
natping_disable_bflag was introduced.
also, for the benefit of db only usrloc, i would like to add a new "nat
ping" column to location table, which tells if the contact should be nat
pinged and if so how the pinging should be done.
comments or should i just go ahead with the plan?
-- juha
Module: sip-router
Branch: master
Commit: 93b2b3ba7951bc84a208fb296b3c7b4e52516389
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=93b2b3b…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: Tue Mar 12 09:43:57 2013 -0400
nathelper: Decrease ambiguity by renaming sipping_disable_bflag to natping_disable_bflag
---
modules/nathelper/README | 60 ++++++++++++++--------------
modules/nathelper/doc/nathelper_admin.xml | 44 ++++++++++----------
modules/nathelper/nathelper.c | 8 ++--
3 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/modules/nathelper/README b/modules/nathelper/README
index 6328cb8..da8523b 100644
--- a/modules/nathelper/README
+++ b/modules/nathelper/README
@@ -53,9 +53,9 @@ Ovidiu Sas
4.5. natping_socket (string)
4.6. received_avp (str)
4.7. sipping_bflag (integer)
- 4.8. sipping_disable_bflag (integer)
- 4.9. sipping_from (string)
- 4.10. sipping_method (string)
+ 4.8. sipping_from (string)
+ 4.9. sipping_method (string)
+ 4.10. natping_disable_bflag (integer)
4.11. nortpproxy_str (string)
4.12. keepalive_timeout (int)
@@ -94,9 +94,9 @@ Ovidiu Sas
1.5. Set natping_socket parameter
1.6. Set received_avp parameter
1.7. Set sipping_bflag parameter
- 1.8. Set sipping_disable_bflag parameter
- 1.9. Set sipping_from parameter
- 1.10. Set sipping_method parameter
+ 1.8. Set sipping_from parameter
+ 1.9. Set sipping_method parameter
+ 1.10. Set natping_disable_bflag parameter
1.11. Set nortpproxy_str parameter
1.12. Set keepalive_timeout parameter
1.13. fix_nated_contact usage
@@ -130,9 +130,9 @@ Chapter 1. Admin Guide
4.5. natping_socket (string)
4.6. received_avp (str)
4.7. sipping_bflag (integer)
- 4.8. sipping_disable_bflag (integer)
- 4.9. sipping_from (string)
- 4.10. sipping_method (string)
+ 4.8. sipping_from (string)
+ 4.9. sipping_method (string)
+ 4.10. natping_disable_bflag (integer)
4.11. nortpproxy_str (string)
4.12. keepalive_timeout (int)
@@ -229,9 +229,9 @@ Chapter 1. Admin Guide
4.5. natping_socket (string)
4.6. received_avp (str)
4.7. sipping_bflag (integer)
- 4.8. sipping_disable_bflag (integer)
- 4.9. sipping_from (string)
- 4.10. sipping_method (string)
+ 4.8. sipping_from (string)
+ 4.9. sipping_method (string)
+ 4.10. natping_disable_bflag (integer)
4.11. nortpproxy_str (string)
4.12. keepalive_timeout (int)
@@ -335,21 +335,7 @@ modparam("nathelper", "received_avp", "$avp(i:42)")
modparam("nathelper", "sipping_bflag", 7)
...
-4.8. sipping_disable_bflag (integer)
-
- What branch flag should be used by the module to disable NAT pings on a
- per-registration basis. If the given flag is set for a particular
- registration, then no NAT pings will be sent at all, regardless of any
- other conditions.
-
- Default value is -1 (disabled).
-
- Example 1.8. Set sipping_disable_bflag parameter
-...
-modparam("nathelper", "sipping_disable_bflag", 8)
-...
-
-4.9. sipping_from (string)
+4.8. sipping_from (string)
The parameter sets the SIP URI to be used in generating the SIP
requests for NAT ping purposes. To enable the SIP request pinging
@@ -358,23 +344,37 @@ modparam("nathelper", "sipping_disable_bflag", 8)
Default value is “NULL”.
- Example 1.9. Set sipping_from parameter
+ Example 1.8. Set sipping_from parameter
...
modparam("nathelper", "sipping_from", "sip:pinger@siphub.net")
...
-4.10. sipping_method (string)
+4.9. sipping_method (string)
The parameter sets the SIP method to be used in generating the SIP
requests for NAT ping purposes.
Default value is “OPTIONS”.
- Example 1.10. Set sipping_method parameter
+ Example 1.9. Set sipping_method parameter
...
modparam("nathelper", "sipping_method", "INFO")
...
+4.10. natping_disable_bflag (integer)
+
+ What branch flag should be used by the module to disable NAT pings on a
+ per-registration basis. If the given flag is set for a particular
+ registration, then no NAT pings will be sent at all, regardless of any
+ other conditions.
+
+ Default value is -1 (disabled).
+
+ Example 1.10. Set natping_disable_bflag parameter
+...
+modparam("nathelper", "natping_disable_bflag", 8)
+...
+
4.11. nortpproxy_str (string)
The parameter sets the SDP attribute used by nathelper to mark the
diff --git a/modules/nathelper/doc/nathelper_admin.xml b/modules/nathelper/doc/nathelper_admin.xml
index 642bf63..e052eb9 100644
--- a/modules/nathelper/doc/nathelper_admin.xml
+++ b/modules/nathelper/doc/nathelper_admin.xml
@@ -286,28 +286,6 @@ modparam("nathelper", "sipping_bflag", 7)
</example>
</section>
<section>
- <title><varname>sipping_disable_bflag</varname> (integer)</title>
- <para>
- What branch flag should be used by the module to disable NAT pings
- on a per-registration basis. If the given flag is set for a
- particular registration, then no NAT pings will be sent at all,
- regardless of any other conditions.
- </para>
- <para>
- <emphasis>
- Default value is -1 (disabled).
- </emphasis>
- </para>
- <example>
- <title>Set <varname>sipping_disable_bflag</varname> parameter</title>
- <programlisting format="linespecific">
-...
-modparam("nathelper", "sipping_disable_bflag", 8)
-...
-</programlisting>
- </example>
- </section>
- <section>
<title><varname>sipping_from</varname> (string)</title>
<para>
The parameter sets the SIP URI to be used in generating the SIP
@@ -350,6 +328,28 @@ modparam("nathelper", "sipping_method", "INFO")
</example>
</section>
<section>
+ <title><varname>natping_disable_bflag</varname> (integer)</title>
+ <para>
+ What branch flag should be used by the module to disable NAT pings
+ on a per-registration basis. If the given flag is set for a
+ particular registration, then no NAT pings will be sent at all,
+ regardless of any other conditions.
+ </para>
+ <para>
+ <emphasis>
+ Default value is -1 (disabled).
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>natping_disable_bflag</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("nathelper", "natping_disable_bflag", 8)
+...
+</programlisting>
+ </example>
+ </section>
+ <section>
<title><varname>nortpproxy_str</varname> (string)</title>
<para>
The parameter sets the SDP attribute used by nathelper to mark
diff --git a/modules/nathelper/nathelper.c b/modules/nathelper/nathelper.c
index b170ecc..0c1c677 100644
--- a/modules/nathelper/nathelper.c
+++ b/modules/nathelper/nathelper.c
@@ -339,7 +339,7 @@ static const char sbuf[4] = {0, 0, 0, 0};
static char *force_socket_str = 0;
static pid_t mypid;
static int sipping_flag = -1;
-static int sipping_disable_flag = -1;
+static int natping_disable_flag = -1;
static int natping_processes = 1;
static str nortpproxy_str = str_init("a=nortpproxy:yes");
@@ -413,7 +413,7 @@ static param_export_t params[] = {
{"sipping_from", STR_PARAM, &sipping_from.s },
{"sipping_method", STR_PARAM, &sipping_method.s },
{"sipping_bflag", INT_PARAM, &sipping_flag },
- {"sipping_disable_bflag", INT_PARAM, &sipping_disable_flag },
+ {"natping_disable_bflag", INT_PARAM, &natping_disable_flag },
{"natping_processes", INT_PARAM, &natping_processes },
{"natping_socket", STR_PARAM, &natping_socket },
{"keepalive_timeout", INT_PARAM, &nh_keepalive_timeout },
@@ -678,7 +678,7 @@ mod_init(void)
}
sipping_flag = (sipping_flag==-1)?0:(1<<sipping_flag);
- sipping_disable_flag = (sipping_disable_flag==-1)?0:(1<<sipping_disable_flag);
+ natping_disable_flag = (natping_disable_flag==-1)?0:(1<<natping_disable_flag);
/* set reply function if SIP natping is enabled */
if (sipping_flag) {
@@ -1997,7 +1997,7 @@ nh_timer(unsigned int ticks, void *timer_idx)
memcpy( &aorhash, cp, sizeof(aorhash));
cp = (char*)cp + sizeof(aorhash);
- if ((flags & sipping_disable_flag)) /* always 0 if sipping_disable_flag not set */
+ if ((flags & natping_disable_flag)) /* always 0 if natping_disable_flag not set */
continue;
/* determin the destination */