twilio / voice-quickstart-ios

Twilio Voice Quickstart for iOS with Swift
MIT License
183 stars 97 forks source link

App is crashing while placing outbound call #387

Closed puneetk207 closed 4 years ago

puneetk207 commented 4 years ago

Before filing an issue please check that the issue is not already addressed by the following:

Please ensure that you are not sharing any Personally Identifiable Information(PII) or sensitive account information (API keys, credentials, etc.) when reporting an issue.

Description

Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[10]

Steps to Reproduce

  1. [Step one]
  2. [Step two]
  3. [Insert as many steps as needed]

Code

// Code that helps reproduce the issue

Expected Behavior

[What you expect to happen]

Actual Behavior

[What actually happens]

Reproduces How Often

[What percentage of the time does it reproduce?]

Twilio Call SID(s)

You can find the Call SID in the SDK from TVOCall.sid or TVOCallInvite.callSid. The Call SID can also be found on the Twilio Calls Console: https://www.twilio.com/console/voice/calls/logs.

Logs

// Log output when the issue occurs

Versions

All relevant version information for the issue.

Voice iOS SDK

5.4.1 [e.g. 2.0.0-beta13 via CocoaPods]

Xcode

[e.g. 8.3.3]

iOS Version

[e.g. 10.3.3]

iOS Device

[e.g. iPhone 6s Plus]

bobiechen-twilio commented 4 years ago

Hi @puneetk207

Can you provide the backtrace of the crash? you can get the log by typing bt all in the Xcode debugger. It would be helpful to get the insights about what might have caused the crash.

Thanks. -bobie

puneetk207 commented 4 years ago

Hi bobie,

Here you go,

2020-09-05 01:35:32.574108+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call connect 2020-09-05 01:35:32.574422+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Core: Creating dedicated notifier queue ... 2020-09-05 01:35:32.574732+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Initializing SIP stack ... 2020-09-05 01:35:32.576908+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Adding IPv4/IPv6 TLS transports ... 2020-09-05 01:35:32.577068+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Signaling: RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V4 0.0.0.0:0 UNKNOWN_TRANSPORT target domain=unspecified mFlowKey=0 ] 2020-09-05 01:35:32.577193+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Signaling: RESIP::TRANSPORT: Creating TLS transport for domain interface= port=0 2020-09-05 01:35:32.577477+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Signaling: RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V4 0.0.0.0:0 UNKNOWN_TRANSPORT target domain=unspecified mFlowKey=0 ] 2020-09-05 01:35:32.577593+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Signaling: RESIP::TRANSPORT: Creating TLS transport for domain interface= port=0 2020-09-05 01:35:32.577772+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Initializing DUM ... 2020-09-05 01:35:32.578060+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Starting SIP stack thread ... 2020-09-05 01:35:32.578181+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Starting DUM thread ... 2020-09-05 01:35:32.578428+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call getSignalingThread 2020-09-05 01:35:32.578532+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call getNetworkingThread 2020-09-05 01:35:32.578700+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Starting the Network Manager 2020-09-05 01:35:32.578812+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: AppleReachability::AppleReachability() 2020-09-05 01:35:32.578937+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Creating zeroAddrReachability 2020-09-05 01:35:32.579442+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call getWebRtcTrack 2020-09-05 01:35:32.579625+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call RTCIceServers 2020-09-05 01:35:32.579743+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call RTCIceServer 2020-09-05 01:35:32.579863+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Core: Creating peer connection ... 2020-09-05 01:35:32.582307+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Core: Adding local stream to peer connection ... 2020-09-05 01:35:32.582824+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call getWebRtcTrack 2020-09-05 01:35:32.583076+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: Create initial local offer 2020-09-05 01:35:32.585152+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: onCreateSessionLocalDescription 2020-09-05 01:35:32.586772+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: OnSignalingChange 2020-09-05 01:35:32.586920+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: Signaling state: have-local-offer 2020-09-05 01:35:32.588616+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: onSetSessionLocalDescription 2020-09-05 01:35:32.588829+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: Local SDP - v=0 o=- 736981527474823323 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE audio a=msid-semantic: WMS f9BFEba61D3beCb44b30462e8D40b9EB m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:qdXM a=ice-pwd:YJeQHX51bSgV7p+lY0JPHhGW a=ice-options:trickle a=fingerprint:sha-256 6A:6E:81:C0:5A:E8:0C:81:FB:B8:8B:09:73:B8:33:FD:4D:88:66:0E:2A:B5:9A:8C:FD:2B:48:30:E6:50:92:27 a=setup:actpass a=mid:audio a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=sendrecv a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/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:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:3407134371 cname:mIpsH10/5KNInfXe a=ssrc:3407134371 msid:f9BFEba61D3beCb44b30462e8D40b9EB d453caf13b6DDFdB6d16adfEa717bef5 a=ssrc:3407134371 mslabel:f9BFEba61D3beCb44b30462e8D40b9EB a=ssrc:3407134371 label:d453caf13b6DDFdB6d16adfEa717bef5 2020-09-05 01:35:32.589009+0530 GBPN.iOS[4246:1398585] DEBUG:Twilio:Core: void twilio::media::NetworkMonitor::onNetworksChanged() 2020-09-05 01:35:32.589182+0530 GBPN.iOS[4246:1398585] DEBUG:Twilio:Core: Network Name: en0, Cost: 10, Type : Wifi, Preference : 127, Active : 1, id: 2, prefix : 2409:4064:b06:18ef:: and key : en0%2409:4064:b06:18ef::/64 2020-09-05 01:35:32.589361+0530 GBPN.iOS[4246:1398585] DEBUG:Twilio:Core: Network Name: en0, Cost: 10, Type : Wifi, Preference : 126, Active : 1, id: 1, prefix : 192.168.43.0 and key : en0%192.168.43.0/24 2020-09-05 01:35:32.589452+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: twilio::voice::AsyncDnsResolver::AsyncDnsResolver(std::weak_ptr) 2020-09-05 01:35:32.589501+0530 GBPN.iOS[4246:1398585] DEBUG:Twilio:Core: Network Name: lo0, Cost: 0, Type : Loopback, Preference : 125, Active : 1, id: 4, prefix : ::1 and key : lo0%::1/128 2020-09-05 01:35:32.589631+0530 GBPN.iOS[4246:1398585] DEBUG:Twilio:Core: Network Name: lo0, Cost: 0, Type : Loopback, Preference : 124, Active : 1, id: 3, prefix : 127.0.0.0 and key : lo0%127.0.0.0/8 2020-09-05 01:35:32.589713+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: AsyncDnsResolver resolving hostname = chunderm.gll.twilio.com 2020-09-05 01:35:32.589764+0530 GBPN.iOS[4246:1398585] DEBUG:Twilio:Core: New preferred network reported by manager: key: en0%2409:4064:b06:18ef::/64, type: Wifi, cost: 10, id: 2 2020-09-05 01:35:32.590360+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: Gathered ICE candidate: candidate:3693473306 1 udp 2122262783 2409:4064:b06:18ef:a93d:45da:41e8:b70e 52048 typ host generation 0 ufrag qdXM network-id 2 network-cost 10, id: 4yN5YLdZ 2020-09-05 01:35:32.590620+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: Gathered ICE candidate: candidate:1234902657 1 udp 2122194687 192.168.43.219 55983 typ host generation 0 ufrag qdXM network-id 1 network-cost 10, id: 3pVNx9BB 2020-09-05 01:35:32.811430+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: AsyncDnsResolver Resolved ip_addr = 64:ff9b::36a9:4083, error = 0 2020-09-05 01:35:32.811775+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: virtual void twilio::voice::SipClient::onResolveResult(twilio::voice::AsyncDnsResolver *, std::string, int) 2020-09-05 01:35:32.812134+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: onResolveResult for connect, hostname = sip:chunderm.gll.twilio.com:443;transport=tls, ip_addr = 64:ff9b::36a9:4083 2020-09-05 01:35:32.812386+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: New SipCall ..., this=0x7fec7992da00, handle = 1 2020-09-05 01:35:32.812652+0530 GBPN.iOS[4246:1398583] INFO:Twilio:Core: Setting outbound proxy to: sip:[64:ff9b::36a9:4083]:443;transport=tls 2020-09-05 01:35:32.813874+0530 GBPN.iOS[4246:1398661] DEBUG:Twilio:Core: Socket created in ../resiprocate-1.8/resip/stack/TcpBaseTransport.cxx at line 223, transport: 1, socket: 35 2020-09-05 01:35:32.814028+0530 GBPN.iOS[4246:1398661] INFO:Twilio:Signaling: RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V6 64:ff9b::36a9:4083 port=443 TLS target domain=64:ff9b::36a9:4083 mFlowKey=35 ] 2020-09-05 01:35:32.814317+0530 GBPN.iOS[4246:1398661] INFO:Twilio:Signaling: RESIP::TRANSPORT: Creating TLS connection for domain [ V6 64:ff9b::36a9:4083 port=443 TLS target domain=64:ff9b::36a9:4083 mFlowKey=0 ] on 35 2020-09-05 01:35:32.822140+0530 GBPN.iOS[4246:1398583] DEBUG:Twilio:Core: Gathered ICE candidate: candidate:2232819986 1 udp 1685987071 47.29.101.111 55983 typ srflx raddr 192.168.43.219 rport 55983 generation 0 ufrag qdXM network-id 1 network-cost 10, id: Li8uS5ky 2020-09-05 01:35:38.510916+0530 GBPN.iOS[4246:1397280] INFO:Twilio:Platform: Inside publishConnectionEvent:, event name: outgoing 2020-09-05 01:35:38.511111+0530 GBPN.iOS[4246:1397280] DEBUG:Twilio:Core: API Call getSid 2020-09-05 01:35:46.731110+0530 GBPN.iOS[4246:1397280]

bobiechen-twilio commented 4 years ago

Thanks for the SDK log @puneetk207 but from the log it doesn't really indicate what caused the crash. Please use the bt all command to dump the backtrace so we can help you identify the root cause of the crash.

puneetk207 commented 4 years ago

@bobiechen-twilio I am not using Xcode. I am building an iOS app on Xamarin platform using Twilio.Voice.iOS.XamarinBinding nuget package. Please let me know if there is any command which help you out here.

bobiechen-twilio commented 4 years ago

Hi @puneetk207 There are some material about debugging the iOS native crash with Xamarin environment: https://docs.microsoft.com/en-us/xamarin/mac/deploy-test/debugging-native-crash Device (crash) logs can also be extracted using Xcode: https://docs.buddybuild.com/troubleshooting/getting_device_logs_from_xcode.html

puneetk207 commented 4 years ago

Hi @bobiechen-twilio May be this will be helpful :- Unhandled Exception: Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[10] Native stack trace: 0 CoreFoundation 0x00007fff23e3de6e exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff512539b2 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23ed09d1 _CFThrowFormattedException + 194 3 CoreFoundation 0x00007fff23edb426 -[NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38 4 CoreFoundation 0x00007fff23e9c6e7 -[NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247 5 CoreFoundation 0x00007fff23e39d71 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49 6 TwilioVoice 0x000000010804a5c5 +[TVOEndpointAnalyticsUtilities getPlatformMetadata] + 828 7 TwilioVoice 0x000000010807ea12 +[TVOEndpointAnalyticsEvent eventWithName:group:level:payload:] + 512 8 TwilioVoice 0x000000010805e463 -[TVOEventReceiver publishConnectionEvent:error:level:] + 931 9 TwilioVoice 0x0000000108062790 _ZN6twilio5voice20EventObserverAdapter7onEventENSt3__13mapINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_4pairIS9_NS0_8DataTypeEEENS2_4lessIS9_EENS7_INSA_IKS9_SC_EEEEEE + 3302 10 TwilioVoice 0x0000000108485823 _ZNSt3110function6funcIZN6twilio5voice8CallImpl9postEventERNS_3mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESB_NS_4lessISB_EENS9_INS_4pairIKSB_SB_EEEEEERSF_E4$_41NS9_ISL_EEFvvEEclEv + 227 11 libdispatch.dylib 0x00007fff5208d951 _dispatch_call_block_and_release + 12 12 libdispatch.dylib 0x00007fff5208e8cb _dispatch_client_callout + 8 13 libdispatch.dylib 0x00007fff5209acdb _dispatch_main_queue_callback_4CF + 1042 14 CoreFoundation 0x00007fff23da1869 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 15 CoreFoundation 0x00007fff23d9c3b9 CFRunLoopRun + 2041 16 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404 17 GraphicsServices 0x00007fff38c39bbe GSEventRunModal + 139 18 UIKitCore 0x00007fff49325968 UIApplicationMain + 1605 19 ??? 0x000000010f2a80e5 0x0 + 4549411045 20 ??? 0x000000010e1a4603 0x0 + 4531570179 21 ??? 0x000000010e19a8f3 0x0 + 4531529971 22 GBPN.iOS 0x00000001075844e1 mono_jit_runtime_invoke + 1569 23 GBPN.iOS 0x00000001076aa8c8 mono_runtime_invoke_checked + 136 24 GBPN.iOS 0x00000001076b0c35 mono_runtime_exec_main_checked + 117 25 GBPN.iOS 0x00000001074e34fc mono_jit_exec + 364 26 GBPN.iOS 0x00000001077cdf2d xamarin_main + 2685 27 GBPN.iOS 0x000000010749d887 main + 71 28 libdyld.dylib 0x00007fff520ce1fd start + 1

at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:406 at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/runtime/Delegates.generated.cs:128 at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception(intptr) at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at GBPN.iOS.Application.Main (System.String[] args) [0x00001] in /Users/puneetkumar/XylemWork/GBPN/GBPN.iOS/Main.cs:18 --- End of stack trace from previous location where exception was thrown ---

bobiechen-twilio commented 4 years ago

Thanks @puneetk207 this is exactly what we need.

Now it seems the crash was caused by something wrong in the SDK, can you use the logging API to enable trace level SDK log? (you might need to find the mapped API in the Xamarin plugin)

    [TwilioVoice setLogLevel:TVOLogLevelTrace];
    [TwilioVoice setLogLevel:TVOLogLevelTrace module:TVOLogModuleCore];
puneetk207 commented 4 years ago

Hi @bobiechen-twilio Yes i know that how to use this two commands.

puneetk207 commented 4 years ago

Hi @bobiechen-twilio

TwilioVoice.LogLevel = TVOLogLevel.Trace; TwilioVoice.SetLogLevel(TVOLogLevel.Trace, TVOLogModule.Core);

This i get using two commands :---

2020-09-05 02:18:55.630331+0530 GBPN.iOS[5492:1438412] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600003135760> F8BB1C28-BAE8-11D6-9C31-00039315CD46 2020-09-05 02:19:00.239702+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call connect 2020-09-05 02:19:00.240032+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Core: Creating dedicated notifier queue ... 2020-09-05 02:19:00.240314+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Initializing SIP stack ... 2020-09-05 02:19:00.242464+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Adding IPv4/IPv6 TLS transports ... 2020-09-05 02:19:00.242647+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Signaling: RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V4 0.0.0.0:0 UNKNOWN_TRANSPORT target domain=unspecified mFlowKey=0 ] 2020-09-05 02:19:00.242782+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Signaling: RESIP::TRANSPORT: Creating TLS transport for domain interface= port=0 2020-09-05 02:19:00.243089+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Signaling: RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V4 0.0.0.0:0 UNKNOWN_TRANSPORT target domain=unspecified mFlowKey=0 ] 2020-09-05 02:19:00.243208+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Signaling: RESIP::TRANSPORT: Creating TLS transport for domain interface= port=0 2020-09-05 02:19:00.243395+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Initializing DUM ... 2020-09-05 02:19:00.243774+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Starting SIP stack thread ... 2020-09-05 02:19:00.243922+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Starting DUM thread ... 2020-09-05 02:19:00.244210+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call getSignalingThread 2020-09-05 02:19:00.244339+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call getNetworkingThread 2020-09-05 02:19:00.244581+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Starting the Network Manager 2020-09-05 02:19:00.244735+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: AppleReachability::AppleReachability() 2020-09-05 02:19:00.244876+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Creating zeroAddrReachability 2020-09-05 02:19:00.245416+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call getWebRtcTrack 2020-09-05 02:19:00.245614+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call RTCIceServers 2020-09-05 02:19:00.245741+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call RTCIceServer 2020-09-05 02:19:00.245902+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Core: Creating peer connection ... 2020-09-05 02:19:00.248409+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Core: Adding local stream to peer connection ... 2020-09-05 02:19:00.248909+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call getWebRtcTrack 2020-09-05 02:19:00.249171+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: Create initial local offer 2020-09-05 02:19:00.250960+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: onCreateSessionLocalDescription 2020-09-05 02:19:00.252673+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: OnSignalingChange 2020-09-05 02:19:00.252810+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: Signaling state: have-local-offer 2020-09-05 02:19:00.254401+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: onSetSessionLocalDescription 2020-09-05 02:19:00.254595+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: Local SDP - v=0 o=- 2231835274304719591 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE audio a=msid-semantic: WMS 7aaD8A82dDF11F7aBe37F89e98d804f6 m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:vXD2 a=ice-pwd:NKgGqUJAyVU+grNsTXAVLGF0 a=ice-options:trickle a=fingerprint:sha-256 F6:EC:16:8D:96:9A:0D:F2:E3:69:DB:BC:1B:02:D5:FC:1A:85:7C:ED:F7:1C:2E:57:80:B5:D5:E4:65:3F:FE:5E a=setup:actpass a=mid:audio a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=sendrecv a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/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:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:3282883608 cname:R7kLAPop1jTeetMy a=ssrc:3282883608 msid:7aaD8A82dDF11F7aBe37F89e98d804f6 4a88790A067bdf5eaFCeCB8ebCDCCeAC a=ssrc:3282883608 mslabel:7aaD8A82dDF11F7aBe37F89e98d804f6 a=ssrc:3282883608 label:4a88790A067bdf5eaFCeCB8ebCDCCeAC 2020-09-05 02:19:00.254836+0530 GBPN.iOS[5492:1439217] DEBUG:Twilio:Core: void twilio::media::NetworkMonitor::onNetworksChanged() 2020-09-05 02:19:00.254960+0530 GBPN.iOS[5492:1439217] DEBUG:Twilio:Core: Network Name: en0, Cost: 10, Type : Wifi, Preference : 127, Active : 1, id: 2, prefix : 2409:4064:b06:18ef:: and key : en0%2409:4064:b06:18ef::/64 2020-09-05 02:19:00.255082+0530 GBPN.iOS[5492:1439217] DEBUG:Twilio:Core: Network Name: en0, Cost: 10, Type : Wifi, Preference : 126, Active : 1, id: 1, prefix : 192.168.43.0 and key : en0%192.168.43.0/24 2020-09-05 02:19:00.255195+0530 GBPN.iOS[5492:1439217] DEBUG:Twilio:Core: Network Name: lo0, Cost: 0, Type : Loopback, Preference : 125, Active : 1, id: 4, prefix : ::1 and key : lo0%::1/128 2020-09-05 02:19:00.255301+0530 GBPN.iOS[5492:1439217] DEBUG:Twilio:Core: Network Name: lo0, Cost: 0, Type : Loopback, Preference : 124, Active : 1, id: 3, prefix : 127.0.0.0 and key : lo0%127.0.0.0/8 2020-09-05 02:19:00.255439+0530 GBPN.iOS[5492:1439217] DEBUG:Twilio:Core: New preferred network reported by manager: key: en0%2409:4064:b06:18ef::/64, type: Wifi, cost: 10, id: 2 2020-09-05 02:19:00.256248+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: twilio::voice::AsyncDnsResolver::AsyncDnsResolver(std::weak_ptr) 2020-09-05 02:19:00.256453+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: AsyncDnsResolver resolving hostname = chunderm.gll.twilio.com 2020-09-05 02:19:00.256690+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: Gathered ICE candidate: candidate:3693473306 1 udp 2122262783 2409:4064:b06:18ef:a93d:45da:41e8:b70e 58292 typ host generation 0 ufrag vXD2 network-id 2 network-cost 10, id: expIwINu 2020-09-05 02:19:00.256884+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: Gathered ICE candidate: candidate:1234902657 1 udp 2122194687 192.168.43.219 63719 typ host generation 0 ufrag vXD2 network-id 1 network-cost 10, id: 0t0bY4Bc 2020-09-05 02:19:00.454318+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: Gathered ICE candidate: candidate:2232819986 1 udp 1685987071 47.29.101.111 63719 typ srflx raddr 192.168.43.219 rport 63719 generation 0 ufrag vXD2 network-id 1 network-cost 10, id: oixPnW+S 2020-09-05 02:19:00.519807+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: AsyncDnsResolver Resolved ip_addr = 64:ff9b::36a9:42d3, error = 0 2020-09-05 02:19:00.520095+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: virtual void twilio::voice::SipClient::onResolveResult(twilio::voice::AsyncDnsResolver *, std::string, int) 2020-09-05 02:19:00.520427+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: onResolveResult for connect, hostname = sip:chunderm.gll.twilio.com:443;transport=tls, ip_addr = 64:ff9b::36a9:42d3 2020-09-05 02:19:00.520605+0530 GBPN.iOS[5492:1439215] DEBUG:Twilio:Core: New SipCall ..., this=0x7fdf44051600, handle = 1 2020-09-05 02:19:00.520735+0530 GBPN.iOS[5492:1439215] INFO:Twilio:Core: Setting outbound proxy to: sip:[64:ff9b::36a9:42d3]:443;transport=tls 2020-09-05 02:19:00.521867+0530 GBPN.iOS[5492:1439234] DEBUG:Twilio:Core: Socket created in ../resiprocate-1.8/resip/stack/TcpBaseTransport.cxx at line 223, transport: 1, socket: 35 2020-09-05 02:19:00.522034+0530 GBPN.iOS[5492:1439234] INFO:Twilio:Signaling: RESIP::TRANSPORT: Connection::Connection: new connection created to who: [ V6 64:ff9b::36a9:42d3 port=443 TLS target domain=64:ff9b::36a9:42d3 mFlowKey=35 ] 2020-09-05 02:19:00.522159+0530 GBPN.iOS[5492:1439234] INFO:Twilio:Signaling: RESIP::TRANSPORT: Creating TLS connection for domain [ V6 64:ff9b::36a9:42d3 port=443 TLS target domain=64:ff9b::36a9:42d3 mFlowKey=0 ] on 35 2020-09-05 02:19:10.990504+0530 GBPN.iOS[5492:1438412] INFO:Twilio:Platform: Inside publishConnectionEvent:, event name: outgoing 2020-09-05 02:19:10.990708+0530 GBPN.iOS[5492:1438412] DEBUG:Twilio:Core: API Call getSid

bobiechen-twilio commented 4 years ago

Thanks @puneetk207! While I am checking the log, does this happen every time you try to make an outgoing call?

puneetk207 commented 4 years ago

yes every time @bobiechen-twilio

bobiechen-twilio commented 4 years ago

Hi @puneetk207

I have created a ticket for tracking this crash. One more question - what is the device you use when this happens? asking because it seems to happen when the SDK is retrieving platform information.

Thanks. -bobie

puneetk207 commented 4 years ago

@bobiechen-twilio I am running it on simulator (iOS 13.6) and do not use any physical device

puneetk207 commented 4 years ago

@bobiechen-twilio any update on this ? any workaround you can suggest ?

puneetk207 commented 4 years ago

@bobiechen-twilio any workaround for now atleast ?

bobiechen-twilio commented 4 years ago

Hi @puneetk207

Does this happen on real iOS devices in your environment? also do you know if this happen to a specific device model simulator or all of them?

We have tried the same in our environment but couldn't reproduce the same crash. Is it possible that this is caused by the Xamarin API binding? Can you open the quickstart with Xcode and see if this is happening?

Thanks, -bobie

puneetk207 commented 4 years ago

@bobiechen-twilio yes all the simulators but works on real device. It is same issue what i found while googling (see below) https://github.com/twilio/twilio-voice-ios/issues/13 So i changed the twilio sdk to 3.1.1 and it is working on simulator now.

bobiechen-twilio commented 4 years ago

Hi @puneetk207 thanks for the update.

For best compatibility, especially with the latest iOS, we still recommend using the latest version of the Voice SDK. From the crash backtrace it seems that some of the platform information or the system API might not be available with the simulators in your environment.

To help us further diagnose the issue, could you use the follow code in your app and let us know the contents of the bundleInfo variable? (you might have to find the .m file in the native Xcode project)

NSDictionary *bundleInfo = [[NSBundle mainBundle] infoDictionary];
NSLog(@"%@", bundleInfo);

Thanks, -bobie

puneetk207 commented 4 years ago

@bobiechen-twilio where to place this code while making calls or at start of app ?

bobiechen-twilio commented 4 years ago

Hi @puneetk207

At the start of app works.

puneetk207 commented 4 years ago

@bobiechen-twilio What i found after placing this code :--

{ BuildMachineOSBuild = 19G2021; CFBundleDisplayName = XXXX; CFBundleExecutable = "XXXX"; CFBundleIcons = { CFBundlePrimaryIcon = { CFBundleIconFiles = ( AppIcon20x20, AppIcon29x29, AppIcon40x40, AppIcon60x60 ); CFBundleIconName = AppIcon; }; }; CFBundleIdentifier = "XXXXX"; CFBundleInfoDictionaryVersion = "6.0"; CFBundleName = XXXX; CFBundleNumericVersion = 0; CFBundlePackageType = APPL; CFBundleShortVersionString = "XXXX"; CFBundleSignature = "????"; CFBundleSupportedPlatforms = ( iPhoneSimulator ); CFBundleVersion = "XXXXXX"; DTPlatformName = iphonesimulator; DTSDKName = "iphonesimulator13.6"; LSRequiresIPhoneOS = 1; MinimumOSVersion = "8.0"; NSMicrophoneUsageDescription = "This app needs to use your microphone"; UIBackgroundModes = ( audio, voip ); UIDeviceFamily = ( 1, 2 ); UILaunchStoryboardName = LaunchScreen; UISupportedInterfaceOrientations = ( UIInterfaceOrientationPortrait ); UIUserInterfaceStyle = Light; "com.xamarin.ios" = { Version = "13.18.2.1 (d16-6: 29c4ea731)"; }; }

bobiechen-twilio commented 4 years ago

Thanks for the update @puneetk207. I am not sure if it's the way Xamarin bindings handle the contents of the bundle information, but there are a some fields missing that the SDK uses. For better iOS compatibility we still recommend using the latest Voice SDK since you mentioned that it works fine on real devices in your environment.

deftsoftiphone commented 4 years ago

This issue is occurring on making a call from device as well it is not only simulator issue. I am having iPhone 8+ with iOS 12.2 and it is crashing with giving error:

*** Terminating app due to uncaught exception 'TVOAudioDeviceMustBeSetBeforeMediaStackSetup', reason: 'WebRTC does not allow updating the audio device once the media stack is created (i.e once a track is created or memory allocated for previously created call or connect option is not deleted). You should provide the audio device to SDK prior to creating the tracks.'

However there is no previous audio device in media stack but still it is giving same error

I am using the latest Twilio version 6.0.0. It was working fine before but now it is giving me an error

bobiechen-twilio commented 4 years ago

Hi @deftsoftiphone

The exception message you saw is from a different cause than the original issue reported here. We are happy to continue our discussion in #392.

bobiechen-twilio commented 4 years ago

Hi @puneetk207, I am closing the issue for now since the latest SDK is functioning as expected on actual devices (and on simulators in our environment). Please feel free to reach out to the team if you need further assistance.

Cheers, -bobie

deftsoftiphone commented 4 years ago

@puneetk207 are you able to fix this issue ?

puneetk207 commented 4 years ago

@deftsoftiphone yes i fixed this using old release on simulator.