0. 필요 패키지 설치
sudo apt-get install libasound2-dev
1. 먼저 PJSIP 소스 다운로드
wget http://www.pjsip.org/release/2.6/pjproject-2.6.tar.bz2 tar -xf pjproject-2.6.tar.bz2 cd pjproject-2.6
2. pjlib/include/pj/config_site.h 파일에 아래와 같은 내용 추가
#define PJMEDIA_AUDIO_DEV_HAS_ALSA 1 #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
3. user.mak 파일 작성
export CFLAGS += -march=armv8-a -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -mlittle-endian -munaligned-access -ffast-math -fPIC export LDFLGS +=
4. third_party/build/os-auto.mak.in 파일의 내용을 아래의 내용으로 대치
ifneq (@ac_no_gsm_codec@,1) ifeq (@ac_external_gsm@,1) # External else DIRS += gsm endif endif ifneq (@ac_no_ilbc_codec@,1) DIRS += ilbc endif ifneq (@ac_no_speex_codec@,1) ifeq (@ac_external_speex@,1) # External speex else DIRS += speex endif endif ifneq (@ac_no_g7221_codec@,1) DIRS += g7221 endif ifneq ($(findstring pa,@ac_pjmedia_snd@),) ifeq (@ac_external_pa@,1) # External PA else #DIRS += portaudio endif endif ifeq (@ac_external_srtp@,1) # External SRTP else DIRS += srtp ifeq (@ac_ssl_has_aes_gcm@,0) CIPHERS_SRC = crypto/cipher/aes.o crypto/cipher/aes_icm.o \ crypto/cipher/aes_cbc.o HASHES_SRC = crypto/hash/sha1.o crypto/hash/hmac.o \ # crypto/hash/tmmhv2.o RNG_SRC = crypto/rng/rand_source.o crypto/rng/prng.o \ crypto/rng/ctr_prng.o else CIPHERS_SRC = crypto/cipher/aes_icm_ossl.o crypto/cipher/aes_gcm_ossl.o HASHES_SRC = crypto/hash/hmac_ossl.o RNG_SRC = crypto/rng/rand_source_ossl.o SRTP_OTHER_CFLAGS = -DOPENSSL endif endif ifeq (@ac_pjmedia_resample@,libresample) DIRS += resample endif ifneq (@ac_no_yuv@,1) ifeq (@ac_external_yuv@,1) # External yuv else DIRS += yuv endif endif ifneq (@ac_no_webrtc@,1) ifeq (@ac_external_webrtc@,1) # External webrtc else DIRS += webrtc WEBRTC_OTHER_CFLAGS = -fexceptions -DWEBRTC_POSIX=1 @ac_webrtc_cflags@ #ifneq ($(findstring sse2,@ac_webrtc_instset@),) # WEBRTC_SRC = \ # modules/audio_processing/aec/aec_core_sse2.o \ # modules/audio_processing/aec/aec_rdft_sse2.o \ # modules/audio_processing/aecm/aecm_core_c.o \ # modules/audio_processing/ns/nsx_core_c.o \ # system_wrappers/source/cpu_features.o #else ifneq ($(findstring neon,@ac_webrtc_instset@),) WEBRTC_SRC = \ modules/audio_processing/aec/aec_core_neon.o \ modules/audio_processing/aec/aec_rdft_neon.o \ modules/audio_processing/aecm/aecm_core_c.o \ modules/audio_processing/aecm/aecm_core_neon.o \ modules/audio_processing/ns/nsx_core_c.o \ modules/audio_processing/ns/nsx_core_neon.o \ common_audio/signal_processing/cross_correlation_neon.o \ common_audio/signal_processing/downsample_fast_neon.o \ common_audio/signal_processing/min_max_operations_neon.o WEBRTC_OTHER_CFLAGS += -DWEBRTC_HAS_NEON #else ifneq ($(findstring mips,@ac_webrtc_instset@),) # WEBRTC_SRC = \ # modules/audio_processing/aec/aec_core_mips.o \ # modules/audio_processing/aec/aec_rdft_mips.o \ # modules/audio_processing/aecm/aecm_core_mips.o \ # modules/audio_processing/ns/nsx_core_mips.o \ # common_audio/signal_processing/cross_correlation_mips.o \ # common_audio/signal_processing/downsample_fast_mips.o \ # common_audio/signal_processing/min_max_operations_mips.o # # WEBRTC_OTHER_CFLAGS += -DMIPS_FPU_LE #else # Generic fixed point # WEBRTC_SRC = \ # modules/audio_processing/aecm/aecm_core_c.o \ # modules/audio_processing/ns/nsx_core_c.o \ # common_audio/signal_processing/complex_fft.o #endif endif endif
5. 빌드하기
$ ./configure && make dep && make
6. python 라이브러리를 빌드하고 설치하기
$ cd pjsip-apps/src/python $ sudo make $ sudo make install
7. 아래 경로 참고해서 pjsua 라이브러리를 파이선에서 사용하기
- http://wiki.pchero21.com/wiki/Pjsip-pjsua_python
** 혹시, 라이브러리를 못 찾는다거나 하는 오류가 발생한다면 아래 내용을 진행해 보세요.
- openh264 라이브러리 빌드하고 설치하기
$ git clone https://github.com/cisco/openh264.git $ cd openh264 $ make $ sudo make install
- ~/.bashrc 파일에 아래의 내용을 추가 합니다
#마지막줄에 추가 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib