- Timestamp:
- Apr 3, 2018 5:01:20 AM (7 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsua-lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r5768 r5774 23 23 24 24 #define THIS_FILE "pjsua_core.c" 25 26 #define DEFAULT_RTP_PORT 4000 25 27 26 28 … … 289 291 #endif 290 292 pjsua_transport_config_default(&cfg->rtp_cfg); 293 cfg->rtp_cfg.port = DEFAULT_RTP_PORT; 291 294 292 295 pjsua_media_config_default(&med_cfg); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5755 r5774 24 24 #define THIS_FILE "pjsua_media.c" 25 25 26 #define DEFAULT_RTP_PORT 400027 28 26 #ifndef PJSUA_REQUIRE_CONSECUTIVE_RTCP_PORT 29 27 # define PJSUA_REQUIRE_CONSECUTIVE_RTCP_PORT 0 … … 268 266 } 269 267 270 if (acc->next_rtp_port == 0 )268 if (acc->next_rtp_port == 0 || cfg->port == 0) 271 269 acc->next_rtp_port = (pj_uint16_t)cfg->port; 272 273 if (acc->next_rtp_port == 0)274 acc->next_rtp_port = (pj_uint16_t)DEFAULT_RTP_PORT;275 270 276 271 for (i=0; i<2; ++i) … … 321 316 sock[0] = PJ_INVALID_SOCKET; 322 317 continue; 318 } 319 320 /* If bound to random port, find out the port number. */ 321 if (acc->next_rtp_port == 0) { 322 pj_sockaddr sock_addr; 323 int addr_len = sizeof(pj_sockaddr); 324 325 status = pj_sock_getsockname(sock[0], &sock_addr, &addr_len); 326 if (status != PJ_SUCCESS) { 327 pjsua_perror(THIS_FILE, "getsockname() error", status); 328 pj_sock_close(sock[0]); 329 return status; 330 } 331 acc->next_rtp_port = pj_sockaddr_get_port(&sock_addr); 323 332 } 324 333
Note: See TracChangeset
for help on using the changeset viewer.