datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 232 forks source link

Cannot make call on targetSdkVersion > 22 #94

Closed rcorrie closed 6 years ago

rcorrie commented 6 years ago

I updated the targetSdkVersion in my app/build.gradle file to 23 and now it crashes when calling endpoint.makeCall.

Here is the relevant part of my build.gradle file:

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"

    defaultConfig {
        applicationId "com.x.x"
        minSdkVersion 19
        targetSdkVersion 23 <----- this is the only change! Used to be 22
...

logcat output:

04-17 11:09:41.534 26383 26418 I ReactNativeJS: ################## MAKING CALL
04-17 11:09:41.549 26383 26485 D PjSipService: Handle "call_make" action ({"destination":"sip:555555555@sip.mysipserver.com","message":"{}","callback_id":4,"settings":"{\"audioCount\":1,\"flag\":0,\"videoCount\":0}","account_id":0})
04-17 11:09:41.555 26383 26485 D PjSipLogWriter: 11:09:41.555   pjsua_call.c !Making call with acc #0 to sip:555555555@sip.mysipserver.com
04-17 11:09:41.555 26383 26485 D PjSipLogWriter: 11:09:41.555    pjsua_aud.c  .Set sound device: capture=-1, playback=-2
04-17 11:09:41.555 26383 26485 D PjSipLogWriter: 11:09:41.555    pjsua_aud.c  ..Opening sound device (speaker + mic) PCM@8000/1/20ms
04-17 11:09:41.555 26383 26485 D PjSipLogWriter: 11:09:41.555   opensl_dev.c  ...Creating OpenSL stream
04-17 11:09:41.559 26383 26485 I libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x4, using default mask 0x1 based on channel count of 1)
04-17 11:09:41.559 26383 26485 D AudioTrack: createTrack_l() remove fast or raw flag of voip calls, stream=0, flags=104
04-17 11:09:41.561 26383 26485 D AudioTrack: Client defaulted notificationFrames to 218 for frameCount 656
04-17 11:09:41.561 26383 26485 W libOpenSLES: Conversion from OpenSL ES positional channel mask 0x4 to Android mask 0 loses channels
04-17 11:09:41.561 26383 26485 I libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x4, using default mask 0x10 based on channel count of 1)
04-17 11:09:41.561 26383 26485 D AudioRecord: openRecord_l() remove fast or raw flag of voip calls, source=7, flags=1
04-17 11:09:41.561   744   744 I APM_AudioPolicyManager: getInputForAttr() source 7, samplingRate 8000, format 1, channelMask 10,session 1737, flags 0
04-17 11:09:41.562  1344 16531 I EDMNativeHelperService: isMicrophoneEnabled
04-17 11:09:41.563   744   744 D audio_hw_primary: adev_open_input_stream: enter: sample_rate(8000) channel_mask(0x10) devices(0x80000004)        stream_handle(0xec813c00) io_handle(566) source(7) format 1
04-17 11:09:41.563   744   744 E audio_hw_primary: adev_open_input_stream : jack_config 0
04-17 11:09:41.563   744   744 D audio_hw_primary: adev_open_input_stream: preprocessing_latency = 0
04-17 11:09:41.564   744 26552 I AudioFlinger: AudioFlinger's thread 0xea6039c0 ready to run
04-17 11:09:41.564   744 26552 D audio_hw_primary: in_standby: enter: stream (0xec813c00) usecase(16: audio-record)
04-17 11:09:41.565   744 26552 D audio_hw_primary: in_standby: enter: stream (0xec813c00) usecase(16: audio-record)
04-17 11:09:41.567   744 15241 W ServiceManager: Permission failure: android.permission.RECORD_AUDIO from uid=10318 pid=-1
04-17 11:09:41.567   744 15241 E         : Request requires android.permission.RECORD_AUDIO
04-17 11:09:41.567   744 15241 E AudioFlinger: openRecord() permission denied: recording not allowed
04-17 11:09:41.567 26383 26485 E AudioRecord: AudioFlinger could not create record track, status: -1
04-17 11:09:41.567   744  1081 W AudioFlinger::EffectModule: EffectModule 0xed9ae600 destructor called with unreleased interface
04-17 11:09:41.567   744  1081 W AudioFlinger::EffectHandle: disconnect Effect handle 0xed9b9c40 disconnected after thread destruction
04-17 11:09:41.570   744  1081 D audio_hw_primary: adev_close_input_stream: enter:stream_handle(0xec813c00)
04-17 11:09:41.570   744  1081 V msm8974_platform: platform_set_echo_reference: disabling echo-reference
04-17 11:09:41.570   744  1081 D audio_hw_primary: in_standby: enter: stream (0xec813c00) usecase(16: audio-record)
04-17 11:09:41.570 26383 26485 E libOpenSLES: android_audioRecorder_realize(0xc417f400) error creating AudioRecord object; status -1
04-17 11:09:41.570 26383 26485 W libOpenSLES: Leaving Object::Realize (SL_RESULT_CONTENT_UNSUPPORTED)
04-17 11:09:41.570 26383 26485 D PjSipLogWriter: 11:09:41.570   opensl_dev.c  ...Cannot realize recorder : 9
04-17 11:09:41.570 26383 26485 D PjSipLogWriter: 11:09:41.570   opensl_dev.c  ...Stopping stream
04-17 11:09:41.571 26383 26485 D PjSipLogWriter: 11:09:41.570   opensl_dev.c  ...OpenSL stream stopped
04-17 11:09:41.572 26383 26485 D PjSipLogWriter: 11:09:41.572   opensl_dev.c  ...OpenSL stream destroyed

--------- beginning of crash

04-17 11:09:41.680 26553 26485 F google-breakpad: Microdump skipped (uninteresting)
04-17 11:09:41.733 26383 26485 W google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
04-17 11:09:41.733 26383 26485 W google-breakpad: Chrome build fingerprint:
04-17 11:09:41.733 26383 26485 W google-breakpad: 1.0
04-17 11:09:41.733 26383 26485 W google-breakpad: 1
04-17 11:09:41.733 26383 26485 W google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
04-17 11:09:41.734 26383 26485 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 26485 (PjSipService)
04-17 11:09:41.735   505   505 W         : debuggerd: handling request: pid=26383 uid=10318 gid=10318 tid=26485
04-17 11:09:41.929 26555 26555 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-17 11:09:41.930 26555 26555 F DEBUG   : Build fingerprint: 'samsung/dreamqltesq/dreamqltesq:7.0/NRD90M/G950USQS1AQJA:user/release-keys'
04-17 11:09:41.930 26555 26555 F DEBUG   : Revision: '12'
04-17 11:09:41.930 26555 26555 F DEBUG   : ABI: 'arm'
04-17 11:09:41.930 26555 26555 F DEBUG   : pid: 26383, tid: 26485, name: PjSipService  >>> com.x.x <<<
04-17 11:09:41.930 26555 26555 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
04-17 11:09:41.930 26555 26555 F DEBUG   :     r0 00000000  r1 e051b5ed  r2 00000000  r3 00000000
04-17 11:09:41.930 26555 26555 F DEBUG   :     r4 c4153464  r5 c36280e0  r6 c35fde70  r7 c2f7178d
04-17 11:09:41.930 26555 26555 F DEBUG   :     r8 c2f71859  r9 c3628064  sl c35fe3bc  fp 00000000
04-17 11:09:41.930 26555 26555 F DEBUG   :     ip f2343968  sp c35fde58  lr c2f85d9f  pc c2f7f0e0  cpsr 600f0030
04-17 11:09:41.937 26555 26555 F DEBUG   :
04-17 11:09:41.937 26555 26555 F DEBUG   : backtrace:
04-17 11:09:41.937 26555 26555 F DEBUG   :     #00 pc 001430e0  /data/app/com.x.x-1/lib/arm/libpjsua2.so (pjmedia_aud_stream_create+179)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #01 pc 00135a9b  /data/app/com.x.x-1/lib/arm/libpjsua2.so (start_sound_device+122)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #02 pc 00135c07  /data/app/com.x.x-1/lib/arm/libpjsua2.so (pjmedia_snd_port_create2+178)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #03 pc 001065ad  /data/app/com.x.x-1/lib/arm/libpjsua2.so (open_snd_dev.constprop.4+288)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #04 pc 001069a9  /data/app/com.x.x-1/lib/arm/libpjsua2.so (pjsua_set_snd_dev2+344)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #05 pc 00106a31  /data/app/com.x.x-1/lib/arm/libpjsua2.so (pjsua_set_snd_dev+24)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #06 pc 000f6a05  /data/app/com.x.x-1/lib/arm/libpjsua2.so (pjsua_call_make_call+168)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #07 pc 000e6e2b  /data/app/com.x.x-1/lib/arm/libpjsua2.so (_ZN2pj4Call8makeCallERKSsRKNS_11CallOpParamE+54)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #08 pc 000cd5e5  /data/app/com.x.x-1/lib/arm/libpjsua2.so (Java_org_pjsip_pjsua2_pjsua2JNI_Call_1makeCall+96)
04-17 11:09:41.937 26555 26555 F DEBUG   :     #09 pc 00b5435d  /data/app/com.x.x-1/oat/arm/base.odex (offset 0xa8f000)
rcorrie commented 6 years ago

Found the reason this is happening in the SO answer https://stackoverflow.com/a/43996921/1405492

datso commented 6 years ago

There is no needs to check permissions on native side. I think that https://github.com/zxcpoiu/react-native-incall-manager could help with requestPermissions

rcorrie commented 6 years ago

You are right, thanks @datso you can close this