summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-04-04 10:50:21 +0000
committerBenny Prijono <bennylp@teluu.com>2008-04-04 10:50:21 +0000
commit43990d32dc2d14e946c2b93d0810b33e87424d0a (patch)
tree0f64f5e9d8a841387f8b83838ce70ea7b757248d /pjsip
parentcd09b24e19e5865a08ace989a367ec5c71ca2c1a (diff)
Ticket #522: Enable keep-alive for UDP transport even when STUN is not configured
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1908 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h5
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c13
2 files changed, 11 insertions, 7 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 33deb388..4890a87b 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -2045,11 +2045,6 @@ typedef struct pjsua_acc_config
* The keep-alive transmission will be sent to the registrar's address,
* after successful registration.
*
- * Even if this setting is enabled, keep-alive transmission is only done
- * when STUN is enabled in the global #pjsua_config, and the transport
- * used for registration is UDP. For TCP and TLS transports, keep-alive
- * is done by the transport themselves.
- *
* Default: 15 (seconds)
*/
unsigned ka_interval;
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index e5b18ed1..2258cdd9 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -777,11 +777,20 @@ static void update_keep_alive(pjsua_acc *acc, pj_bool_t start,
pj_status_t status;
/* Only do keep-alive if:
- * - STUN is enabled in global config, and
* - ka_interval is not zero in the account, and
* - transport is UDP.
+ *
+ * Previously we only enabled keep-alive when STUN is enabled, since
+ * we thought that keep-alive is only needed in Internet situation.
+ * But it has been discovered that Windows Firewall on WinXP also
+ * needs to be kept-alive, otherwise incoming packets will be dropped.
+ * So because of this, now keep-alive is always enabled for UDP,
+ * regardless of whether STUN is enabled or not.
+ *
+ * Note that this applies only for UDP. For TCP/TLS, the keep-alive
+ * is done by the transport layer.
*/
- if (pjsua_var.stun_srv.ipv4.sin_family == 0 ||
+ if (/*pjsua_var.stun_srv.ipv4.sin_family == 0 ||*/
acc->cfg.ka_interval == 0 ||
param->rdata->tp_info.transport->key.type != PJSIP_TRANSPORT_UDP)
{