- Timestamp:
- May 17, 2009 6:37:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/sipit24/pjsip-apps/src/pjsua/pjsua_app.c
r2705 r2706 4721 4721 for (i=0; i<app_config.cfg.max_calls; ++i) { 4722 4722 enum { MAX_RETRY = 10 }; 4723 pj_sock_t sock[2]; 4724 pjmedia_sock_info si; 4723 4725 unsigned j; 4724 4726 … … 4727 4729 4728 4730 for (j=0; j<MAX_RETRY; ++j) { 4729 status = pjmedia_transport_udp_create3(pjsua_get_pjmedia_endpt(), 4730 pj_AF_INET6(), 4731 app_config.rtp_cfg.public_addr.ptr, 4732 &app_config.rtp_cfg.bound_addr, 4733 port, 4734 0, &tp[i].transport); 4735 4731 unsigned k; 4732 4733 for (k=0; k<2; ++k) { 4734 pj_sockaddr bound_addr; 4735 4736 status = pj_sock_socket(pj_AF_INET6(), pj_SOCK_DGRAM(), 0, &sock[k]); 4737 if (status != PJ_SUCCESS) 4738 break; 4739 4740 status = pj_sockaddr_init(pj_AF_INET6(), &bound_addr, 4741 &app_config.rtp_cfg.bound_addr, 4742 (unsigned short)(port+k)); 4743 if (status != PJ_SUCCESS) 4744 break; 4745 4746 status = pj_sock_bind(sock[k], &bound_addr, 4747 pj_sockaddr_get_len(&bound_addr)); 4748 if (status != PJ_SUCCESS) 4749 break; 4750 } 4751 if (status != PJ_SUCCESS) { 4752 if (k==1) 4753 pj_sock_close(sock[0]); 4754 4755 if (port != 0) 4756 port += 10; 4757 else 4758 break; 4759 4760 continue; 4761 } 4762 4763 pj_bzero(&si, sizeof(si)); 4764 si.rtp_sock = sock[0]; 4765 si.rtcp_sock = sock[1]; 4766 4767 pj_sockaddr_init(pj_AF_INET6(), &si.rtp_addr_name, 4768 &app_config.rtp_cfg.public_addr, 4769 (unsigned short)(port)); 4770 pj_sockaddr_init(pj_AF_INET6(), &si.rtcp_addr_name, 4771 &app_config.rtp_cfg.public_addr, 4772 (unsigned short)(port+1)); 4773 4774 status = pjmedia_transport_udp_attach(pjsua_get_pjmedia_endpt(), 4775 NULL, 4776 &si, 4777 0, 4778 &tp[i].transport); 4736 4779 if (port != 0) 4737 4780 port += 10;
Note: See TracChangeset
for help on using the changeset viewer.