nesterenkodm / pjsip

PJSIP is Open Source SIP, Media, and NAT Traversal Library
495 stars 220 forks source link

Crash on accepting incoming video call #87

Closed devanshvyas closed 5 years ago

devanshvyas commented 5 years ago

App is getting crash on receiving incoming video call:

I'm using this code for accepting the video call:

var msgData = pjsua_msg_data()
pjsua_msg_data_init(&msgData)

var callInfo = pjsua_call_info()
pjsua_call_get_info(id, &callInfo)

call_opt.aud_cnt = 1
call_opt.vid_cnt = self.isVideoPossible(callId: id)
print("video count", call_opt.vid_cnt)
pjsua_call_answer2(id, &call_opt, UInt32(code), nil, &msgData)

I'm getting following Logs:

12:20:30.155           pjsua_call.c  Answering call 0: code=200
12:20:30.155        sip_transport.c  ..Tx data Response msg 180/INVITE/cseq=102 (tdta0x1171756a8) cloned
12:20:30.156         inv0x1170cd4a8  ..SDP negotiation done: Success
12:20:30.156           pjsua_call.c  ...Call 0: remote NAT type is 0 (Unknown)
12:20:30.156          pjsua_media.c  ...Call 0: updating media..
12:20:30.158          pjsua_media.c  .....Media stream call00:0 is destroyed
12:20:30.158            pjsua_aud.c  ....Audio channel update..
12:20:30.158        strm0x1170da628  .....VAD temporarily disabled
12:20:30.159                  rtp.c  .....pjmedia_rtp_session_init: ses=0x11696d718, default_pt=0, ssrc=0x6ea0bb9c
12:20:30.159                  rtp.c  .....pjmedia_rtp_session_init: ses=0x11696de10, default_pt=0, ssrc=0x6ea0bb9c
12:20:30.160               stream.c  .....Stream strm0x1170da628 created
12:20:30.160        strm0x1170da628  .....Encoder stream started
12:20:30.160        strm0x1170da628  .....Decoder stream started
12:20:30.161             resample.c  .....resample created: high qualiy, small filter, in/out rate=8000/16000
12:20:30.162             resample.c  .....resample created: high qualiy, small filter, in/out rate=16000/8000
12:20:30.162          pjsua_media.c  ....Audio updated, stream #0: PCMU (sendrecv)
12:20:30.164          pjsua_media.c  .....Media stream call00:1 is destroyed
12:20:30.164            pjsua_vid.c  ....Video channel update..
12:20:30.165          vid_toolbox.m  .....Opening codec..
12:20:30.209                  rtp.c  .....pjmedia_rtp_session_init: ses=0x116a03d8c, default_pt=97, ssrc=0x7a7d3781
12:20:30.209      vstdec0x116a03628  .....Decoding channel created 320x240 I420<-H264 22/1(~22)fps
12:20:30.209                  rtp.c  .....pjmedia_rtp_session_init: ses=0x116a0335c, default_pt=97, ssrc=0x7a7d3781
12:20:30.209      vstenc0x116a03628  .....Encoding channel created 320x240 I420->H264 15/1(~15)fps
12:20:30.210           vid_stream.c  .....Video stream vstrm0x116a03628 created
12:20:30.210      vstenc0x116a03628  .....Encoder stream started
12:20:30.210      vstdec0x116a03628  .....Decoder stream started
12:20:30.210            pjsua_vid.c  .....Setting up RX..
12:20:30.210            pjsua_vid.c  ......Creating video window: type=stream, cap_id=-1, rend_id=0
12:20:30.210             vid_port.c  .......Opening device OpenGL renderer [OpenGL] for render: format=I420, size=320x240 @22:1 fps
12:20:30.498       ios_opengl_dev.c  .......iOS OpenGL ES renderer successfully created
12:20:30.498             vid_port.c  .......Device OpenGL renderer [OpenGL] opened: format=BGRA, size=320x240 @22:1 fps
12:20:30.500             vid_conf.c  .......Added port 0 (OpenGL renderer)
12:20:30.500            pjsua_vid.c  .......stream window id 0 created for cap_dev=-1 rend_dev=0
12:20:30.500            pjsua_vid.c  .......Window 0 created
12:20:30.500             vid_conf.c  ......Added port 1 (vstdec0x116a03628)
12:20:30.500             vid_conf.c  ......Updating render state for port id 0 (1 sources)..
12:20:30.500             vid_conf.c  ......This port only has single source with matched format & size, no conversion needed
12:20:30.500             vid_conf.c  ......Port 1 (vstdec0x116a03628) transmitting to port 0 (OpenGL renderer)
12:20:30.500       ios_opengl_dev.c  ......Starting ios opengl stream
12:20:30.500            pjsua_vid.c  .....Setting up TX..
12:20:30.501             vid_conf.c  ......Added port 2 (vstenc0x116a03628)
12:20:30.501            pjsua_vid.c  ......Creating video window: type=preview, cap_id=2, rend_id=0
12:20:30.501             vid_port.c  .......Opening device Front Camera [AVF] for capture: format=I420, size=320x240 @15:1 fps
12:20:30.520             vid_port.c  .......Device Front Camera [AVF] opened: format=I420, size=352x288 @15:1 fps
12:20:30.521             vid_conf.c  .......Added port 3 (Front Camera)
12:20:30.531           darwin_dev.m  .......Native preview initialized
12:20:30.531            pjsua_vid.c  .......Preview window id 1 created for cap_dev 2, using built-in preview!
12:20:30.531            pjsua_vid.c  .......Window 1 created
welljsjs commented 5 years ago

Hi @devanshvyas, would you mind filling out our issue template?

That makes it way easier for us to track down any possible bug.

Thanks.

Btw, I also doubt that your issue is related to this repository, is it? But rather to pjsip.

devanshvyas commented 5 years ago

@welljsjs Not sure, As I have created Carthage using this getting crash on incoming video calls. It gets crash on calling pjsua_call_answer2

welljsjs commented 5 years ago

@devanshvyas What version are you using? Upgrade to 2.9.0.2 if possible. It's not related to this repository if it has to do with the pjsip internals, which seems to be the case. It is related to this repository if you're having compiler or linker errors. We do not maintain pjsip. This repository is available via cocoa pods. It aims to make pjsip available for Apple platforms, such as iOS and macOS. If you still think that your issue is related to this repository, please fill out our issue template. That way, you provide us with some useful information so we're able to help (otherwise, this issue will be closed in 30 days). That said, I don't know why you're using pjsua_call_answer2, if there's no specific reason for that, I'd go with pjsua_call_answer instead. Also have a look at the docs.

github-actions[bot] commented 5 years ago

This issue is stale because it had been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.