Changeset 4262 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
- Timestamp:
- Sep 20, 2012 6:00:23 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r4224 r4262 2068 2068 pjsip_tpfactory *tcp; 2069 2069 pjsip_tcp_transport_cfg tcp_cfg; 2070 2071 pjsip_tcp_transport_cfg_default(&tcp_cfg, pj_AF_INET()); 2070 int af; 2071 2072 af = (type==PJSIP_TRANSPORT_TCP6) ? pj_AF_INET6() : pj_AF_INET(); 2073 pjsip_tcp_transport_cfg_default(&tcp_cfg, af); 2072 2074 2073 2075 /* Supply default config if it's not specified */ … … 2119 2121 2120 2122 #if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 2121 } else if (type == PJSIP_TRANSPORT_TLS ) {2123 } else if (type == PJSIP_TRANSPORT_TLS || type == PJSIP_TRANSPORT_TLS6) { 2122 2124 /* 2123 2125 * Create TLS transport. … … 2126 2128 pjsip_host_port a_name; 2127 2129 pjsip_tpfactory *tls; 2128 pj_sockaddr_in local_addr; 2130 pj_sockaddr local_addr; 2131 int af; 2129 2132 2130 2133 /* Supply default config if it's not specified */ … … 2136 2139 2137 2140 /* Init local address */ 2138 pj_sockaddr_in_init(&local_addr, 0, 0); 2141 af = (type==PJSIP_TRANSPORT_TLS) ? pj_AF_INET() : pj_AF_INET6(); 2142 pj_sockaddr_init(af, &local_addr, NULL, 0); 2139 2143 2140 2144 if (cfg->port) 2141 local_addr.sin_port = pj_htons((pj_uint16_t)cfg->port);2145 pj_sockaddr_set_port(&local_addr, (pj_uint16_t)cfg->port); 2142 2146 2143 2147 if (cfg->bound_addr.slen) { 2144 status = pj_sockaddr_in_set_str_addr(&local_addr,&cfg->bound_addr); 2148 status = pj_sockaddr_set_str_addr(af, &local_addr, 2149 &cfg->bound_addr); 2145 2150 if (status != PJ_SUCCESS) { 2146 2151 pjsua_perror(THIS_FILE, … … 2156 2161 a_name.host = cfg->public_addr; 2157 2162 2158 status = pjsip_tls_transport_start (pjsua_var.endpt,2159 &cfg->tls_setting,2160 &local_addr, &a_name, 1, &tls);2163 status = pjsip_tls_transport_start2(pjsua_var.endpt, 2164 &cfg->tls_setting, 2165 &local_addr, &a_name, 1, &tls); 2161 2166 if (status != PJ_SUCCESS) { 2162 2167 pjsua_perror(THIS_FILE, "Error creating SIP TLS listener",
Note: See TracChangeset
for help on using the changeset viewer.