mirror of
				https://github.com/fairwaves/OpenBTS-UMTS.git
				synced 2025-11-03 20:53:13 +00:00 
			
		
		
		
	automatically detect which ORTP library is present and API to use
This commit is contained in:
		@@ -751,7 +751,11 @@ void SIPEngine::InitRTP(const osip_message_t * msg )
 | 
			
		||||
	get_rtp_params(msg, d_port, d_ip_addr);
 | 
			
		||||
	LOG(DEBUG) << "IP="<<d_ip_addr<<" "<<d_port<<" "<<mRTPPort;
 | 
			
		||||
 | 
			
		||||
	rtp_session_set_local_addr(mSession, "0.0.0.0", mRTPPort );
 | 
			
		||||
#ifdef ORTP_NEW_API
 | 
			
		||||
	rtp_session_set_local_addr(mSession, "0.0.0.0", mRTPPort, -1);
 | 
			
		||||
#else
 | 
			
		||||
	rtp_session_set_local_addr(mSession, "0.0.0.0", mRTPPort);
 | 
			
		||||
#endif
 | 
			
		||||
	rtp_session_set_remote_addr(mSession, d_ip_addr, atoi(d_port));
 | 
			
		||||
 | 
			
		||||
	// Check for event support.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								config/test_ortp_version.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								config/test_ortp_version.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
#include <ortp/ortp.h>
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
	RtpSession * mSession;
 | 
			
		||||
	mSession = rtp_session_new(RTP_SESSION_SENDRECV);
 | 
			
		||||
	rtp_session_set_local_addr(mSession, "0.0.0.0", -1, -1);
 | 
			
		||||
}
 | 
			
		||||
@@ -73,6 +73,12 @@ PKG_CHECK_MODULES(OSIP, libosip2)
 | 
			
		||||
 | 
			
		||||
# Defines ORTP_CFLAGS, ORTP_INCLUDEDIR, and ORTP_LIBS
 | 
			
		||||
PKG_CHECK_MODULES(ORTP, ortp)
 | 
			
		||||
AC_MSG_CHECKING([ortp api version])
 | 
			
		||||
AS_IF([gcc -I=/usr/local/include -o config/test_ortp_version config/test_ortp_version.cpp -lortp &> /dev/null], [
 | 
			
		||||
	AC_DEFINE(ORTP_NEW_API, 1, rtp_session_set_local_addr takes four arguments)
 | 
			
		||||
	AC_MSG_RESULT([>= 0.22.0])
 | 
			
		||||
	],
 | 
			
		||||
	[AC_MSG_RESULT([< 0.22.0])])
 | 
			
		||||
 | 
			
		||||
# Defines LIBUSB_TRANSFER_CANCELLED, LIBUSB_TRANSFER_COMPLETED, LIBUSB_SUCCESS, LIBUSB_ERROR_*
 | 
			
		||||
PKG_CHECK_MODULES(LIBUSB, libusb-1.0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user