- Timestamp:
- Feb 22, 2006 10:23:22 PM (19 years ago)
- Location:
- pjproject/trunk/pjsip/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r212 r220 1275 1275 1276 1276 pjsip_tsx_terminate(inv->invite_tsx, 487); 1277 1278 return PJ SIP_ETSXDESTROYED;1277 *p_tdata = NULL; 1278 return PJ_SUCCESS; 1279 1279 } 1280 1280 -
pjproject/trunk/pjsip/src/pjsua/pjsua_core.c
r212 r220 150 150 }; 151 151 int i; 152 pj_uint16_t rtp_port;152 static pj_uint16_t rtp_port = RTP_START_PORT; 153 153 pj_sock_t sock[3]; 154 154 pj_sockaddr_in mapped_addr[3]; … … 158 158 sock[i] = PJ_INVALID_SOCKET; 159 159 160 /* Create and bind SIP UDP socket. */ 161 status = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, &sock[SIP_SOCK]); 162 if (status != PJ_SUCCESS) { 163 pjsua_perror(THIS_FILE, "socket() error", status); 164 goto on_error; 165 } 166 160 167 if (sip) { 161 /* Create and bind SIP UDP socket. */162 status = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, &sock[SIP_SOCK]);163 if (status != PJ_SUCCESS) {164 pjsua_perror(THIS_FILE, "socket() error", status);165 goto on_error;166 }167 168 168 status = pj_sock_bind_in(sock[SIP_SOCK], 0, pjsua.sip_port); 169 169 if (status != PJ_SUCCESS) { … … 171 171 goto on_error; 172 172 } 173 } 174 175 /* Initialize start of RTP port to try. */ 176 rtp_port = (pj_uint16_t)(RTP_START_PORT + (pj_rand() % RTP_RANDOM_START) / 2); 173 } else { 174 status = pj_sock_bind_in(sock[SIP_SOCK], 0, 0); 175 if (status != PJ_SUCCESS) { 176 pjsua_perror(THIS_FILE, "bind() error", status); 177 goto on_error; 178 } 179 } 180 177 181 178 182 /* Loop retry to bind RTP and RTCP sockets. */ … … 235 239 if (sip) 236 240 mapped_addr[SIP_SOCK].sin_port = pj_htons((pj_uint16_t)pjsua.sip_port); 237 else238 mapped_addr[RTP_SOCK].sin_port = pj_htons((pj_uint16_t)rtp_port);239 241 mapped_addr[RTP_SOCK].sin_port = pj_htons((pj_uint16_t)rtp_port); 240 242 mapped_addr[RTCP_SOCK].sin_port = pj_htons((pj_uint16_t)(rtp_port+1)); … … 266 268 pjsua.sip_sock = sock[SIP_SOCK]; 267 269 pj_memcpy(&pjsua.sip_sock_name, &mapped_addr[SIP_SOCK], sizeof(pj_sockaddr_in)); 270 } else { 271 pj_sock_close(sock[0]); 268 272 } 269 273 … … 288 292 pj_ntohs(skinfo->rtcp_addr_name.sin_port))); 289 293 294 rtp_port += 2; 290 295 return PJ_SUCCESS; 291 296 … … 455 460 } 456 461 462 /* Init PJLIB-UTIL: */ 463 464 status = pjlib_util_init(); 465 if (status != PJ_SUCCESS) { 466 pjsua_perror(THIS_FILE, "pjlib_util_init() error", status); 467 return status; 468 } 469 457 470 /* Init memory pool: */ 458 471 -
pjproject/trunk/pjsip/src/pjsua/pjsua_inv.c
r216 r220 833 833 } 834 834 835 /* pjsip_inv_end_session may return PJ_SUCCESS with NULL 836 * as p_tdata when INVITE transaction has not been answered 837 * with any provisional responses. 838 */ 839 if (tdata == NULL) 840 return; 841 835 842 status = pjsip_inv_send_msg(inv_session->inv, tdata, NULL); 836 843 if (status != PJ_SUCCESS) { … … 975 982 next = inv_data->next; 976 983 977 if (pjsip_inv_end_session(inv_data->inv, 410, NULL, &tdata)==0) 978 pjsip_inv_send_msg(inv_data->inv, tdata, NULL); 984 if (pjsip_inv_end_session(inv_data->inv, 410, NULL, &tdata)==0) { 985 if (tdata) 986 pjsip_inv_send_msg(inv_data->inv, tdata, NULL); 987 } 979 988 980 989 inv_data = next;
Note: See TracChangeset
for help on using the changeset viewer.