Hi Ming.
This patch is ok, sanks.
There is also a problem with simpleua. When I call from linphone to
simpleua and end the call from the linphone side, the program does not
_always_ end normally.
What could be the problem?
pjproject-trunk (Revision: 5945)
# CFLAGS=-g ./configure --enable-shared --disable-libwebrtc
--disable-speex-aec
# make dep; make; make install
# cat pjlib/include/pj/config_site.h
#define PJMEDIA_HAS_VIDEO 1
#define PJMEDIA_HAS_OPENH264_CODEC 1
#define PJMEDIA_VIDEO_DEV_HAS_SDL 1
$ make simpleua
cc -O2 -g -fstack-protector-all -lstdc++ -lpj -lpjsip -lpjmedia
-lpjmedia-codec -lpjsip-ua -lpjmedia-audiodev -lpjmedia-videodev
-lpjlib-util simpleua.c -o simpleua
$ gdb simpleua
GNU gdb (Gentoo 8.1 p1) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from simpleua...done.
(gdb) run
Starting program: /home/flot/RS/simpleua
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
18:25:06.522 os_core_unix.c !pjlib 2.8-svn for POSIX initialized
18:25:06.522 sip_endpoint.c Creating endpoint instance...
18:25:06.523 pjlib select() I/O Queue created (0x41e1a0)
18:25:06.523 sip_endpoint.c Module "mod-msg-print" registered
18:25:06.523 sip_transport. Transport manager created.
18:25:06.557 udp0x422e70 SIP UDP transport started, published
address is 192.168.1.3:5060
18:25:06.557 sip_endpoint.c Module "mod-tsx-layer" registered
18:25:06.557 sip_endpoint.c Module "mod-stateful-util" registered
18:25:06.557 sip_endpoint.c Module "mod-ua" registered
18:25:06.557 sip_endpoint.c Module "mod-invite" registered
18:25:06.557 sip_endpoint.c Module "mod-100rel" registered
18:25:06.557 sip_endpoint.c Module "mod-simpleua" registered
18:25:06.557 sip_endpoint.c Module "mod-msg-log" registered
[New Thread 0xadaceb40 (LWP 12276)]
[Thread 0xadaceb40 (LWP 12276) exited]
[New Thread 0xadaceb40 (LWP 12277)]
[Thread 0xadaceb40 (LWP 12277) exited]
18:25:06.640 alsa_dev.c Added sound device pulse
18:25:06.644 alsa_dev.c Added sound device sysdefault:CARD=Audigy
18:25:06.645 alsa_dev.c Added sound device front:CARD=Audigy,DEV=0
18:25:06.646 alsa_dev.c Added sound device rear:CARD=Audigy,DEV=0
18:25:06.648 alsa_dev.c Added sound device
center_lfe:CARD=Audigy,DEV=0
18:25:06.650 alsa_dev.c Added sound device
surround21:CARD=Audigy,DEV=0
18:25:06.652 alsa_dev.c Added sound device
surround40:CARD=Audigy,DEV=0
18:25:06.654 alsa_dev.c Added sound device
surround41:CARD=Audigy,DEV=0
18:25:06.657 alsa_dev.c Added sound device
surround50:CARD=Audigy,DEV=0
18:25:06.659 alsa_dev.c Added sound device
surround51:CARD=Audigy,DEV=0
18:25:06.660 alsa_dev.c Added sound device iec958:CARD=Audigy,DEV=0
[New Thread 0xadaceb40 (LWP 12278)]
[Thread 0xadaceb40 (LWP 12278) exited]
18:25:06.681 alsa_dev.c ALSA driver found 11 devices
18:25:06.681 alsa_dev.c ALSA initialized
18:25:06.681 pjlib select() I/O Queue created (0x43b484)
[New Thread 0xadaceb40 (LWP 12279)]
18:25:06.684 v4l2_dev.c Video4Linux2 has 0 devices
[New Thread 0xb1aceb40 (LWP 12280)]
[New Thread 0xacc3cb40 (LWP 12281)]
[New Thread 0xac0ffb40 (LWP 12282)]
18:25:07.531 sdl_dev.c SDL 2.0 initialized
18:25:07.531 colorbar_dev.c Colorbar video src initialized with 2
device(s):
18:25:07.531 colorbar_dev.c 0: Colorbar generator
18:25:07.531 colorbar_dev.c 1: Colorbar-active
18:25:07.531 openh264.cpp OpenH264 codec initialized
[New Thread 0xab8feb40 (LWP 12283)]
18:25:07.532 simpleua.c Ready to accept incoming calls...
18:25:10.706 sip_endpoint.c Processing incoming message: Request msg
INVITE/cseq=20 (rdata0x425044)
18:25:10.706 simpleua.c .RX 1123 bytes Request msg INVITE/cseq=20
(rdata0x425044) from UDP 192.168.1.90:5060:
INVITE sip:333@192.168.1.3 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK.TKZygiOl6;rport
From: <sip:1@rs>;tag=SdNG8yJxz
To: sip:333@192.168.1.3
CSeq: 20 INVITE
Call-ID: RicfXtLEdQ
Max-Forwards: 70
Supported: replaces, outbound, gruu
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 533
Contact:
<sip:1@192.168.1.90;transport=udp>;+sip.instance="<urn:uuid:93f181dc-9e75-4040-b9d3-55ace151b56f>";+org.linphone.specs=groupchat
User-Agent: LinphoneAndroid/4.0.1 (belle-sip/1.6.3)
v=0
o=1 3775 2128 IN IP4 192.168.1.90
s=Talk
c=IN IP4 192.168.1.90
t=0 0
a=ice-pwd:24c8ea7f15876ff81f320b31
a=ice-ufrag:b8177f10
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7076 RTP/AVP 96 8 101 97
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:101 telephone-event/48000
a=rtpmap:97 telephone-event/8000
a=candidate:1 1 UDP 2130706303 192.168.1.90 7076 typ host
a=candidate:1 2 UDP 2130706302 192.168.1.90 7077 typ host
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr
--end msg--
18:25:10.706 tsx0x46c894 ..Transaction created for Request msg
INVITE/cseq=20 (rdata0x425044)
18:25:10.706 tsx0x46c894 .Incoming Request msg INVITE/cseq=20
(rdata0x425044) in state Null
18:25:10.706 tsx0x46c894 ..State changed from Null to Trying,
event=RX_MSG
18:25:10.706 dlg0x46be74 ...Transaction tsx0x46c894 state changed to
Trying
18:25:10.706 dlg0x46be74 .UAS dialog created
18:25:10.706 dlg0x46be74 .Module mod-invite added as dialog usage,
data=0x46d474
18:25:10.706 dlg0x46be74 ..Session count inc to 3 by mod-invite
18:25:10.706 inv0x46be74 .UAS invite session created for dialog
dlg0x46be74
18:25:10.706 endpoint ..Response msg 180/INVITE/cseq=20
(tdta0x473b94) created
18:25:10.706 dlg0x46be74 ..Initial answer Response msg
180/INVITE/cseq=20 (tdta0x473b94)
18:25:10.706 inv0x46be74 ..Sending Response msg 180/INVITE/cseq=20
(tdta0x473b94)
18:25:10.706 dlg0x46be74 ...Sending Response msg 180/INVITE/cseq=20
(tdta0x473b94)
18:25:10.706 tsx0x46c894 ...Sending Response msg 180/INVITE/cseq=20
(tdta0x473b94) in state Trying
18:25:10.707 simpleua.c ....TX 366 bytes Response msg
180/INVITE/cseq=20 (tdta0x473b94) to UDP 192.168.1.90:5060:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP
192.168.1.90:5060;rport=5060;received=192.168.1.90;branch=z9hG4bK.TKZygiOl6
Call-ID: RicfXtLEdQ
From: <sip:1@rs>;tag=SdNG8yJxz
To: <sip:333@192.168.1.3>;tag=fc198f5f-2694-494f-8e66-4c13475e148a
CSeq: 20 INVITE
Contact: <sip:simpleuas@192.168.1.3:5060>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, PRACK
Content-Length: 0
--end msg--
18:25:10.707 tsx0x46c894 ....State changed from Trying to
Proceeding, event=TX_MSG
18:25:10.707 dlg0x46be74 .....Transaction tsx0x46c894 state changed
to Proceeding
18:25:10.707 simpleua.c ......Call state changed to INCOMING
18:25:10.707 simpleua.c ......Call state changed to EARLY
18:25:10.707 sip_transport. ..Tx data Response msg 180/INVITE/cseq=20
(tdta0x476af4) cloned
18:25:10.707 inv0x46be74 ..SDP negotiation done, status=0
18:25:10.707 strm0x4787f4 ..VAD temporarily disabled
18:25:10.707 rtp.c ..pjmedia_rtp_session_init: ses=0x47a9dc,
default_pt=8, ssrc=0x790d6a06
18:25:10.707 rtp.c ..pjmedia_rtp_session_init: ses=0x47a7cc,
default_pt=8, ssrc=0x790d6a06
18:25:10.707 udp0x4669d0 ..SO_RCVBUF set to 163840
18:25:10.707 udp0x4669d0 ..SO_SNDBUF set to 163840
18:25:10.707 stream.c ..Stream strm0x4787f4 created
18:25:10.707 strm0x4787f4 ..Encoder stream started
18:25:10.707 strm0x4787f4 ..Decoder stream started
18:25:10.707 alsa_dev.c ..open_playback: Open playback device
'pulse'
[New Thread 0xa70fdb40 (LWP 12284)]
18:25:10.712 alsa_dev.c ..Opened device alsa(pulse) for playing,
sample rate=8000, ch=1, bits=16, period size=160 frames, latency=140 ms
18:25:10.712 alsa_dev.c ..open_capture: Open capture device 'pulse'
[New Thread 0x966ffb40 (LWP 12285)]
18:25:10.716 alsa_dev.c ..Opened device alsa(pulse) for capture,
sample rate=8000, ch=1, bits=16, period size=160 frames, latency=100 ms
[New Thread 0x89cffb40 (LWP 12286)]
[New Thread 0x892ffb40 (LWP 12287)]
18:25:10.721 inv0x46be74 ..Sending Response msg 200/INVITE/cseq=20
(tdta0x476af4)
18:25:10.721 dlg0x46be74 ...Sending Response msg 200/INVITE/cseq=20
(tdta0x476af4)
18:25:10.721 tsx0x46c894 ...Sending Response msg 200/INVITE/cseq=20
(tdta0x476af4) in state Proceeding
18:25:10.721 tdta0x473b94 ....Destroying txdata Response msg
180/INVITE/cseq=20 (tdta0x473b94)
18:25:10.721 simpleua.c ....TX 649 bytes Response msg
200/INVITE/cseq=20 (tdta0x476af4) to UDP 192.168.1.90:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.1.90:5060;rport=5060;received=192.168.1.90;branch=z9hG4bK.TKZygiOl6
Call-ID: RicfXtLEdQ
From: <sip:1@rs>;tag=SdNG8yJxz
To: <sip:333@192.168.1.3>;tag=fc198f5f-2694-494f-8e66-4c13475e148a
CSeq: 20 INVITE
Allow: INVITE, ACK, BYE, CANCEL, UPDATE
Contact: <sip:simpleuas@192.168.1.3:5060>
Supported:
Content-Type: application/sdp
Content-Length: 248
v=0
o=- 3761047510 3761047511 IN IP4 192.168.1.3
s=pjmedia
t=0 0
m=audio 4000 RTP/AVP 8 97
c=IN IP4 192.168.1.3
b=TIAS:64000
a=rtcp:4001 IN IP4 192.168.1.3
a=sendrecv
a=rtpmap:8 PCMA/8000
a=rtpmap:97 telephone-event/8000
a=fmtp:97 0-16
--end msg--
18:25:10.721 tsx0x46c894 ....State changed from Proceeding to
Completed, event=TX_MSG
18:25:10.721 dlg0x46be74 .....Transaction tsx0x46c894 state changed
to Completed
18:25:10.721 simpleua.c ......Call state changed to CONNECTING
18:25:10.721 alsa_dev.c !ca_thread_func(12287): Set thread priority
for audio capture thread.
18:25:10.721 alsa_dev.c Unable to increase thread priority, root
access needed.
18:25:10.722 strm0x4787f4 !Jitter buffer is bufferring (prefetch=0)
18:25:10.745 strm0x4787f4 !Start talksprut..
18:25:10.997 sip_endpoint.c !Processing incoming message: Request msg
ACK/cseq=20 (rdata0x425044)
18:25:10.997 simpleua.c .RX 319 bytes Request msg ACK/cseq=20
(rdata0x425044) from UDP 192.168.1.90:5060:
ACK sip:simpleuas@192.168.1.3:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;rport;branch=z9hG4bK.bB~2U5olp
From: <sip:1@rs>;tag=SdNG8yJxz
To: <sip:333@192.168.1.3>;tag=fc198f5f-2694-494f-8e66-4c13475e148a
CSeq: 20 ACK
Call-ID: RicfXtLEdQ
Max-Forwards: 70
User-Agent: LinphoneAndroid/4.0.1 (belle-sip/1.6.3)
--end msg--
18:25:10.997 dlg0x46be74 .Received Request msg ACK/cseq=20
(rdata0x425044)
18:25:10.997 tsx0x46c894 ..Request to terminate transaction
18:25:10.997 tsx0x46c894 ...State changed from Completed to
Terminated, event=USER
18:25:10.997 dlg0x46be74 ....Transaction tsx0x46c894 state changed
to Terminated
18:25:10.997 simpleua.c ..Call state changed to CONFIRMED
18:25:10.997 tsx0x46c894 Timeout timer event
18:25:10.997 tsx0x46c894 .State changed from Terminated to
Destroyed, event=TIMER
18:25:10.997 tdta0x476af4 ..Destroying txdata Response msg
200/INVITE/cseq=20 (tdta0x476af4)
18:25:10.997 tsx0x46c894 Transaction destroyed!
18:25:11.182 strm0x4787f4 !RTP status: badpt=0, badssrc=0, dup=0,
outorder=-1, probation=-1, restart=0
18:25:11.182 strm0x4787f4 RTP status: badpt=0, badssrc=0, dup=0,
outorder=0, probation=-1, restart=0
18:25:11.182 strm0x4787f4 RTP decode error: Invalid RTP version
(PJMEDIA_RTP_EINVER) [err:220122]
18:25:11.184 strm0x4787f4 !Jitter buffer starts returning normal
frames (after 31 empty/lost)
18:25:11.366 strm0x4787f4 !VAD re-enabled
18:25:11.366 strm0x4787f4 Starting silence
18:25:11.665 strm0x4787f4 !Frame lost, recovered!
18:25:11.665 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:11.846 strm0x4787f4 Frame lost, recovered!
18:25:11.866 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:12.046 strm0x4787f4 Frame lost, recovered!
18:25:12.046 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:12.227 strm0x4787f4 Frame lost, recovered!
18:25:12.247 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:12.427 strm0x4787f4 Frame lost, recovered!
18:25:12.427 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:12.608 strm0x4787f4 Frame lost, recovered!
18:25:12.628 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:12.808 strm0x4787f4 Frame lost, recovered!
18:25:12.808 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:12.989 strm0x4787f4 Frame lost, recovered!
18:25:13.009 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:13.189 strm0x4787f4 Frame lost, recovered!
18:25:13.189 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:13.407 strm0x4787f4 Frame lost, recovered!
18:25:13.407 strm0x4787f4 Jitter buffer starts returning normal
frames (after 1 empty/lost)
18:25:13.482 sip_endpoint.c !Processing incoming message: Request msg
BYE/cseq=21 (rdata0x425044)
18:25:13.482 simpleua.c .RX 319 bytes Request msg BYE/cseq=21
(rdata0x425044) from UDP 192.168.1.90:5060:
BYE sip:simpleuas@192.168.1.3:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK.br72efqbm;rport
From: <sip:1@rs>;tag=SdNG8yJxz
To: <sip:333@192.168.1.3>;tag=fc198f5f-2694-494f-8e66-4c13475e148a
CSeq: 21 BYE
Call-ID: RicfXtLEdQ
Max-Forwards: 70
User-Agent: LinphoneAndroid/4.0.1 (belle-sip/1.6.3)
--end msg--
18:25:13.482 dlg0x46be74 .Received Request msg BYE/cseq=21
(rdata0x425044)
18:25:13.482 tsx0x46c894 ...Transaction created for Request msg
BYE/cseq=21 (rdata0x425044)
18:25:13.482 tsx0x46c894 ..Incoming Request msg BYE/cseq=21
(rdata0x425044) in state Null
18:25:13.482 tsx0x46c894 ...State changed from Null to Trying,
event=RX_MSG
18:25:13.482 dlg0x46be74 ....Transaction tsx0x46c894 state changed
to Trying
18:25:13.482 endpoint .....Response msg 200/BYE/cseq=21
(tdta0x473b94) created
18:25:13.482 dlg0x46be74 ......Sending Response msg 200/BYE/cseq=21
(tdta0x473b94)
18:25:13.482 tsx0x46c894 ......Sending Response msg 200/BYE/cseq=21
(tdta0x473b94) in state Trying
18:25:13.482 simpleua.c .......TX 267 bytes Response msg
200/BYE/cseq=21 (tdta0x473b94) to UDP 192.168.1.90:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.1.90:5060;rport=5060;received=192.168.1.90;branch=z9hG4bK.br72efqbm
Call-ID: RicfXtLEdQ
From: <sip:1@rs>;tag=SdNG8yJxz
To: <sip:333@192.168.1.3>;tag=fc198f5f-2694-494f-8e66-4c13475e148a
CSeq: 21 BYE
Content-Length: 0
--end msg--
18:25:13.482 tsx0x46c894 .......State changed from Trying to
Completed, event=TX_MSG
18:25:13.482 dlg0x46be74 ........Transaction tsx0x46c894 state
changed to Completed
18:25:13.482 simpleua.c .....Call DISCONNECTED [reason=200 (OK)]
18:25:13.482 simpleua.c .....One call completed, application
quitting...
18:25:13.482 dlg0x46be74 ......Session count dec to 3 by mod-invite
18:25:13.482 simpleua.c Total pool memory allocated=205 KB,
used=174 KB
[Thread 0x89cffb40 (LWP 12286) exited]
^C
Thread 1 "simpleua" received signal SIGINT, Interrupt.
0xb7fd5d39 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fd5d39 in __kernel_vsyscall ()
#1 0xb74dffbe in __pthread_timedjoin_ex () from /lib/libpthread.so.0
#2 0xb74dfd22 in pthread_join () from /lib/libpthread.so.0
#3 0xb7d73dca in pj_thread_join (p=0x481f34) at
../src/pj/os_core_unix.c:724
#4 0xb7c3f71b in alsa_stream_stop (s=0x47b8b4) at
../src/pjmedia-audiodev/alsa_dev.c:1045
#5 0xb7ce3e9e in pjmedia_aud_stream_stop (strm=0x47b8b4) at
../src/pjmedia/audiodev.c:619
#6 0xb7cb9bb4 in stop_sound_device (snd_port=0x47b654) at
../src/pjmedia/sound_port.c:347
#7 0xb7cba15e in pjmedia_snd_port_destroy (snd_port=0x47b654) at
../src/pjmedia/sound_port.c:538
#8 0x00402114 in main (argc=<optimized out>, argv=<optimized out>) at
simpleua.c:572
(gdb)
Ming писал 2019-03-08 05:57:
Hi Oleg,
Thanks for the report. Just fixed this in r5942
(https://trac.pjsip.org/repos/changeset/5942).
Regards,
Ming
On Fri, Mar 8, 2019 at 2:03 AM <flot@xxxxxxxxxxx> wrote:
Hi.
Version 2.8 (or 2.8-svn)
I run simpleua and call from linphone to simpleua
# gdb pjproject/pjsip-apps/bin/samples/i686-pc-linux-gnu/simpleua
.....
(gdb) run
.....
20:40:50.382 tsx0x46c124 ....State changed from Trying to
Proceeding, event=TX_MSG
20:40:50.382 dlg0x46b704 .....Transaction tsx0x46c124 state
changed
to Proceeding
20:40:50.382 simpleua.c ......Call state changed to INCOMING
20:40:50.382 simpleua.c ......Call state changed to EARLY
20:40:50.382 sip_transport. ..Tx data Response msg
180/INVITE/cseq=20
(tdta0x476af4) cloned
20:40:50.382 inv0x46b704 ..SDP negotiation done, status=0
20:40:50.382 strm0x4787f4 ..VAD temporarily disabled
20:40:50.382 rtp.c ..pjmedia_rtp_session_init:
ses=0x47a9dc,
default_pt=8, ssrc=0x695c2040
20:40:50.382 rtp.c ..pjmedia_rtp_session_init:
ses=0x47a7cc,
default_pt=8, ssrc=0x695c2040
simpleua: ../src/pjmedia/event.c:253: pjmedia_event_subscribe:
Assertion
`mgr' failed.
Thread 1 "simpleua" received signal SIGABRT, Aborted.
0xb7fd5d39 in __kernel_vsyscall ()
(gdb)
Oleg
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org