[pjsip] Crash after sending hangup

alaa alaa at apliman.com
Wed Apr 6 03:37:55 EDT 2016


HI ,

I am trying to build a simple server application using PJSIP(not pjsua).
the application will receive a call , wait for 2 seconds then hangup.
when the application hangups , i am getting a crash with transcation 
event timer.
Here are the logs :
Setting Channel with State 0 :
Setting Channel with State 0 :
10:30:30.577 os_core_win32. !pjlib 2.2.1 for win32 initialized
10:30:30.594 sip_endpoint.c  Creating endpoint instance...
10:30:30.594          pjlib  select() I/O Queue created (006D5E00)
10:30:30.594 sip_endpoint.c  Module "mod-msg-print" registered
10:30:30.594 sip_transport.  Transport manager created.
10:30:30.609    udp006DCCD8  SIP UDP transport started, published 
address is 192.168.10.240:5070
10:30:30.609 sip_endpoint.c  Module "mod-tsx-layer" registered
10:30:30.609 sip_endpoint.c  Module "mod-stateful-util" registered
10:30:30.609 sip_endpoint.c  Module "mod-ua" registered
10:30:30.609 sip_endpoint.c  Module "mod-invite" registered
10:30:30.610 sip_endpoint.c  Module "mod-100rel" registered
10:30:30.610 sip_endpoint.c  Module "mod-simpleua" registered
10:30:30.610 sip_endpoint.c  Module "mod-msg-log" registered
10:30:30.666     wmme_dev.c  WMME found 5 devices:
10:30:30.667     wmme_dev.c   dev_id 0: Wave mapper  (in=2, out=2)
10:30:30.667     wmme_dev.c   dev_id 1: Mic in at front panel (black) (  
(in=2, out=0)
10:30:30.668     wmme_dev.c   dev_id 2: Microphone (Realtek High Defini  
(in=2, out=0)
10:30:30.668     wmme_dev.c   dev_id 3: Stereo Mix (Realtek High Defini  
(in=2, out=0)
10:30:30.668     wmme_dev.c   dev_id 4: Speaker/HP (Realtek High Defini  
(in=0, out=2)
10:30:30.668     wmme_dev.c  WMME initialized
10:30:30.669          pjlib  select() I/O Queue created (006F015C)
10:30:30.716     simpleua.c  Ready to accept incoming calls...
Setting Channel with State 1 :
10:31:26.231 sip_endpoint.c !Processing incoming message: Request msg 
INVITE/cseq=20 (rdata006DE14C)
10:31:26.231     simpleua.c  .RX 1005 bytes Request msg INVITE/cseq=20 
(rdata006DE14C) from UDP 192.168.10.240:5080:
INVITE sip:1000 at 192.168.10.240:5070 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.240:5080;branch=z9hG4bK.wcZKN8n9I;rport
From: <sip:toto at 192.168.10.240>;tag=PG61wd10r
To: sip:1000 at 192.168.10.240
CSeq: 20 INVITE
Call-ID: irvWRJ4rGk
Max-Forwards: 70
Supported: replaces, outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, 
SUBSCRIBE, INFO
Content-Type: application/sdp
Content-Length: 440
Contact: 
<sip:toto at 192.168.10.240:5080>;+sip.instance="<urn:uuid:490650c2-f0c4-4610-8151-efb4e625c9f3>"
User-Agent: Linphone/3.7.0 (belle-sip/1.3.0)

v=0
o=toto 1146 1627 IN IP4 192.168.10.240
s=Talk
c=IN IP4 192.168.10.240
t=0 0
m=audio 7078 RTP/AVP 124 111 110 0 8 101
a=rtpmap:124 opus/48000
a=fmtp:124 useinbandfec=1; usedtx=1
a=rtpmap:111 speex/16000
a=fmtp:111 vbr=on
a=rtpmap:110 speex/8000
a=fmtp:110 vbr=on
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
m=video 9078 RTP/AVP 103 99
a=rtpmap:103 VP8/90000
a=rtpmap:99 MP4V-ES/90000
a=fmtp:99 profile-level-id=3

--end msg--
10:31:26.241    tsx007090C4  ..Transaction created for Request msg 
INVITE/cseq=20 (rdata006DE14C)
10:31:26.242    tsx007090C4  .Incoming Request msg INVITE/cseq=20 
(rdata006DE14C) in state Null
10:31:26.244    tsx007090C4  ..State changed from Null to Trying, 
event=RX_MSG
10:31:26.244    dlg0070AFDC  ...Transaction tsx007090C4 state changed to 
Trying
10:31:26.247    dlg0070AFDC  .UAS dialog created
10:31:26.247    dlg0070AFDC  .Module mod-invite added as dialog usage, 
data=006E9C5C
10:31:26.249    dlg0070AFDC  ..Session count inc to 2 by mod-invite
10:31:26.250    inv0070AFDC  .UAS invite session created for dialog 
dlg0070AFDC
10:31:26.252       endpoint  ..Response msg 180/INVITE/cseq=20 
(tdta00743E58) created
10:31:26.253    dlg0070AFDC  ..Initial answer Response msg 
180/INVITE/cseq=20 (tdta00743E58)
10:31:26.255    inv0070AFDC  ..Sending Response msg 180/INVITE/cseq=20 
(tdta00743E58)
10:31:26.256    dlg0070AFDC  ...Sending Response msg 180/INVITE/cseq=20 
(tdta00743E58)
10:31:26.258    tsx007090C4  ...Sending Response msg 180/INVITE/cseq=20 
(tdta00743E58) in state Trying
10:31:26.258     simpleua.c  ....TX 388 bytes Response msg 
180/INVITE/cseq=20 (tdta00743E58) to UDP 192.168.10.240:5080:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 
192.168.10.240:5080;rport=5080;received=192.168.10.240;branch=z9hG4bK.wcZKN8n9I
Call-ID: irvWRJ4rGk
From: <sip:toto at 192.168.10.240>;tag=PG61wd10r
To: <sip:1000 at 192.168.10.240>;tag=55e02bc261e740578fa5e2ab5d257abd
CSeq: 20 INVITE
Contact: <sip:simpleuas at 192.168.10.240:5070>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, PRACK
Content-Length:  0


--end msg--
10:31:26.261    tsx007090C4  ....State changed from Trying to 
Proceeding, event=TX_MSG
10:31:26.263    dlg0070AFDC  .....Transaction tsx007090C4 state changed 
to Proceeding
10:31:26.264     simpleua.c  ......Call state changed to INCOMING
10:31:26.267     simpleua.c  ......Call state changed to EARLY
Setting Channel with State 2 :
Setting Channel with State 4 :
10:31:26.300    inv0070AFDC !.SDP negotiation done, status=0
Allocated media Transport For Channel 0
10:31:26.301   strm00701CDC  .VAD temporarily disabled
10:31:26.304          rtp.c  .pjmedia_rtp_session_init: ses=00702610, 
default_pt=0, ssrc=0x294823
10:31:26.306          rtp.c  .pjmedia_rtp_session_init: ses=0070265C, 
default_pt=0, ssrc=0x294823
10:31:26.307       stream.c  .Stream strm00701CDC created
10:31:26.309   strm00701CDC  .Encoder stream started
10:31:26.310   strm00701CDC  .Decoder stream started
10:31:26.311   conference.c  .Creating conference bridge with 5 ports
10:31:26.314   Master/sound  .Using delay buffer with WSOLA.
10:31:26.342     wmme_dev.c  . WaveAPI Sound player "Wave mapper" 
initialized (format=PCM, clock_rate=44100, channel_count=2, 
samples_per_frame=882 (20ms))
10:31:26.361     wmme_dev.c  . WaveAPI Sound recorder "Wave mapper" 
initialized (format=PCM, clock_rate=44100, channel_count=2, 
samples_per_frame=882 (20ms))
10:31:26.362     wmme_dev.c  .WMME playback stream started
10:31:26.363     wmme_dev.c  .WMME capture stream started
10:31:26.365   conference.c  .Sound device successfully created for port 0
10:31:26.366    inv0070AFDC  .Sending Response msg 200/INVITE/cseq=20 
(tdta00743E58)
10:31:26.369    dlg0070AFDC  ..Sending Response msg 200/INVITE/cseq=20 
(tdta00743E58)
10:31:26.370    tsx007090C4  ..Sending Response msg 200/INVITE/cseq=20 
(tdta00743E58) in state Proceeding
10:31:26.372     simpleua.c  ...TX 742 bytes Response msg 
200/INVITE/cseq=20 (tdta00743E58) to UDP 192.168.10.240:5080:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 
192.168.10.240:5080;rport=5080;received=192.168.10.240;branch=z9hG4bK.wcZKN8n9I
Call-ID: irvWRJ4rGk
From: <sip:toto at 192.168.10.240>;tag=PG61wd10r
To: <sip:1000 at 192.168.10.240>;tag=55e02bc261e740578fa5e2ab5d257abd
CSeq: 20 INVITE
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, PRACK
Contact: <sip:simpleuas at 192.168.10.240:5070>
Supported: 100rel
Content-Type: application/sdp
Content-Length:   306

v=0
o=- 3668927486 3668927487 IN IP4 192.168.10.240
s=pjmedia
t=0 0
m=audio 4000 RTP/AVP 0 101
c=IN IP4 192.168.10.240
b=TIAS:64000
a=rtcp:4001 IN IP4 192.168.10.240
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
m=video 0 RTP/AVP 103 99
c=IN IP4 127.0.0.1

--end msg--
10:31:26.378    tsx007090C4  ...State changed from Proceeding to 
Completed, event=TX_MSG
10:31:26.379    dlg0070AFDC  ....Transaction tsx007090C4 state changed 
to Completed
10:31:26.382     simpleua.c  .....Call state changed to CONNECTING
10:31:26.393 sip_endpoint.c !Processing incoming message: Request msg 
ACK/cseq=20 (rdata006DE14C)
10:31:26.393     simpleua.c  .RX 286 bytes Request msg ACK/cseq=20 
(rdata006DE14C) from UDP 192.168.10.240:5080:
ACK sip:simpleuas at 192.168.10.240:5070 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.240:5080;rport;branch=z9hG4bK.ye1xcsAXF
From: <sip:toto at 192.168.10.240>;tag=PG61wd10r
To: <sip:1000 at 192.168.10.240>;tag=55e02bc261e740578fa5e2ab5d257abd
CSeq: 20 ACK
Call-ID: irvWRJ4rGk
Max-Forwards: 70


--end msg--
10:31:26.396    dlg0070AFDC  .Received Request msg ACK/cseq=20 
(rdata006DE14C)
10:31:26.397    tsx007090C4  ..Request to terminate transaction
10:31:26.399    tsx007090C4  ...State changed from Completed to 
Terminated, event=USER
10:31:26.401    dlg0070AFDC  ....Transaction tsx007090C4 state changed 
to Terminated
10:31:26.403     simpleua.c  ..Call state changed to CONFIRMED
10:31:26.404    tsx007090C4  Timeout timer event
10:31:26.406    tsx007090C4  .State changed from Terminated to 
Destroyed, event=TIMER
10:31:26.407   tdta00743E58  ..Destroying txdata Response msg 
200/INVITE/cseq=20 (tdta00743E58)
10:31:26.409    tsx007090C4  Transaction destroyed!
10:31:26.421   strm00701CDC !RTP decode error: Invalid RTP version 
(PJMEDIA_RTP_EINVER) [err:220122]
10:31:26.495   strm00701CDC  RTP status: badpt=0, badssrc=0, dup=0, 
outorder=-1, probation=-1, restart=0
10:31:26.496   strm00701CDC  RTP status: badpt=0, badssrc=0, dup=0, 
outorder=0, probation=-1, restart=0
10:31:28.397       endpoint !Request msg BYE/cseq=18468 (tdta00743E58) 
created.
10:31:28.397    dlg0070AFDC  .Sending Request msg BYE/cseq=18468 
(tdta00743E58)
10:31:28.401    tsx007090C4  ..Transaction created for Request msg 
BYE/cseq=18467 (tdta00743E58)
10:31:28.402    tsx007090C4  .Sending Request msg BYE/cseq=18467 
(tdta00743E58) in state Null
10:31:28.405  sip_resolve.c  ..Target '192.168.10.240:5080' 
type=Unspecified resolved to '192.168.10.240:5080' type=UDP (UDP transport)
10:31:28.406     simpleua.c  ..TX 328 bytes Request msg BYE/cseq=18467 
(tdta00743E58) to UDP 192.168.10.240:5080:
BYE sip:toto at 192.168.10.240:5080 SIP/2.0
Via: SIP/2.0/UDP 
192.168.10.240:5070;rport;branch=z9hG4bKPjf965aab843dd4eaf831aa19d3c8e316c
Max-Forwards: 70
From: <sip:1000 at 192.168.10.240>;tag=55e02bc261e740578fa5e2ab5d257abd
To: <sip:toto at 192.168.10.240>;tag=PG61wd10r
Call-ID: irvWRJ4rGk
CSeq: 18467 BYE
Content-Length:  0


--end msg--
10:31:28.407    tsx007090C4  ..State changed from Null to Calling, 
event=TX_MSG
10:31:28.410    dlg0070AFDC  ...Transaction tsx007090C4 state changed to 
Calling
Setting Channel with State 0 :
10:31:28.436 sip_endpoint.c !Processing incoming message: Response msg 
200/BYE/cseq=18467 (rdata006DE14C)
10:31:28.436     simpleua.c  .RX 341 bytes Response msg 
200/BYE/cseq=18467 (rdata006DE14C) from UDP 192.168.10.240:5080:
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 
192.168.10.240:5070;rport;branch=z9hG4bKPjf965aab843dd4eaf831aa19d3c8e316c
From: <sip:1000 at 192.168.10.240>;tag=55e02bc261e740578fa5e2ab5d257abd
To: <sip:toto at 192.168.10.240>;tag=PG61wd10r
Call-ID: irvWRJ4rGk
CSeq: 18467 BYE
User-Agent: Linphone/3.7.0 (belle-sip/1.3.0)
Supported: replaces, outbound


--end msg--
10:31:28.439    tsx007090C4  .Incoming Response msg 200/BYE/cseq=18467 
(rdata006DE14C) in state Calling
10:31:28.440    tsx007090C4  ..State changed from Calling to Completed, 
event=RX_MSG
10:31:28.443    dlg0070AFDC  ...Received Response msg 200/BYE/cseq=18467 
(rdata006DE14C)
10:31:28.444    dlg0070AFDC  ...Transaction tsx007090C4 state changed to 
Completed
10:31:28.446     simpleua.c  ....Call DISCONNECTED [reason=200 (OK)]
10:31:28.447     simpleua.c  ....One call completed, application quitting...
10:31:28.449    dlg0070AFDC  .....Session count dec to 1 by mod-invite
10:31:33.441    tsx007090C4  Timeout timer event
10:31:33.443    tsx007090C4  .State changed from Completed to 
Terminated, event=TIMER
10:31:33.443    dlg0070AFDC  ..Transaction tsx007090C4 state changed to 
Terminated
10:31:33.446    dlg0070AFDC  ...Dialog destroyed
10:31:33.452    tsx007090C4  Timeout timer event
10:31:33.452    tsx007090C4  .State changed from Terminated to 
Destroyed, event=TIMER


to Hangup the Call i am using the Following Code :
  pj_status_t status;
      pjsip_tx_data *tdata;

     status = pjsip_dlg_create_request(dlg, &pjsip_bye_method, -1, &tdata );
     status = pjsip_dlg_send_request ( dlg, tdata, NULL,NULL);


Is there anything missing ? Why is the application crashing after 
sending the hangup

Thx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160406/100c78fe/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: img.gif
Type: image/gif
Size: 35 bytes
Desc: not available
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160406/100c78fe/attachment.gif>


More information about the pjsip mailing list