我正在使用基於SWIG示例的PJSIP for android構建SIP Softphone。啓用登錄PJSIP for Android部隊關閉應用程序
啓用日誌作爲樣本中描述:
LogConfig log_cfg = epConfig.getLogConfig();
SipLogWriter logWriter = new SipLogWriter();
log_cfg.setWriter(logWriter);
log_cfg.setDecor(log_cfg.getDecor() & ~(pj_log_decoration.PJ_LOG_HAS_CR.swigValue() | pj_log_decoration.PJ_LOG_HAS_NEWLINE.swigValue()));
在我的SipLogWriter類:
public class SipLogWriter extends LogWriter {
@Override
public void write(LogEntry entry) {
Log.d(Global.TAG, "[SipLogWriter] " + entry.getMsg());
}
}
PJSIP LIB現在,然後暫停每本回溯:
05-04 10:32:10.534 I/DEBUG ( 281): backtrace:
05-04 10:32:10.534 I/DEBUG ( 281): #00 pc 00037b58 /system/lib/libc.so (tgkill+12)
05-04 10:32:10.544 I/DEBUG ( 281): #01 pc 00013fc9 /system/lib/libc.so (pthread_kill+52)
05-04 10:32:10.544 I/DEBUG ( 281): #02 pc 00014be7 /system/lib/libc.so (raise+10)
05-04 10:32:10.544 I/DEBUG ( 281): #03 pc 00011529 /system/lib/libc.so (__libc_android_abort+36)
05-04 10:32:10.544 I/DEBUG ( 281): #04 pc 0000fcb4 /system/lib/libc.so (abort+4)
05-04 10:32:10.544 I/DEBUG ( 281): #05 pc 00001259 /system/lib/libstdc++.so
05-04 10:32:10.544 I/DEBUG ( 281): #06 pc 00000afb /system/lib/libstdc++.so (__cxa_pure_virtual+6)
05-04 10:32:10.544 I/DEBUG ( 281): #07 pc 0015d4e8 /data/app/com.sample.app-1/lib/arm/libpjsua2.so (pj::Endpoint::utilLogWrite(pj::LogEntry&)+180)
05-04 10:32:10.544 I/DEBUG ( 281): #08 pc 0015d734 /data/app/com.sample.app-1/lib/arm/libpjsua2.so (pj::Endpoint::logFunc(int, char const*, int)+292)
05-04 10:32:10.544 I/DEBUG ( 281): #09 pc 001a9fe0 /data/app/com.sample.app-1/lib/arm/libpjsua2.so (log_writer+164)
05-04 10:32:10.544 I/DEBUG ( 281): #10 pc 0034420c /data/app/com.sample.app-1/lib/arm/libpjsua2.so (pj_log+2324)
05-04 10:32:10.544 I/DEBUG ( 281): #11 pc 0034436c /data/app/com.sample.app-1/lib/arm/libpjsua2.so (pj_log_4+44)
05-04 10:32:10.544 I/DEBUG ( 281): #12 pc 0025c9c4 /data/app/com.sample.app-1/lib/arm/libpjsua2.so (play_cb+568)
05-04 10:32:10.544 I/DEBUG ( 281): #13 pc 0029c454 /data/app/com.sample.app-1/lib/arm/libpjsua2.so (bqPlayerCallback+420)
05-04 10:32:10.544 I/DEBUG ( 281): #14 pc 00008daf /system/lib/libwilhelm.so
05-04 10:32:10.544 I/DEBUG ( 281): #15 pc 000559fd /system/lib/libmedia.so (android::AudioTrack::processAudioBuffer()+1156)
05-04 10:32:10.544 I/DEBUG ( 281): #16 pc 00055c69 /system/lib/libmedia.so (android::AudioTrack::AudioTrackThread::threadLoop()+168)
05-04 10:32:10.544 I/DEBUG ( 281): #17 pc 0000ef55 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112)
05-04 10:32:10.544 I/DEBUG ( 281): #18 pc 0000eac5 /system/lib/libutils.so
05-04 10:32:10.544 I/DEBUG ( 281): #19 pc 000137b3 /system/lib/libc.so (__pthread_start(void*)+30)
05-04 10:32:10.544 I/DEBUG ( 281): #20 pc 00011893 /system/lib/libc.so (__start_thread+6)
我懷疑它試圖從錯誤的線程寫入日誌,但我不知道如何解決它。禁用LogWriter應用程序不會拋出此錯誤。
任何幫助表示讚賞。
同樣的問題。但在我的情況下,我需要日誌,當我關閉 - 一切正常。當我啓用日誌,經過一段時間的應用程序下降與崩潰該日誌試圖從死線程或空對象做一些事情! – GensaGames