onsip / onsip-cordova

Other
48 stars 29 forks source link

SIP Call fail on iOS Device but work on browser #14

Open Frulko opened 9 years ago

Frulko commented 9 years ago

Hi everyone, first thank you for your plugin. It's very cool and useful. I have a little problem :

I work with a custom SIP server. I wrote an example code which works on my browser. But the same code on iOS (with ios specifics settings) doesn't work. Few logs have been generated on XCode but the calling failed.

I tried your example code to make a call with the "sip:welcome@onsip.com" and it works.

Here the generated logs :

2015-02-09 15:29:54.320 HelloCordova[1097:683021] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/84EFBDF1-42F8-4D25-88E1-31BE04673F4F/Library/Cookies/Cookies.binarycookies
2015-02-09 15:29:54.465 HelloCordova[1097:683021] Apache Cordova native platform version 3.6.3 is starting.
2015-02-09 15:29:54.466 HelloCordova[1097:683021] Multi-tasking -> Device: YES, App: YES
2015-02-09 15:29:54.473 HelloCordova[1097:683021] Unlimited access to network resources
2015-02-09 15:29:54.477 HelloCordova[1097:683021] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/

2015-02-09 15:29:54.730 HelloCordova[1097:683021] Resetting plugins due to page load.
2015-02-09 15:29:54.853 HelloCordova[1097:683021] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/B05C6610-A495-418A-858A-8D26EA525FFC/HelloCordova.app/www/index.html
2015-02-09 15:29:54.999 HelloCordova[1097:683021] UA
WebRtc VoiceEngine codecs:
ISAC/16000/1 (103)
PCMU/8000/1 (0)
PCMA/8000/1 (8)
Warning(webrtcvoiceengine.cc:490): Unexpected codec: PCMU/8000/2 (110)
Warning(webrtcvoiceengine.cc:490): Unexpected codec: PCMA/8000/2 (118)
ILBC/8000/1 (102)
G722/16000/1 (9)
Warning(webrtcvoiceengine.cc:490): Unexpected codec: G722/16000/2 (119)
opus/48000/2 (111)
CN/8000/1 (13)
CN/16000/1 (105)
CN/32000/1 (106)
telephone-event/8000/1 (126)
red/8000/1 (127)
WebRtcVideoEngine::WebRtcVideoEngine
webrtc: Thread with name:Trace started 
webrtc: (vie_impl.cc:133): SetTraceFilter: filter: 8206
webrtc: (vie_impl.cc:138): SetTraceCallback: 
WebRtcVoiceEngine::Init
webrtc: Thread with name:ProcessThread started 
webrtc: CheckPlatform
webrtc: current platform is IOS
webrtc: CreatePlatformSpecificObjects
webrtc: output: kPlatformDefaultAudio
webrtc: iPhone Audio APIs will be utilized
webrtc: AttachAudioBuffer
webrtc:   OS info: iOS
webrtc: Thread with name:CaptureWorkerThread started 
webrtc: output: available=0
webrtc: output: available=0
webrtc: TransmitMixer::SetAudioProcessingModule(audioProcessingModule=0x198f71e0)
webrtc: OutputMixer::SetAudioProcessingModule(audioProcessingModule=0x198f71e0)
WebRtc VoiceEngine Version:
VoiceEngine 4.1.0
Build: Aug  6 2014 12:27:42 ?
Applying audio options: AudioOptions {aec: false, agc: false, ns: true, hf: true, swap: false, typing: false, conference: false, agc_delta: 0, experimental_agc: false, experimental_aec: false, experimental_ns: false, aec_dump: false, opus_fec: false, }
High pass filter enabled? 1
Stereo swapping enabled? 0
Typing detection is enabled? 0
Warning(webrtcvoiceengine.cc:867): SetTypingDetectionStatus(0) failed, err=8003
Error(webrtcvideoengine.cc:1469): webrtc: (voe_audio_processing_impl.cc:1001): SetTypingDetectionStatus: not supported
Adjust agc delta is 0
Adjusting AGC level from default -3dB to -3dB
Aec dump is enabled? 0
Experimental aec is 0
Opus FEC is enabled? 0
WebRtc VoiceEngine codecs:
opus/48000/2 (111)
ISAC/16000/1 (103)
G722/16000/1 (9)
ILBC/8000/1 (102)
PCMU/8000/1 (0)
PCMA/8000/1 (8)
CN/32000/1 (106)
CN/16000/1 (105)
CN/8000/1 (13)
red/8000/1 (127)
telephone-event/8000/1 (126)
WebRtcVoiceEngine::Init Done!
WebRtcVideoEngine::Init
WebRtcVideoEngine::InitVideoEngine
WebRtc VideoEngine Version:
VideoEngine 3.55.0
Build: Aug  6 2014 12:27:45 ?
webrtc: (vie_base_impl.cc:68): SetVoiceEngine: SetVoiceEngine
VideoEngine Init done
webrtc: (vie_render_impl.cc:64): RegisterVideoRenderModule: 
Applying audio options: AudioOptions {aec: false, agc: false, ns: true, hf: true, swap: false, typing: false, conference: false, agc_delta: 0, experimental_agc: false, experimental_aec: false, experimental_ns: false, aec_dump: false, opus_fec: false, }
High pass filter enabled? 1
Stereo swapping enabled? 0
Typing detection is enabled? 0
Warning(webrtcvoiceengine.cc:867): SetTypingDetectionStatus(0) failed, err=8003
Adjust agc delta is 0
Error(webrtcvideoengine.cc:1469): webrtc: (voe_audio_processing_impl.cc:1001): SetTypingDetectionStatus: not supported
Adjusting AGC level from default -3dB to -3dB
Aec dump is enabled? 0
Experimental aec is 0
Opus FEC is enabled? 0
Allowing SCTP data engine.
Generating identity.
Error(webrtcvideoengine.cc:1469): webrtc: NumberOfCapabilities is not supported on the iOS platform.
Created VideoCapturer for Front Camera
Failed to find best capture format, fall back to the requested format I420 640x480x30
VAdapt input interval changed from 0 to 33333333
Camera 'com.apple.avfoundation.avcapturedevice.built-in_video:1' started with format I420 640x480x30, elapsed time 1 ms
2015-02-09 15:29:56.344 HelloCordova[1097:683042] WARNING: -[<AVCaptureConnection: 0x19a0f720> setVideoMinFrameDuration:] is deprecated.  Please use AVCaptureDevice setActiveVideoMinFrameDuration
2015-02-09 15:29:56.344 HelloCordova[1097:683042] WARNING: -[<AVCaptureConnection: 0x19a0f720> setVideoMaxFrameDuration:] is deprecated.  Please use AVCaptureDevice setActiveVideoMaxFrameDuration
2015-02-09 15:29:56.346 HelloCordova[1097:683021] addLocalStream 1
2015-02-09 15:29:56.347 HelloCordova[1097:683112] PCO onRenegotiationNeeded.
2015-02-09 15:29:56.353 HelloCordova[1097:683021] THREAD WARNING: ['PhoneRTCPlugin'] took '755.441162' ms. Plugin should use a background thread.
Ignored line: c=IN IP4 0.0.0.0
Ignored line: c=IN IP4 0.0.0.0
Created channel for audio
Setting voice channel options: AudioOptions {}
Set voice channel options.  Current options: AudioOptions {}
webrtc: (remote_bitrate_estimator_single_stream.cc:258): RemoteBitrateEstimatorFactory: Instantiating.
webrtc: (vie_base_impl.cc:167): Video channel created: 0
webrtc: (vie_network_impl.cc:74): RegisterSendTransport: channel: 0
webrtc: (vie_network_impl.cc:137): SetMTU: channel: 0 mtu: 1200
webrtc: (vie_rtp_rtcp_impl.cc:285): SetRTCPStatus: channel: 0 mode: 1
webrtc: (vie_rtp_rtcp_impl.cc:521): SetKeyFrameRequestMethod: channel: 0 method: 1
webrtc: (vie_rtp_rtcp_impl.cc:388): SetNACKStatus: channel: 0 on
Warning(webrtcvideoengine.cc:1469): webrtc: (rtp_packet_history.cc:48): Purging packet history in order to re-set status.
NACK enabled for channel 0
webrtc: (vie_base_impl.cc:211): ConnectAudioChannel: ConnectAudioChannel, video channel 0, audio channel 0
webrtc: (vie_rtp_rtcp_impl.cc:558): SetRembStatus: channel: 0 sender: off receiver: off
webrtc: (vie_rtp_rtcp_impl.cc:590): SetReceiveTimestampOffsetStatus: channel: 0enable: off id: 0
webrtc: (vie_rtp_rtcp_impl.cc:627): SetReceiveAbsoluteSendTimeStatus: channel: 0enable: off id: 0
webrtc: (vie_image_process_impl.cc:187): EnableColorEnhancement: video_channel: 0 enable: off
webrtc: (vie_codec_impl.cc:502): RegisterDecoderObserver for channel 0
webrtc: (vie_capture_impl.cc:106): External capture device allocated: 4097
webrtc: (vie_capture_impl.cc:139): Connect capture id 4097 to channel 0
webrtc: (vie_codec_impl.cc:469): RegisterEncoderObserver for channel 0
webrtc: (vie_rtp_rtcp_impl.cc:571): SetSendTimestampOffsetStatus: channel: 0enable: off id: 0
webrtc: (vie_rtp_rtcp_impl.cc:608): SetSendAbsoluteSendTimeStatus: channel: 0enable: off id: 0
webrtc: (vie_rtp_rtcp_impl.cc:658): SetTransmissionSmoothingStatus: channel: 0 enable: on
webrtc: (vie_rtp_rtcp_impl.cc:558): SetRembStatus: channel: 0 sender: off receiver: off
webrtc: (vie_rtp_rtcp_impl.cc:388): SetNACKStatus: channel: 0 on
Warning(webrtcvideoengine.cc:1469): webrtc: (rtp_packet_history.cc:48): Purging packet history in order to re-set status.
NACK enabled for channel 0
webrtc: (vie_base_impl.cc:301): StartReceive: StartReceive 0
Created channel for video
Improved WIFI BWE called.
webrtc: (vie_network_impl.cc:166): SetBandwidthEstimationConfig: channel: 0
webrtc: (remote_bitrate_estimator_single_stream.cc:258): RemoteBitrateEstimatorFactory: Instantiating.
Session:1051969493015781748 Old state:STATE_INIT New state:STATE_SENTINITIATE Type:urn:xmpp:jingle:apps:rtp:1 Transport:http://www.google.com/transport/p2p
2015-02-09 15:29:56.384 HelloCordova[1097:683112] PCO onSignalingStateChange: 1
Setting local voice description
Add send ssrc: 4137417215
Setting receive voice codecs:
ISAC/16000/1 (103)
opus/48000/2 (111)
G722/16000/1 (9)
ILBC/8000/1 (102)
PCMU/8000/1 (0)
PCMA/8000/1 (8)
CN/32000/1 (106)
CN/16000/1 (105)
CN/8000/1 (13)
red/8000/1 (127)
telephone-event/8000/1 (126)
Changing voice state, recv=0 send=0
Setting local video description
webrtc: (vie_rtp_rtcp_impl.cc:590): SetReceiveTimestampOffsetStatus: channel: 0enable: on id: 2
webrtc: (vie_rtp_rtcp_impl.cc:627): SetReceiveAbsoluteSendTimeStatus: channel: 0enable: on id: 3
AddSendStream {id:ARDAMSv0;ssrcs:[2875234910,1748033902];ssrc_groups:{semantics:FID;ssrcs:[2875234910,1748033902]};cname:UmG/becHMv7XQ9q1;sync_label:ARDAMS}
webrtc: (vie_rtp_rtcp_impl.cc:114): SetLocalSSRC: channel: 0 ssrc: 2875234910
webrtc: (vie_rtp_rtcp_impl.cc:114): SetLocalSSRC: channel: 0 ssrc: 1748033902
webrtc: (vie_rtp_rtcp_impl.cc:321): SetRTCPCName: channel: 0 rtcp_cname: UmG/becHMv7XQ9q1
webrtc: (vie_rtp_rtcp_impl.cc:114): SetLocalSSRC: channel: 0 ssrc: 2875234910
Add send ssrc: 2875234910
webrtc: (vie_codec_impl.cc:278): SetReceiveCodec for channel 0
webrtc: (vie_codec_impl.cc:279): Codec type 0, payload type d
webrtc: (vie_codec_impl.cc:278): SetReceiveCodec for channel 0
webrtc: (vie_codec_impl.cc:279): Codec type 3, payload type t
webrtc: (vie_codec_impl.cc:278): SetReceiveCodec for channel 0
webrtc: (vie_codec_impl.cc:279): Codec type 4, payload type u
webrtc: (vie_rtp_rtcp_impl.cc:227): SetRtxReceivePayloadType: channel: 0 payload_type: 96
Buffer latency is 0
webrtc: (vie_rtp_rtcp_impl.cc:474): SetSenderBufferingMode: channel: 0 target_delay_ms: 0
Warning(webrtcvideoengine.cc:1469): webrtc: (rtp_packet_history.cc:48): Purging packet history in order to re-set status.
webrtc: (vie_rtp_rtcp_impl.cc:501): SetReceiverBufferingMode: channel: 0 target_delay_ms: 0
Changing video state, recv=0 send=0
Setting voice channel options: AudioOptions {}
Set voice channel options.  Current options: AudioOptions {}
webrtc: (vie_base_impl.cc:78): RegisterCpuOveruseObserver: RegisterCpuOveruseObserver on channel 0
webrtc: (vie_base_impl.cc:78): RegisterCpuOveruseObserver: RegisterCpuOveruseObserver on channel 0
WebRtcOveruseObserver enable: 0
Local and Remote descriptions must be applied to get SSL Role of the session.
2015-02-09 15:29:56.391 HelloCordova[1097:683021] sendMessage 1
2015-02-09 15:29:56.391 HelloCordova[1097:683021] SENDING MESSAGE: {"sdp":"v=0\r\no=- 1051969493015781748 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS ARDAMS\r\nm=audio 1 RTP\/SAVPF 103 111 9 102 0 8 106 105 13 127 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:l66L4fecuxy\/++mT\r\na=ice-pwd:kCmblardPuqpudu8dm1lM105\r\na=ice-options:google-ice\r\na=fingerprint:sha-1 5A:AA:38:4C:6A:FC:98:2C:03:AA:3A:96:6D:5B:18:90:F7:EC:51:08\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/abs-send-time\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus\/48000\/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC\/16000\r\na=rtpmap:9 G722\/16000\r\na=rtpmap:102 ILBC\/8000\r\na=rtpmap:0 PCMU\/8000\r\na=rtpmap:8 PCMA\/8000\r\na=rtpmap:106 CN\/32000\r\na=rtpmap:105 CN\/16000\r\na=rtpmap:13 CN\/8000\r\na=rtpmap:127 red\/8000\r\na=rtpmap:126 telephone-event\/8000\r\na=maxptime:60\r\na=ssrc:4137417215 cname:UmG\/becHMv7XQ9q1\r\na=ssrc:4137417215 msid:ARDAMS ARDAMSa0\r\na=ssrc:4137417215 mslabel:ARDAMS\r\na=ssrc:4137417215 label:ARDAMSa0\r\nm=video 1 RTP\/SAVPF 100 116 117 96\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:l66L4fecuxy\/++mT\r\na=ice-pwd:kCmblardPuqpudu8dm1lM105\r\na=ice-options:google-ice\r\na=fingerprint:sha-1 5A:AA:38:4C:6A:FC:98:2C:03:AA:3A:96:6D:5B:18:90:F7:EC:51:08\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/abs-send-time\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:100 VP8\/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=rtpmap:116 red\/90000\r\na=rtpmap:117 ulpfec\/90000\r\na=rtpmap:96 rtx\/90000\r\na=fmtp:96 apt=100\r\na=ssrc-group:FID 2875234910 1748033902\r\na=ssrc:2875234910 cname:UmG\/becHMv7XQ9q1\r\na=ssrc:2875234910 msid:ARDAMS ARDAMSv0\r\na=ssrc:2875234910 mslabel:ARDAMS\r\na=ssrc:2875234910 label:ARDAMSv0\r\na=ssrc:1748033902 cname:UmG\/becHMv7XQ9q1\r\na=ssrc:1748033902 msid:ARDAMS ARDAMSv0\r\na=ssrc:1748033902 mslabel:ARDAMS\r\na=ssrc:1748033902 label:ARDAMSv0\r\n","type":"offer"}
Transport: audio, allocating candidates
Jingle:Net[pdp_ip0:10.186.38.104/32:Unknown]: Allocation Phase=Udp
Jingle:Port[:1:0::Net[pdp_ip0:10.186.38.104/32:Unknown]]: Port created
AllocationSequence: UDPPort will be handling the STUN candidate generation.
Adding allocated port for audio
Jingle:Port[audio:1:0::Net[pdp_ip0:10.186.38.104/32:Unknown]]: Added port to allocator
2015-02-09 15:29:56.396 HelloCordova[1097:683112] PCO onIceGatheringChange. 1
2015-02-09 15:29:56.400 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.401 HelloCordova[1097:683112] SENDING MESSAGE: {"state":"GATHERING","type":"IceGatheringChange"}
Transport: audio, allocating candidates
2015-02-09 15:29:56.402 HelloCordova[1097:683112] PCO onIceGatheringChange. 1
2015-02-09 15:29:56.403 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.404 HelloCordova[1097:683112] SENDING MESSAGE: {"state":"GATHERING","type":"IceGatheringChange"}
Transport: video, allocating candidates
2015-02-09 15:29:56.406 HelloCordova[1097:683112] PCO onIceGatheringChange. 1
2015-02-09 15:29:56.406 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.406 HelloCordova[1097:683112] SENDING MESSAGE: {"state":"GATHERING","type":"IceGatheringChange"}
Transport: video, allocating candidates
2015-02-09 15:29:56.407 HelloCordova[1097:683112] PCO onIceGatheringChange. 1
2015-02-09 15:29:56.408 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.408 HelloCordova[1097:683112] SENDING MESSAGE: {"state":"GATHERING","type":"IceGatheringChange"}
2015-02-09 15:29:56.409 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[audio] Index[0] Sdp[candidate:1616667645 1 udp 2122260223 10.186.38.104 60113 typ host generation 0]
2015-02-09 15:29:56.410 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.410 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.411 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"audio","candidate":"candidate:1616667645 1 udp 2122260223 10.186.38.104 60113 typ host generation 0","label":0}
2015-02-09 15:29:56.412 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[audio] Index[0] Sdp[candidate:1616667645 2 udp 2122260223 10.186.38.104 60113 typ host generation 0]
2015-02-09 15:29:56.412 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.413 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.413 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"audio","candidate":"candidate:1616667645 2 udp 2122260223 10.186.38.104 60113 typ host generation 0","label":0}
2015-02-09 15:29:56.414 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[video] Index[1] Sdp[candidate:1616667645 1 udp 2122260223 10.186.38.104 60113 typ host generation 0]
2015-02-09 15:29:56.415 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.415 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.416 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"video","candidate":"candidate:1616667645 1 udp 2122260223 10.186.38.104 60113 typ host generation 0","label":1}
2015-02-09 15:29:56.417 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[video] Index[1] Sdp[candidate:1616667645 2 udp 2122260223 10.186.38.104 60113 typ host generation 0]
2015-02-09 15:29:56.417 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.418 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.418 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"video","candidate":"candidate:1616667645 2 udp 2122260223 10.186.38.104 60113 typ host generation 0","label":1}
Jingle:Net[pdp_ip0:10.186.38.104/32:Unknown]: Allocation Phase=Relay
Jingle:Port[:1:0:relay:Net[pdp_ip0:10.186.38.104/32:Unknown]]: Port created
Adding allocated port for audio
Jingle:Port[audio:1:0:relay:Net[pdp_ip0:10.186.38.104/32:Unknown]]: Added port to allocator
Warning(turnport.cc:488): Jingle:Port[audio:1:0:relay:Net[pdp_ip0:10.186.38.104/32:Unknown]]: TURN host lookup received error 8
2015-02-09 15:29:56.452 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[audio] Index[0] Sdp[candidate:3776210249 1 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0]
2015-02-09 15:29:56.453 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.453 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.453 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"audio","candidate":"candidate:3776210249 1 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0","label":0}
2015-02-09 15:29:56.454 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[audio] Index[0] Sdp[candidate:3776210249 2 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0]
2015-02-09 15:29:56.455 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.455 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.456 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"audio","candidate":"candidate:3776210249 2 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0","label":0}
2015-02-09 15:29:56.457 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[video] Index[1] Sdp[candidate:3776210249 1 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0]
2015-02-09 15:29:56.457 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.458 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.458 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"video","candidate":"candidate:3776210249 1 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0","label":1}
2015-02-09 15:29:56.459 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[video] Index[1] Sdp[candidate:3776210249 2 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0]
2015-02-09 15:29:56.460 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.460 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.461 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"video","candidate":"candidate:3776210249 2 udp 1686052607 80.12.39.104 60113 typ srflx raddr 10.186.38.104 rport 60113 generation 0","label":1}
Jingle:Net[pdp_ip0:10.186.38.104/32:Unknown]: Allocation Phase=Tcp
Jingle:Port[:1:0:local:Net[pdp_ip0:10.186.38.104/32:Unknown]]: Port created
Adding allocated port for audio
Jingle:Port[audio:1:0:local:Net[pdp_ip0:10.186.38.104/32:Unknown]]: Added port to allocator
2015-02-09 15:29:56.504 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[audio] Index[0] Sdp[candidate:786407181 1 tcp 1518280447 10.186.38.104 56344 typ host generation 0]
2015-02-09 15:29:56.504 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.505 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.505 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"audio","candidate":"candidate:786407181 1 tcp 1518280447 10.186.38.104 56344 typ host generation 0","label":0}
2015-02-09 15:29:56.506 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[audio] Index[0] Sdp[candidate:786407181 2 tcp 1518280447 10.186.38.104 56344 typ host generation 0]
2015-02-09 15:29:56.507 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.508 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.508 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"audio","candidate":"candidate:786407181 2 tcp 1518280447 10.186.38.104 56344 typ host generation 0","label":0}
2015-02-09 15:29:56.510 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[video] Index[1] Sdp[candidate:786407181 1 tcp 1518280447 10.186.38.104 56344 typ host generation 0]
2015-02-09 15:29:56.511 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.511 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.512 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"video","candidate":"candidate:786407181 1 tcp 1518280447 10.186.38.104 56344 typ host generation 0","label":1}
2015-02-09 15:29:56.512 HelloCordova[1097:683112] PCO onICECandidate.
  Mid[video] Index[1] Sdp[candidate:786407181 2 tcp 1518280447 10.186.38.104 56344 typ host generation 0]
2015-02-09 15:29:56.513 HelloCordova[1097:683112] gotICECandidate -- sending message
2015-02-09 15:29:56.513 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.514 HelloCordova[1097:683112] SENDING MESSAGE: {"type":"candidate","id":"video","candidate":"candidate:786407181 2 tcp 1518280447 10.186.38.104 56344 typ host generation 0","label":1}
Jingle:Net[pdp_ip0:10.186.38.104/32:Unknown]: Allocation Phase=SslTcp
All candidates gathered for audio:1:0
Transport: audio, component 1 allocation complete
Transport: audio, component 2 allocation complete
Transport: video, component 1 allocation complete
Transport: video, component 2 allocation complete
Transport: audio allocation complete
Transport: video allocation complete
Candidate gathering is complete.
2015-02-09 15:29:56.556 HelloCordova[1097:683112] PCO onIceGatheringChange. 2
2015-02-09 15:29:56.557 HelloCordova[1097:683112] sendMessage 1
2015-02-09 15:29:56.557 HelloCordova[1097:683112] SENDING MESSAGE: {"state":"COMPLETE","type":"IceGatheringChange"}
Captured frame size 480x640. Expected format I420 640x480x30
VAdapt Input Resolution Change: Previous input resolution: 640x480 New input resolution: 480x640 New output resolution: 480x640
2015-02-09 15:29:56.789 HelloCordova[1097:683042] Reset Ui
2015-02-09 15:29:56.790 HelloCordova[1097:683042] sendMessage 1
Destroying NSS identity
Destroying NSS identity
Warning(webrtcvideoengine.cc:2550): GetStats: sender information not ready.
Session:1051969493015781748 Old state:STATE_SENTINITIATE New state:STATE_RECEIVEDTERMINATE Type:urn:xmpp:jingle:apps:rtp:1 Transport:http://www.google.com/transport/p2p
2015-02-09 15:29:56.795 HelloCordova[1097:683112] PCO onIceConnectionChange. 6
2015-02-09 15:29:56.796 HelloCordova[1097:683112] PCO onSignalingStateChange: 5
webrtc: (neteq_impl.cc:112): Deleting NetEqImpl object.
Destroyed channel
webrtc: (vie_base_impl.cc:78): RegisterCpuOveruseObserver: RegisterCpuOveruseObserver on channel 0
webrtc: (vie_codec_impl.cc:485): DeregisterEncoderObserver for channel 0
webrtc: (vie_capture_impl.cc:181): DisconnectCaptureDevice 0
webrtc: (vie_capture_impl.cc:125): ReleaseCaptureDevice 4097
webrtc: (vie_render_impl.cc:135): RemoveRenderer: render_id: 0
Warning(webrtcvideoengine.cc:1469): webrtc: Stop: Not running
webrtc: (vie_network_impl.cc:94): DeregisterSendTransport: channel: 0
Removing video stream 0 with VideoEngine channel #0
webrtc: (vie_codec_impl.cc:518): DeregisterDecodeObserver for channel 0
webrtc: (vie_base_impl.cc:205): Channel deleted 0
Destroyed channel
Error(webrtcsession.cc:958): SetAudioSend: No audio channel exists.
Warning(webrtcsession.cc:996): Video not used in this call.
Warning(webrtcsession.cc:1029): SetVideoSend: No video channel exists.
Destroying NSS identity
Session:1051969493015781748 Old state:STATE_RECEIVEDTERMINATE New state:STATE_DEINIT Type:urn:xmpp:jingle:apps:rtp:1 Transport:http://www.google.com/transport/p2p
Camera 'com.apple.avfoundation.avcapturedevice.built-in_video:1' stopped after capturing 6 frames and dropping 0%
WebRtcVideoEngine::Terminate
webrtc: (vie_render_impl.cc:75): DeRegisterVideoRenderModule: 
webrtc: (vie_base_impl.cc:68): SetVoiceEngine: SetVoiceEngine
WebRtcVoiceEngine::Terminate
WebRtcVideoEngine::~WebRtcVideoEngine
webrtc: (vie_impl.cc:138): SetTraceCallback: 
2015-02-09 15:29:56.941 HelloCordova[1097:683042] sendMessage 1

And my code :

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {

    var session;

    var endButton = document.getElementById('endCall');
    endButton.addEventListener("click", function () {
                               session.bye();
                               alert("Call Ended");
                               }, false);

    var SIP = cordova.require("com.onsip.cordova.Sipjs");

    // Use plugin version of MediaHandler
    var PhoneRTCMediaHandler = cordova.require("com.onsip.cordova.SipjsMediaHandler")(SIP);

    // Set my UA to use the MediaHandler
    var ua = new SIP.UA({
                        mediaHandlerFactory: PhoneRTCMediaHandler,
                        authorizationUser : 'xxxxxxxx',
                        realm: 'xxxxx',
                        domain: '000.000.000.000',
                        password : 'xxxxxx',
                        wsServer : ['ws://000.000.000.000:8080/ws'],
                        displayName: 'xxxx',
                        registerExpires: 200
                        });

    var options = {
    media: {
    constraints: {
    audio: true,
    video: false
    },
    render: {
    remote: {
    audio: document.getElementById('remoteVideo')
    },
    local: {
    audio: document.getElementById('localVideo')
    }
    }
    }
    };
    //makes the call

    session = ua.invite('sip:00000000@xivo', options);

    console.log('UA');
}

Thank you for your helping :)

egreenmachine commented 9 years ago

The fact that it works with onsip sounds like it is a problem with you SIP server. The libraries used on iOS are more sensitive to mishaps than those used on the browser. I pushed several updates to the project, so try the latest version and see if that resolves your issue.

Frulko commented 9 years ago

Hi, thanks for your answer. In fact I checked on the server the logs. It seems that the phonegap plugin makes the call with video but I set video to false in my Javascript declaration. The server saw the video request and it denied the call.

Can I force the call without the video only audio ? Thanks

The logs :

INVITE sip:06123456@xxx.yyy.zzz.www SIP/2.0 
Via: SIP/2.0/WS 7ci8m7sqp6j0.invalid;branch=z9hG4bK4697752 
Max-Forwards: 70 
To: <sip:06123456@xxx.yyy.zzz.www> 
From: <sip:user@xxx.yyy.zzz.www>;tag=iesac5o5af 
Call-ID: 340lhbhcmtajakmtio68 
CSeq: 5306 INVITE 
Authorization: Digest algorithm=MD5, username="user", realm="xivo", nonce="4f33d322", uri="sip:06123456@xxx.yyy.zzz.www", response="f6d9e5707d8643b97d866973102c01df" 
Contact: <sip:7vo8vjof@7ci8m7sqp6j0.invalid;transport=ws;ob> 
Allow: ACK,CANCEL,BYE,OPTIONS,INFO,NOTIFY 
Content-Type: application/sdp 
Supported: outbound 
User-Agent: SIP.js/0.6.4 
Content-Length: 4258 

v=0 
o=- 3115888991610566656 2 IN IP4 127.0.0.1 
s=- 
t=0 0 
a=group:BUNDLE audio video 
a=msid-semantic: WMS ARDAMS 
m=audio 1 RTP/SAVPF 103 111 9 102 0 8 106 105 13 127 126 
c=IN IP4 0.0.0.0 
a=rtcp:1 IN IP4 0.0.0.0 
a=ice-ufrag:ldIgjUOeYByftxYH 
a=ice-pwd:duBtoop5VGhUCVE9KFyI2Bek 
a=ice-options:google-ice 
a=fingerprint:sha-1 9B:72:40:A0:5F:1A:B5:FE:27:89:94:07:E1:D5:7F:7C:8A:83:3E:13 
a=setup:actpass 
a=mid:audio 
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level 
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time 
a=sendrecv 
a=rtcp-mux 
a=rtpmap:111 opus/48000/2 
a=fmtp:111 minptime=10 
a=rtpmap:103 ISAC/16000 
a=rtpmap:9 G722/16000 
a=rtpmap:102 ILBC/8000 
a=rtpmap:0 PCMU/8000 
a=rtpmap:8 PCMA/8000 
a=rtpmap:106 CN/32000 
a=rtpmap:105 CN/16000 
a=rtpmap:13 CN/8000 
a=rtpmap:127 red/8000 
a=rtpmap:126 telephone-event/8000 
a=maxptime:60 
a=ssrc:1491740405 cname:Qmf54D5xIWQvIpR/ 
a=ssrc:1491740405 msid:ARDAMS ARDAMSa0 
a=ssrc:1491740405 mslabel:ARDAMS 
a=ssrc:1491740405 label:ARDAMSa0 
a=candidate:1484770847 1 udp 2122129151 10.229.143.116 52473 typ host generation 0 
a=candidate:1484770847 2 udp 2122129151 10.229.143.116 52473 typ host generation 0 
a=candidate:1021689336 1 udp 2122063615 192.168.1.160 58204 typ host generation 0 
a=candidate:1021689336 2 udp 2122063615 192.168.1.160 58204 typ host generation 0 
a=candidate:385626863 1 tcp 1518149375 10.229.143.116 49696 typ host generation 0 
a=candidate:385626863 2 tcp 1518149375 10.229.143.116 49696 typ host generation 0 
a=candidate:1919303944 1 tcp 1518083839 192.168.1.160 49697 typ host generation 0 
a=candidate:1919303944 2 tcp 1518083839 192.168.1.160 49697 typ host generation 0 
a=candidate:3182279500 1 udp 1685855999 yyy.zzz.xxx.www 59292 typ srflx raddr 192.168.1.160 rport 58204 generation 0 
a=candidate:3182279500 2 udp 1685855999 yyy.zzz.xxx.www 59292 typ srflx raddr 192.168.1.160 rport 58204 generation 0 
a=candidate:2498949516 1 udp 1685921535 yyy.xxx.zzz.www 52473 typ srflx raddr 10.229.143.116 rport 52473 generation 0 
a=candidate:2498949516 2 udp 1685921535 yyy.xxx.zzz.www 52473 typ srflx raddr 10.229.143.116 rport 52473 generation 0 
m=video 1 RTP/SAVPF 100 116 117 96 
c=IN IP4 0.0.0.0 
a=rtcp:1 IN IP4 0.0.0.0 
a=ice-ufrag:ldIgjUOeYByftxYH 
a=ice-pwd:duBtoop5VGhUCVE9KFyI2Bek 
a=ice-options:google-ice 
a=fingerprint:sha-1 9B:72:40:A0:5F:1A:B5:FE:27:89:94:07:E1:D5:7F:7C:8A:83:3E:13 
a=setup:actpass 
a=mid:video 
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset 
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time 
a=sendrecv 
a=rtcp-mux 
a=rtpmap:100 VP8/90000 
a=rtcp-fb:100 ccm fir 
a=rtcp-fb:100 nack 
a=rtcp-fb:100 nack pli 
a=rtcp-fb:100 goog-remb 
a=rtpmap:116 red/90000 
a=rtpmap:117 ulpfec/90000 
a=rtpmap:96 rtx/90000 
a=fmtp:96 apt=100 
a=ssrc-group:FID 2396927922 658586006 
a=ssrc:2396927922 cname:Qmf54D5xIWQvIpR/ 
a=ssrc:2396927922 msid:ARDAMS ARDAMSv0 
a=ssrc:2396927922 mslabel:ARDAMS 
a=ssrc:2396927922 label:ARDAMSv0 
a=ssrc:658586006 cname:Qmf54D5xIWQvIpR/ 
a=ssrc:658586006 msid:ARDAMS ARDAMSv0 
a=ssrc:658586006 mslabel:ARDAMS 
a=ssrc:658586006 label:ARDAMSv0 
a=candidate:1484770847 1 udp 2122129151 10.229.143.116 52473 typ host generation 0 
a=candidate:1021689336 1 udp 2122063615 192.168.1.160 58204 typ host generation 0 
a=candidate:1484770847 2 udp 2122129151 10.229.143.116 52473 typ host generation 0 
a=candidate:1021689336 2 udp 2122063615 192.168.1.160 58204 typ host generation 0 
a=candidate:385626863 1 tcp 1518149375 10.229.143.116 49696 typ host generation 0 
a=candidate:385626863 2 tcp 1518149375 10.229.143.116 49696 typ host generation 0 
a=candidate:1919303944 1 tcp 1518083839 192.168.1.160 49697 typ host generation 0 
a=candidate:1919303944 2 tcp 1518083839 192.168.1.160 49697 typ host generation 0 
a=candidate:3182279500 1 udp 1685855999 yyy.zzz.xxx.www 59292 typ srflx raddr 192.168.1.160 rport 58204 generation 0 
a=candidate:3182279500 2 udp 1685855999 yyy.zzz.xxx.www 59292 typ srflx raddr 192.168.1.160 rport 58204 generation 0 
a=candidate:2498949516 1 udp 1685921535 yyy.xxx.zzz.www 52473 typ srflx raddr 10.229.143.116 rport 52473 generation 0 
a=candidate:2498949516 2 udp 1685921535 yyy.xxx.zzz.www 52473 typ srflx raddr 10.229.143.116 rport 52473 generation 0
vinhthien0301 commented 7 years ago

@Frulko you should change file PhoneRTCDelegate.m in plugin as: self.doVideo = FALSE; // before is: self.doVideo = YES;

HabibAli commented 7 years ago

Already done that but thats not the issue. The issue is call is dropped just after some seconds on iOS. Can somebody help