summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-11-11 03:06:07 +0000
committerBenny Prijono <bennylp@teluu.com>2007-11-11 03:06:07 +0000
commit7db1a90c803773329c197efca016faf8dfbd71c9 (patch)
treed60797179f99af128a024feffdb269de713dbdc6
parent3479323dfeee8e74b90a7c9a4b561799828991bd (diff)
Do not resolve SIP address with STUN if public address is configured
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1571 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsua-lib/pjsua_core.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
index 472df637..578425e2 100644
--- a/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
@@ -1240,7 +1240,15 @@ static pj_status_t create_sip_udp_sock(pj_in_addr bound_addr,
/* Get the published address, either by STUN or by resolving
* the name of local host.
*/
- if (stun_srv.slen) {
+ if (p_pub_addr->sin_addr.s_addr != 0) {
+ /*
+ * Public address is already specified, no need to resolve the
+ * address, only set the port.
+ */
+ if (p_pub_addr->sin_port == 0)
+ p_pub_addr->sin_port = pj_htons((pj_uint16_t)port);
+
+ } else if (stun_srv.slen) {
/*
* STUN is specified, resolve the address with STUN.
*/
@@ -1254,14 +1262,6 @@ static pj_status_t create_sip_udp_sock(pj_in_addr bound_addr,
return status;
}
- } else if (p_pub_addr->sin_addr.s_addr != 0) {
- /*
- * Public address is already specified, no need to resolve the
- * address, only set the port.
- */
- if (p_pub_addr->sin_port == 0)
- p_pub_addr->sin_port = pj_htons((pj_uint16_t)port);
-
} else {
pj_bzero(p_pub_addr, sizeof(pj_sockaddr_in));