Changeset 368 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
- Timestamp:
- Mar 30, 2006 4:46:36 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r350 r368 99 99 100 100 /* Close and reopen socket. */ 101 static pj_status_t reopen_sock( pj_sock_t *sock) 102 { 103 pj_sockaddr_in addr; 104 int addrlen; 101 static pj_status_t reopen_sock( pj_sock_t *sock, pj_sockaddr_in *addr) 102 { 105 103 pj_status_t status; 106 107 addrlen = sizeof(pj_sockaddr_in);108 status = pj_sock_getsockname(*sock, &addr, &addrlen);109 if (status != PJ_SUCCESS) {110 pjsua_perror(THIS_FILE, "Error getting RTP/RTCP socket name", status);111 return status;112 }113 114 pj_sock_close(*sock);115 104 116 105 status = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, sock); … … 120 109 } 121 110 122 status = pj_sock_bind(*sock, &addr, sizeof(pj_sockaddr_in));111 status = pj_sock_bind(*sock, addr, sizeof(pj_sockaddr_in)); 123 112 if (status != PJ_SUCCESS) { 124 113 pjsua_perror(THIS_FILE, "Unable to re-bind RTP/RTCP socket", status); … … 142 131 143 132 if (call->session) { 133 pj_sockaddr_in rtp_addr, rtcp_addr; 134 int addrlen; 135 136 addrlen = sizeof(rtp_addr); 137 pj_sock_getsockname(call->skinfo.rtp_sock, &rtp_addr, &addrlen); 138 139 addrlen = sizeof(rtcp_addr); 140 pj_sock_getsockname(call->skinfo.rtcp_sock, &rtcp_addr, &addrlen); 141 142 /* Destroy session (this will also close RTP/RTCP sockets). */ 143 pjmedia_session_destroy(call->session); 144 144 145 145 /* Close and reopen RTP socket. … … 147 147 * when IOCompletionPort is used. 148 148 */ 149 reopen_sock(&call->skinfo.rtp_sock );149 reopen_sock(&call->skinfo.rtp_sock, &rtp_addr); 150 150 151 151 /* Close and reopen RTCP socket too. */ 152 reopen_sock(&call->skinfo.rtcp_sock); 153 154 /* Must destroy session after socket is closed. */ 155 pjmedia_session_destroy(call->session); 152 reopen_sock(&call->skinfo.rtcp_sock, &rtcp_addr); 153 156 154 call->session = NULL; 157 155
Note: See TracChangeset
for help on using the changeset viewer.