Changeset 5327
- Timestamp:
- May 31, 2016 7:59:06 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r5326 r5327 2138 2138 pj_sockaddr_set_port(p_pub_addr, (pj_uint16_t)port); 2139 2139 2140 } else if (stun_srv.slen ) {2140 } else if (stun_srv.slen && af == pj_AF_INET()) { 2141 2141 pjstun_setting stun_opt; 2142 2142 2143 2143 /* 2144 2144 * STUN is specified, resolve the address with STUN. 2145 * Currently, this is available for IPv4 address only. 2145 2146 */ 2146 if (af != pj_AF_INET()) {2147 pjsua_perror(THIS_FILE, "Cannot use STUN", PJ_EAFNOTSUP);2148 pj_sock_close(sock);2149 return PJ_EAFNOTSUP;2150 }2151 2152 2147 pj_bzero(&stun_opt, sizeof(stun_opt)); 2153 2148 stun_opt.use_stun2 = pjsua_var.ua_cfg.stun_map_use_stun2; … … 2164 2159 2165 2160 } else { 2161 2166 2162 pj_bzero(p_pub_addr, sizeof(pj_sockaddr)); 2167 2163 … … 2179 2175 p_pub_addr->addr.sa_family = (pj_uint16_t)af; 2180 2176 pj_sockaddr_set_port(p_pub_addr, (pj_uint16_t)port); 2177 2178 if (stun_srv.slen && af != pj_AF_INET()) { 2179 /* STUN is specified, but it is not IPv4, just print warning */ 2180 PJ_PERROR(2, (THIS_FILE, PJ_EAFNOTSUP, 2181 "Cannot use STUN for SIP UDP socket %s:%d", 2182 addr_string(p_pub_addr), 2183 (int)pj_sockaddr_get_port(p_pub_addr))); 2184 } 2185 2181 2186 } 2182 2187
Note: See TracChangeset
for help on using the changeset viewer.