Changeset 5877


Ignore:
Timestamp:
Sep 4, 2018 2:57:07 PM (6 years ago)
Author:
riza
Message:

Re #2049 (misc): Add local RTP/RTCP address information to MediaTransportInfo?.

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua2/call.hpp

    r5834 r5877  
    286286/** 
    287287 * This structure describes media transport informations. It corresponds to the 
    288  * pjmedia_transport_info structure. 
     288 * pjmedia_transport_info structure. The address name field can be empty string 
     289 * if the address in the pjmedia_transport_info is invalid. 
    289290 */ 
    290291struct MediaTransportInfo 
    291292{ 
    292293    /** 
    293      * Remote address where RTP originated from. 
     294     * Address to be advertised as the local address for the RTP socket,  
     295     * which does not need to be equal as the bound address (for example,  
     296     * this address can be the address resolved with STUN). 
     297     */ 
     298    SocketAddress   localRtpName; 
     299 
     300    /** 
     301     * Address to be advertised as the local address for the RTCP socket,  
     302     * which does not need to be equal as the bound address (for example,  
     303     * this address can be the address resolved with STUN). 
     304     */ 
     305    SocketAddress   localRtcpName; 
     306 
     307    /** 
     308     * Remote address where RTP originated from. This can be empty string if  
     309     * no data is received from the remote. 
    294310     */ 
    295311    SocketAddress   srcRtpName; 
    296312 
    297313    /** 
    298      * Remote address where RTCP originated from. 
     314     * Remote address where RTCP originated from. This can be empty string if  
     315     * no data is recevied from the remote. 
    299316     */ 
    300317    SocketAddress   srcRtcpName; 
  • pjproject/trunk/pjsip/src/pjsua2/call.cpp

    r5834 r5877  
    132132{ 
    133133    char straddr[PJ_INET6_ADDRSTRLEN+10]; 
    134      
    135     pj_sockaddr_print(&info.src_rtp_name, straddr, sizeof(straddr), 3); 
    136     srcRtpName = straddr; 
    137     pj_sockaddr_print(&info.src_rtcp_name, straddr, sizeof(straddr), 3); 
    138     srcRtcpName = straddr; 
     134    
     135    localRtpName = localRtcpName = srcRtpName = srcRtcpName = "";     
     136    if (pj_sockaddr_has_addr(&info.sock_info.rtp_addr_name)) {  
     137        pj_sockaddr_print(&info.sock_info.rtp_addr_name, straddr,  
     138                          sizeof(straddr), 3); 
     139        localRtpName = straddr; 
     140    } 
     141 
     142    if (pj_sockaddr_has_addr(&info.sock_info.rtcp_addr_name)) {  
     143        pj_sockaddr_print(&info.sock_info.rtcp_addr_name, straddr,  
     144                          sizeof(straddr), 3); 
     145        localRtcpName = straddr; 
     146    } 
     147 
     148    if (pj_sockaddr_has_addr(&info.src_rtp_name)) {      
     149        pj_sockaddr_print(&info.src_rtp_name, straddr, sizeof(straddr), 3); 
     150        srcRtpName = straddr; 
     151    } 
     152 
     153    if (pj_sockaddr_has_addr(&info.src_rtcp_name)) {  
     154        pj_sockaddr_print(&info.src_rtcp_name, straddr, sizeof(straddr), 3); 
     155        srcRtcpName = straddr; 
     156    } 
    139157} 
    140158 
Note: See TracChangeset for help on using the changeset viewer.