[pjsip] [Android] Pjsua2 demo app: don't receive call, crash in outbound

Giacomo Furlan giacomo.furlan at be-ssd.com
Mon Oct 19 02:50:22 EDT 2015


Good morning,

I'd like to debug the library. In order to do so, I'd like to compile the
library inside of Android Studio (which from 1.4 I think it supports NDK
debugging). The problem is now that it can't

I've set the gradle version to 2.5:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip

Then I've set the Android build tools to gradle-experimental 0.2.0 (to
enable NDK debugging):

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle-experimental:0.2.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

Eventually I've set the project as follows:

apply plugin: 'com.android.model.application'

model {
    android {
        compileSdkVersion = 15
        buildToolsVersion = "23.0.1"

        defaultConfig.with {
            applicationId = "org.pjsip.pjsua2.app"
            minSdkVersion.apiLevel = 11
            targetSdkVersion.apiLevel = 15
            versionCode = 1
            versionName = "1.0"
        }
    }

    android.ndk {
        CFlags += "-I/home/elegos/src/pjproject/pjlib/include"
    }

    android.buildTypes {
        release {
            minifyEnabled = false
            proguardFiles  += file('proguard-rules.txt')

            ndk.with {
                debuggable = true
            }
        }
    }

    android.sources {
        main {
            java {
                source {
                    srcDir 'src'
                }
            }

            jni {
                source {
                    srcDir '/home/elegos/src/pjproject/pjlib/src'
                }
            }
        }
    }

    android.ndk {
        moduleName = "libpjsua2"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

Still it now complains about not finding "pj/compat/sprintf.h",
"Error:(54, 5) error: expected ':', ',', ';', '}' or '__attribute__'
before 'pj_sock_t'" (in ioqueue_linux_kernel.c)...

What am I doing wrong?

Alternatviely, is it possible to debug the code in Eclipse? If yes, how?

Thanks



Giacomo Furlan
Software developer
Software Solutions Designs

2015-10-16 12:46 GMT+02:00 Giacomo Furlan <giacomo.furlan at be-ssd.com>:

> Ok, I read through the log and found out I had to call on port 6000...
> did, call received, but as soon as I received the call, the crash happens
> again!
>
> W/ActivityManager(  266): No content provider found for permission revoke:
> file:///data/local/tmp/Pjsua2.apk
> W/ActivityManager(  266): No content provider found for permission revoke:
> file:///data/local/tmp/Pjsua2.apk
> I/PackageManager(  266): Running dexopt on: org.pjsip.pjsua2.app
> I/ActivityManager(  266): Force stopping package org.pjsip.pjsua2.app
> uid=10066
> D/PackageManager(  266): New package installed in
> /data/app/org.pjsip.pjsua2.app-1.apk
> W/PackageManager(  266): Not granting permission
> android.permission.READ_LOGS to package org.pjsip.pjsua2.app
> (protectionLevel=50 flags=0x8be46)
> D/BackupManagerService(  266): Received broadcast Intent {
> act=android.intent.action.PACKAGE_ADDED dat=package:org.pjsip.pjsua2.app
> flg=0x8000010 (has extras) }
> D/PackageBroadcastService(  731): Received broadcast
> action=android.intent.action.PACKAGE_ADDED and uri=org.pjsip.pjsua2.app
> I/ConfigFetchService(  731): onStartCommand Intent {
> act=android.intent.action.PACKAGE_ADDED dat=package:org.pjsip.pjsua2.app
> cmp=com.google.android.gms/.config.ConfigFetchService (has extras) }
> I/ActivityManager(  266): START {act=android.intent.action.MAIN
> cat=[android.intent.category.LAUNCHER] flg=0x10000000
> cmp=org.pjsip.pjsua2.app/.MainActivity u=0} from pid 5308
> I/ActivityManager(  266): Start proc org.pjsip.pjsua2.app for activity
> org.pjsip.pjsua2.app/.MainActivity: pid=5320 uid=10066 gids={3003, 1006,
> 1015, 1028}
> D/dalvikvm( 5320): Trying to load lib
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so 0x4134bfd8
> D/dalvikvm( 5320): Added shared lib
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so 0x4134bfd8
> I/System.out( 5320): 12:42:33.674 sip_endpoint.c  .Module "mod-pjsua-log"
> registered
> I/System.out( 5320): 12:42:33.677 sip_endpoint.c  .Module "mod-pjsua"
> registered
> I/System.out( 5320): 12:42:33.714    pjsua_vid.c  ..Initializing video
> subsystem..
> D/CameraHal(   92): Calling process is: org.pjsip.pjsua2.app
> I/System.out( 5320): 12:42:34.682 sip_endpoint.c  .Module "mod-pjsua-pres"
> registered
> I/System.out( 5320): 12:42:34.683 sip_endpoint.c  .Module "mod-pjsua-im"
> registered
> I/System.out( 5320): 12:42:34.683 sip_endpoint.c  .Module
> "mod-pjsua-options" registered
> I/System.out( 5320): 12:42:34.683   pjsua_core.c  .1 SIP worker threads
> created
> I/System.out( 5320): 12:42:34.684   pjsua_core.c  .pjsua version 2.4.5-svn
> for Linux-3.0.8/armv7l initialized
> I/System.out( 5320): 12:42:34.684   pjsua_core.c  .PJSUA state changed:
> CREATED --> INIT
> I/System.out( 5320): 12:42:34.687   pjsua_core.c  SIP UDP socket reachable
> at 192.168.0.135:6000
> I/System.out( 5320): 12:42:34.689   pjsua_core.c  PJSUA state changed:
> INIT --> STARTING
> I/System.out( 5320): 12:42:34.690   pjsua_core.c  .PJSUA state changed:
> STARTING --> RUNNING
> I/System.out( 5320): 12:42:34.693    pjsua_acc.c  Adding account:
> id=sip:localhost
> I/System.out( 5320): 12:42:34.693    pjsua_acc.c  .Account sip:localhost
> added with id 0
> I/ActivityManager(  266): Displayed org.pjsip.pjsua2.app/.MainActivity:
> +1s305ms
> I/System.out( 5320): 12:43:38.824    pjsua_acc.c  Modifying account 0
> I/System.out( 5320): 12:43:38.825    pjsua_acc.c  .Acc 0: setting
> unregistration..
> I/System.out( 5320): 12:43:38.827    pjsua_acc.c  ..Currently not
> registered
> I/System.out( 5320): 12:43:38.828    pjsua_acc.c  .Ignored failure in
> unregistering the old account setting in modifying account: Invalid
> operation (PJ_EINVALIDOP) [status=70013]
> I/System.out( 5320): 12:43:38.831    pjsua_acc.c  .Acc 0: setting
> registration..
> I/System.out( 5320): 12:43:38.837   pjsua_core.c  ...TX 516 bytes Request
> msg REGISTER/cseq=12409 (tdta0x66f45438) to UDP 192.168.0.201:5060:
> I/System.out( 5320): User-Agent: Pjsua2 Android 2.4.5-svn
> I/System.out( 5320): 12:43:38.845    pjsua_acc.c  ..Acc 0: Registration
> sent
> I/System.out( 5320): 12:43:38.942   pjsua_core.c !.RX 335 bytes Response
> msg 200/REGISTER/cseq=12409 (rdata0x61ed162c) from UDP 192.168.0.201:5060:
> I/System.out( 5320): 12:43:38.952    pjsua_acc.c  ....SIP outbound status
> for acc 0 is not active
> I/System.out( 5320): 12:43:38.958    pjsua_acc.c  ....sip:5 at 192.168.0.201:
> registration success, status=200 (OK), will re-register in 300 seconds
> I/System.out( 5320): 12:43:38.961    pjsua_acc.c  ....Keep-alive timer
> started for acc 0, destination:192.168.0.201:5060, interval:15s
> I/System.out( 5320): 12:44:53.156   pjsua_core.c  .RX 798 bytes Request
> msg INVITE/cseq=20 (rdata0x61ed162c) from UDP 192.168.0.201:5060:
> I/System.out( 5320): 12:44:53.178   pjsua_call.c  .Incoming Request msg
> INVITE/cseq=20 (rdata0x61ed162c)
> I/System.out( 5320): 12:44:53.183  pjsua_media.c  ..Call 0: initializing
> media..
> I/System.out( 5320): 12:44:53.195  pjsua_media.c  ...Media index 0
> selected for audio call 0
> I/System.out( 5320): 12:44:53.196   pjsua_core.c  .....TX 251 bytes
> Response msg 100/INVITE/cseq=20 (tdta0x66f96220) to UDP 192.168.0.201:5060
> :
> I/System.out( 5320): 12:44:53.201   pjsua_call.c !Answering call 0:
> code=180
> I/System.out( 5320): 12:44:53.203   pjsua_call.c  .Pending answering call
> 0 upon completion of media transport
> I/ActivityManager(  266): START {flg=0x4000000
> cmp=org.pjsip.pjsua2.app/.CallActivity u=0} from pid 5320
> F/libc    ( 5320): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1),
> thread 5350 (jsip.pjsua2.app)
> I/DEBUG   (   87): pid: 5320, tid: 5350, name: jsip.pjsua2.app  >>>
> org.pjsip.pjsua2.app <<<
> I/DEBUG   (   87):     #03  pc 0019c11c
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
> (pjsip_inv_verify_request3+2008)
> I/DEBUG   (   87):     #00  68d1e738  689be30c
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
> I/DEBUG   (   87):          68d1e754  689be30c
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
> I/DEBUG   (   87):          68d1e76c  689bf220
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so (__PRETTY_FUNCTION__.9894)
> I/DEBUG   (   87):          68d1e770  689bf220
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so (__PRETTY_FUNCTION__.9894)
> I/DEBUG   (   87):          68d1e774  687cd120
> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
> (pjsip_inv_verify_request3+2012)
> I/DEBUG   (   87):     631fdab0 75736a70 00000061 00000000 00000000
> pjsua...........
> I/DEBUG   (   87):     631fdab0 75736a70 00000061 00000000 00000000
> pjsua...........
> I/WindowState(  266): WIN DEATH: Window{417f46d0
> org.pjsip.pjsua2.app/org.pjsip.pjsua2.app.MainActivity paused=false}
> I/ActivityManager(  266): Process org.pjsip.pjsua2.app (pid 5320) has died.
> W/ActivityManager(  266): Force removing ActivityRecord{41611028
> org.pjsip.pjsua2.app/.CallActivity}: app died, no saved state
> W/ActivityManager(  266): Force removing ActivityRecord{4174b710
> org.pjsip.pjsua2.app/.MainActivity}: app died, no saved state
>
> Giacomo Furlan
> Software developer
> Software Solutions Designs
>
> 2015-10-16 12:30 GMT+02:00 Giacomo Furlan <giacomo.furlan at be-ssd.com>:
>
>> Hello everyone!
>>
>> I'm trying to figuring out if pjsip is able to correctly support H264
>> (main profile) via x264 for an intercom. Due to this I tried compiling
>> pjsip + ffmpeg (+ x264) for armeabi-v7a.
>>
>> So far, so good, I'm able to start the application now, but here start
>> the problems: when I configure a SIP account, it says "registration
>> success, status=200 (OK)", but when I try to call this device, nothing seem
>> to happen.
>>
>> The SIP server uses UDP port 5060 for the SDP communication. I don't see
>> much configuration, but as it registers, it should even listen on UDP port
>> 5060 for incoming connections... right?
>>
>> Also, when I try to call a buddy (sip:1 at host), the app just crashes with
>> a lib error...
>>
>> May you please help me out?
>>
>> Thanks!
>>
>> I/ActivityManager(  266): START {act=android.intent.action.MAIN
>> cat=[android.intent.category.LAUNCHER] flg=0x10200000
>> cmp=org.pjsip.pjsua2.app/.MainActivity u=0} from pid 468
>> I/ActivityManager(  266): Start proc org.pjsip.pjsua2.app for activity
>> org.pjsip.pjsua2.app/.MainActivity: pid=4183 uid=10066 gids={3003, 1006,
>> 1015, 1028}
>> D/dalvikvm( 4183): Trying to load lib
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so 0x4134b4b8
>> D/dalvikvm( 4183): Added shared lib
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so 0x4134b4b8
>> I/System.out( 4183): 12:17:51.115 sip_endpoint.c  .Module "mod-pjsua-log"
>> registered
>> I/System.out( 4183): 12:17:51.117 sip_endpoint.c  .Module "mod-pjsua"
>> registered
>> I/System.out( 4183): 12:17:51.118   pjsua_core.c  .Trying STUN server
>> stun.pjsip.org (1 of 1)..
>> W/ActivityManager(  266): Activity idle timeout for
>> ActivityRecord{415b9a20 org.pjsip.pjsua2.app/.MainActivity}
>> I/System.out( 4183): 12:20:31.278   pjsua_core.c  .Error starting STUN
>> socket for stun.pjsip.org: gethostbyname() has returned error
>> (PJ_ERESOLVE)
>> I/System.out( 4183): 12:20:31.279   pjsua_core.c  .STUN resolution
>> failed: gethostbyname() has returned error (PJ_ERESOLVE)
>> I/System.out( 4183): 12:20:31.279   pjsua_core.c  .Ignoring STUN
>> resolution failure (by setting)
>> I/System.out( 4183): 12:20:31.342    pjsua_vid.c  ..Initializing video
>> subsystem..
>> D/CameraHal(   92): Calling process is: org.pjsip.pjsua2.app
>> I/System.out( 4183): 12:20:32.210 sip_endpoint.c  .Module
>> "mod-pjsua-pres" registered
>> I/System.out( 4183): 12:20:32.210 sip_endpoint.c  .Module "mod-pjsua-im"
>> registered
>> I/System.out( 4183): 12:20:32.210 sip_endpoint.c  .Module
>> "mod-pjsua-options" registered
>> I/System.out( 4183): 12:20:32.211   pjsua_core.c  .1 SIP worker threads
>> created
>> I/System.out( 4183): 12:20:32.211   pjsua_core.c  .pjsua version
>> 2.4.5-svn for Linux-3.0.8/armv7l initialized
>> I/System.out( 4183): 12:20:32.211   pjsua_core.c  .PJSUA state changed:
>> CREATED --> INIT
>> I/System.out( 4183): 12:20:32.213   pjsua_core.c  SIP UDP socket
>> reachable at 192.168.0.135:6000
>> I/System.out( 4183): 12:20:32.216    pjsua_acc.c  Adding account:
>> id=sip:localhost
>> I/System.out( 4183): 12:20:32.216    pjsua_acc.c  .Account sip:localhost
>> added with id 0
>> I/System.out( 4183): 12:20:32.217   pjsua_core.c  PJSUA state changed:
>> INIT --> STARTING
>> I/System.out( 4183): 12:20:32.217   pjsua_core.c  .PJSUA state changed:
>> STARTING --> RUNNING
>> I/ActivityManager(  266): Displayed org.pjsip.pjsua2.app/.MainActivity:
>> +2m41s366ms
>> I/System.out( 4183): 12:22:07.438    pjsua_acc.c  Modifying account 0
>> I/System.out( 4183): 12:22:07.439    pjsua_acc.c  .Invalid local URI:
>> Invalid URI (PJSIP_EINVALIDURI) [status=171039]
>> I/System.out( 4183): 12:22:07.441    account.cpp  pjsua_acc_modify(id,
>> &pj_acc_cfg) error: Invalid URI (PJSIP_EINVALIDURI) (status=171039)
>> [../src/pjsua2/account.cpp:690]
>> I/System.out( 4183): 12:22:32.704    pjsua_acc.c  Modifying account 0
>> I/System.out( 4183): 12:22:32.705    pjsua_acc.c  .Acc 0: setting
>> unregistration..
>> I/System.out( 4183): 12:22:32.706    pjsua_acc.c  ..Currently not
>> registered
>> I/System.out( 4183): 12:22:32.706    pjsua_acc.c  .Ignored failure in
>> unregistering the old account setting in modifying account: Invalid
>> operation (PJ_EINVALIDOP) [status=70013]
>> I/System.out( 4183): 12:22:32.706    pjsua_acc.c  .Acc 0: setting
>> registration..
>> I/System.out( 4183): 12:22:32.707   pjsua_core.c  ...TX 516 bytes Request
>> msg REGISTER/cseq=15476 (tdta0x61ebd008) to UDP 192.168.0.201:5060:
>> I/System.out( 4183): User-Agent: Pjsua2 Android 2.4.5-svn
>> I/System.out( 4183): 12:22:32.712    pjsua_acc.c  ..Acc 0: Registration
>> sent
>> I/System.out( 4183): 12:22:32.799   pjsua_core.c !.RX 334 bytes Response
>> msg 200/REGISTER/cseq=15476 (rdata0x61e92624) from UDP 192.168.0.201:5060
>> :
>> I/System.out( 4183): 12:22:32.830    pjsua_acc.c  ....SIP outbound status
>> for acc 0 is not active
>> I/System.out( 4183): 12:22:32.833    pjsua_acc.c  ....sip:5 at 192.168.0.201:
>> registration success, status=200 (OK), will re-register in 300 seconds
>> I/System.out( 4183): 12:22:32.834    pjsua_acc.c  ....Keep-alive timer
>> started for acc 0, destination:192.168.0.201:5060, interval:15s
>> I/System.out( 4183): 12:25:29.897   pjsua_pres.c !Adding buddy:
>> sip:1 at 192.168.0.201
>> I/System.out( 4183): 12:25:29.897   pjsua_pres.c  .Buddy 0 added.
>> I/System.out( 4183): 12:25:29.898   pjsua_pres.c  .Buddy 0: unsubscribing
>> presence..
>> I/System.out( 4183): 12:25:29.898   pjsua_pres.c  ..Buddy 0: updating
>> presence..
>> I/System.out( 4183): 12:25:43.094   pjsua_call.c  Making call with acc #0
>> to sip:1 at 192.168.0.201
>> I/System.out( 4183): 12:25:43.094    pjsua_aud.c  .Set sound device:
>> capture=-1, playback=-2
>> I/System.out( 4183): 12:25:43.095    pjsua_aud.c  ..Opening sound device
>> PCM at 16000/1/20ms
>> I/System.out( 4183): 12:25:43.134  pjsua_media.c  .Call 0: initializing
>> media..
>> I/System.out( 4183): 12:25:43.141  pjsua_media.c  ..Media index 0
>> selected for audio call 0
>> I/ActivityManager(  266): START {flg=0x4000000
>> cmp=org.pjsip.pjsua2.app/.CallActivity u=0} from pid 4183
>> F/libc    ( 4183): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1),
>> thread 4296 (jsip.pjsua2.app)
>> I/DEBUG   (   87): pid: 4183, tid: 4296, name: jsip.pjsua2.app  >>>
>> org.pjsip.pjsua2.app <<<
>> I/DEBUG   (   87):     #03  pc 002174c4
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
>> (pjmedia_sdp_neg_create_w_local_offer+244)
>> I/DEBUG   (   87):     #00  68d1e8e8  688ce564
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
>> I/DEBUG   (   87):          68d1e904  688ce564
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
>> I/DEBUG   (   87):          68d1e91c  688cea5c
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so (__PRETTY_FUNCTION__.6192)
>> I/DEBUG   (   87):          68d1e920  688cea5c
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so (__PRETTY_FUNCTION__.6192)
>> I/DEBUG   (   87):          68d1e924  687484c8
>> /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so
>> (pjmedia_sdp_neg_create_w_local_offer+248)
>> I/DEBUG   (   87):     675a1b40 75736a70 00000061 00000000 00000000
>> pjsua...........
>> I/DEBUG   (   87):     675a1b40 75736a70 00000061 00000000 00000000
>> pjsua...........
>> W/InputDispatcher(  266): channel '41613f60
>> org.pjsip.pjsua2.app/org.pjsip.pjsua2.app.MainActivity (server)' ~ Consumer
>> closed input channel or an error occurred.  events=0x9
>> E/InputDispatcher(  266): channel '41613f60
>> org.pjsip.pjsua2.app/org.pjsip.pjsua2.app.MainActivity (server)' ~ Channel
>> is unrecoverably broken and will be disposed!
>> W/InputDispatcher(  266): Attempted to unregister already unregistered
>> input channel '41613f60
>> org.pjsip.pjsua2.app/org.pjsip.pjsua2.app.MainActivity (server)'
>> I/WindowManager(  266): WINDOW DIED Window{41613f60
>> org.pjsip.pjsua2.app/org.pjsip.pjsua2.app.MainActivity paused=false}
>> I/ActivityManager(  266): Process org.pjsip.pjsua2.app (pid 4183) has
>> died.
>> I/WindowState(  266): WIN DEATH: Window{41613f60
>> org.pjsip.pjsua2.app/org.pjsip.pjsua2.app.MainActivity paused=false}
>> W/ActivityManager(  266): Force removing ActivityRecord{418a19a0
>> org.pjsip.pjsua2.app/.CallActivity}: app died, no saved state
>> W/ActivityManager(  266): Force removing ActivityRecord{415b9a20
>> org.pjsip.pjsua2.app/.MainActivity}: app died, no saved state
>>
>> Giacomo Furlan
>> Software developer
>> Software Solutions Designs
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20151019/7bb007c9/attachment-0002.html>


More information about the pjsip mailing list