Changeset 947 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
- Timestamp:
- Feb 14, 2007 2:36:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r941 r947 842 842 } 843 843 844 /* If port is zero, get the bound port */ 845 if (port == 0) { 846 pj_sockaddr_in bound_addr; 847 int namelen = sizeof(bound_addr); 848 status = pj_sock_getsockname(sock, &bound_addr, &namelen); 849 if (status != PJ_SUCCESS) { 850 pjsua_perror(THIS_FILE, "getsockname() error", status); 851 pj_sock_close(sock); 852 return status; 853 } 854 855 port = pj_ntohs(bound_addr.sin_port); 856 } 857 844 858 /* Copy and normalize STUN param */ 845 859 if (use_stun) { … … 874 888 * address, only set the port. 875 889 */ 876 /* Do nothing */ 890 if (p_pub_addr->sin_port == 0) 891 p_pub_addr->sin_port = pj_htons((pj_uint16_t)port); 877 892 878 893 } else {
Note: See TracChangeset
for help on using the changeset viewer.