{"action":"created","issue":{"url":"https://api.github.com/repos/twilio/voice-quickstart-android/issues/217","repository_url":"https://api.github.com/repos/twilio/voice-quickstart-android","labels_url":"https://api.github.com/repos/twilio/voice-quickstart-android/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/twilio/voice-quickstart-android/issues/217/comments","events_url":"https://api.github.com/repos/twilio/voice-quickstart-android/issues/217/events","html_url":"https://github.com/twilio/voice-quickstart-android/issues/217","id":373729053,"node_id":"MDU6SXNzdWUzNzM3MjkwNTM=","number":217,"title":"Exceedingly long answer to audio delays in Android and IOS","user":{"login":"kieronlawson","id":8620269,"node_id":"MDQ6VXNlcjg2MjAyNjk=","avatar_url":"https://avatars2.githubusercontent.com/u/8620269?v=4","gravatar_id":"","url":"https://api.github.com/users/kieronlawson","html_url":"https://github.com/kieronlawson","followers_url":"https://api.github.com/users/kieronlawson/followers","following_url":"https://api.github.com/users/kieronlawson/following{/other_user}","gists_url":"https://api.github.com/users/kieronlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/kieronlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kieronlawson/subscriptions","organizations_url":"https://api.github.com/users/kieronlawson/orgs","repos_url":"https://api.github.com/users/kieronlawson/repos","events_url":"https://api.github.com/users/kieronlawson/events{/privacy}","received_events_url":"https://api.github.com/users/kieronlawson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-25T00:40:08Z","updated_at":"2018-10-25T17:33:37Z","closed_at":null,"author_association":"NONE","body":"### Description\r\n\r\nWe have been getting the run around from Twilio support on this issue and I am hoping that we might receive some advice here.\r\n\r\nWe have an android and ios mobile application using the 2.0 Programmable Voice SDK that lets mobile agents take inbound calls from customers.  We have had numerous complaints from our users (the mobile agents) that it can take a long time for the call audio to be active in the earpiece after the agent answers the call from the call screen.  (It pays to visualise the action - swipe to answer, put phone to ear, and as you do with any call say \"Hello Bob/Alice speaking...\", then finally hear the conference join beep and repeat yourself again).\r\n\r\nIn our production environment the mean delay is 3 seconds over the last 30days.  Min was ~500ms and max 25000ms with P95 around 6 seconds, which is far too long.\r\n\r\nHaving extensively examined the logs, it seems like the delay occurs during the negotiation between the SIP client and chunderm, with responses from chunderm taking between 40 and 1000ms for each request from the client.\r\n\r\nI can provide support tickets and extensive call sids (we log connect time for every call in production and are currently carrying around 2500 calls per day across our subaccounts, all to mobile clients).\r\n\r\n### Steps to Reproduce\r\n\r\n1. Add a twilio number to a subaccount and connect to a bin with simple twiml as follows (note that we are in NZ and are hardcoding the region as we find gll to be unreliable from corporate networks with NAT'd addresses):\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Response>\r\n  <Dial>\r\n    <Conference waitUrl=\"http://twimlets.com/holdmusic?Bucket=com.twilio.music.guitars\" early_media=\"true\" region=\"au1\" beep=\"true\">Room1235</Conference>\r\n  </Dial>\r\n</Response>\r\n```\r\n\r\n2. Dial the number from a mobile handset to create the conference\r\n3. Use the node quickstart server to dial the agent and add them to the same conference\r\n4. Measure the time between Connecting and Connected\r\n5. Repeat as needed.\r\n\r\n** Note we have used both dial.conference and Agent Conference participant.create, both perform exactly the same. \r\n\r\n#### Code\r\n\r\nAs above.\r\n\r\n#### Expected Behavior\r\n\r\nWe would expect the mean answer to audio delay to be < 1 second and P95 no worse than 1.5 seconds. \r\n\r\n#### Actual Behavior\r\n\r\nOur logs show in our production environment that mean answer delay is 3 seconds.\r\n\r\nIn our test environment using Quickstart and Twiml Bins the mean answer delay is 2 seconds but we have measured up to 4 seconds.\r\n\r\nWe can consistently replicate this behaviour across Android and IOS and on a range of devices.  The test below was on a good quality wifi/fibre network with QOS configured and minimal traffic (we have an isolated voice only SSID) and this issue is experience both on wifi and 4G.  Our RTT  ping time is 30ms and 90% of our customers/mobile agents are in NZ or Australia, either on wifi/fibre or 4G.\r\n\r\nWe always force the region to AU1 for customers in NZ and Australia to minimise any latency issues.\r\n\r\n#### Reproduces How Often\r\n\r\n~25% of calls have exceedingly long delays.\r\n\r\n#### Logs\r\n\r\nNote I have augmented the quickstart logs with a couple of my own logs to make measuring the lag easier. This example call took approximately 2 seconds for audio to be present.\r\n\r\nSummarising the log below:\r\n\r\n```\r\n12:37:33.082 request  : INVITE to 54.252.181.6:10194 \r\n12:37:33.266 response : 302 Moved temporarily (184ms)\r\n12:37:33.270 request  : INVITE to 13.236.91.77:10194 (4ms)\r\n12:37:33.695 response : 100 Trying (425ms)\r\n12:37:34.672 response : 200 OK (977ms)\r\n12:37:34.676 (There is no specific log here but this appears to be when the RTP connection starts)\r\n12:37:34.714 response : ACK (42ms)\r\n12:37:34.758 onConnected method in VoiceActivity.java is called. (44ms)\r\n```\r\n\r\nAs you can see most of the time overhead is from INVITE to trying and then to OK.\r\n\r\n```\r\n10-25 12:37:32.555 19017-19017/com.twilio.voice.quickstart D/++VoiceActivity: ======= Answering (calling accept -> PJSIP pjsua)\r\n10-25 12:37:32.583 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.583 os_core_unix.c !pjlib 2.5.1 for POSIX initialized\r\n10-25 12:37:32.585 19017-19089/com.twilio.voice.quickstart D/PJSIP: 12:37:32.585 sip_endpoint.c  .Creating endpoint instance...\r\n10-25 12:37:32.585 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.585          pjlib  .select() I/O Queue created (0x8cb5a8c4)\r\n    12:37:32.585 sip_endpoint.c  .Module \"mod-msg-print\" registered\r\n10-25 12:37:32.585 19017-19089/com.twilio.voice.quickstart D/PJSIP: 12:37:32.585 sip_transport.  .Transport manager created.\r\n10-25 12:37:32.585 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.585   pjsua_core.c  .PJSUA state changed: NULL --> CREATED\r\n10-25 12:37:32.604 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.604 sip_endpoint.c  Module \"mod-pjsua-log\" unregistered\r\n    12:37:32.604 sip_endpoint.c  Module \"mod-pjsua-log\" registered\r\n10-25 12:37:32.611 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.611   pjsua_call.c  Making call with acc #0 to sip:None@chunderm.au1.twilio.com;transport=TLS\r\n    12:37:32.611    pjsua_aud.c  .Set sound device: capture=-1, playback=-2\r\n    12:37:32.611    pjsua_aud.c  ..Opening sound device (speaker + mic) PCM@16000/1/20ms\r\n    12:37:32.611 android_jni_de  ...Creating Android JNI stream\r\n10-25 12:37:32.613 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.613 android_jni_de  ...Using audio input source : 7\r\n10-25 12:37:32.625 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.625 android_jni_de  ...Audio record initialized successfully.\r\n10-25 12:37:32.626 19017-19096/com.twilio.voice.quickstart I/PJSIP: 12:37:32.626 android_jni_de  Setting thread priority successful\r\n10-25 12:37:32.630 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.630 android_jni_de !...Audio track initialized successfully.\r\n10-25 12:37:32.631 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.631   ec0x8cb7c100  ...AEC created, clock_rate=16000, channel=1, samples per frame=320, tail length=200 ms, latency=0 ms\r\n    12:37:32.631 android_jni_de  ...Android JNI stream started\r\n    12:37:32.631    pjsua_acc.c  .Warning: cannot use source TCP/TLS socket address for Contact when nameserver is configured.\r\n    12:37:32.631  pjsua_media.c  .Call 0: initializing media..\r\n10-25 12:37:32.633 19017-19098/com.twilio.voice.quickstart I/PJSIP: 12:37:32.632 android_jni_de  Setting thread priority successful\r\n10-25 12:37:32.635 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.635  pjsua_media.c !..RTP socket reachable at 192.168.1.2:4532\r\n    12:37:32.635  pjsua_media.c  ..RTCP socket reachable at 192.168.1.2:4533\r\n10-25 12:37:32.636 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.636  pjsua_media.c  ..Media index 0 selected for audio call 0\r\n10-25 12:37:32.637 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:32.637     resolver.c  ....Transmitting 52 bytes to NS 0 (192.168.1.1:53): DNS SRV query for _sips._tcp.chunderm.au1.twilio.com: Success\r\n10-25 12:37:32.949 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:32.949     resolver.c  Transmitting 42 bytes to NS 0 (192.168.1.1:53): DNS A query for chunderm1.au1.twilio.com: Success\r\n10-25 12:37:32.950 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:32.950     resolver.c  Transmitting 42 bytes to NS 0 (192.168.1.1:53): DNS A query for chunderm0.au1.twilio.com: Success\r\n10-25 12:37:33.081 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.080 tlsc0x8c9d5c14  TLS client transport created\r\n10-25 12:37:33.082 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.082 tlsc0x8c9d5c14  TLS transport 192.168.1.2:49348 is connecting to chunderm.au1.twilio.com:10194...\r\n    12:37:33.082   pjsua_core.c  TX 2525 bytes Request msg INVITE/cseq=14536 (tdta0x8c97b000) to TLS 54.252.181.6:10194:\r\n    INVITE sip:None@chunderm.au1.twilio.com;transport=TLS SIP/2.0\r\n    Via: SIP/2.0/TLS 192.168.1.2:49348;rport;branch=z9hG4bKPj9EYmtSbl8n5UUlBc7UsVetdF2.weDgC7;alias\r\n    Max-Forwards: 70\r\n    From: sip:twilio@chunderm.au1.twilio.com;tag=CsD2hYDViFnAMSJ6t8rePNj5Svwb1crt\r\n    To: sip:None@chunderm.au1.twilio.com\r\n    Contact: <sip:twilio@192.168.1.2:37271;transport=TLS;ob>\r\n    Call-ID: 0AyU63nOKApIfCWYVjA0O7UaQNai75.e\r\n    CSeq: 14536 INVITE\r\n    Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS\r\n    Supported: replaces, 100rel, timer, norefersub\r\n    Session-Expires: 14400\r\n    Min-SE: 90\r\n    X-Twilio-ClientVersion: 3\r\n    X-Twilio-BridgeToken: eyJraWQiOiJKd2VTM0JpZi0xIiwiY3R5IjoidHdpbGlvLWZwYTt2PTEiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..pH65Xc4SrEIBaqWk.zglBajc5m3LJ-F-5sAi_SV44Rz5kSs_I4ysxz1me9wNXVAi70V94m0tvwY9lOmbhiud6x_kHzIUOIRXL__WZvjL6yFqWxUmngQZnwHo-XUwG7auJqor1VHokDY4A_nOWmOY1qZhfG2h3dXLGr\r\n    MBVAaRKGOekGnCM-lPIwq3bV1ctNi-1Qu7shrm9tC5foPA3Vi_2eVYrxukNa8lCHXK8NTnhevvCHHv55hJbSjoeWWMzmFwFrjMdwZOIWFMf2PfuczEgUOggR7RPPU3q81eHDNXpbul9VfY0F-z2Cc6wj1KaPcT7fJHUB51qty02bA5L2Ye305LyYvEeLhZozCTiUnMRlFYh3G44D5Kn7Gu8rwyq7fpuvJD4e4kk4oBl_nYN-LLLIfH-5nf2qRfuWPUtBbc0-41svjwrDrkZJ5yFv1303RL5F8cA0KriDondgGasFojVOEwecNVhmN06ak8xYSN9lKTnNi62g6U1L4lGkwQkXjKo3wSHbgckwpPmy8ERpLabZ3gA4V9g8xaQRyg2QaEgIYr4BJ31g14MBFpf9ZUZoKJ3IEgBneFaRWMuS8yHGc_YXdrbUUqhKs42YweMB6gjip93FCvJyF6fdoSBkeLRuL9Xqp6tmk_5Pu8qSTUVVdcFynFfrMwY08lVK5V1Pd8LSve_QRS-HDIdt1rAwLRlWMVzXMyZ-Rj7w.UtFisfZJBD3gBmpRJqcwIQ\r\n    User-Agent: TwilioProgrammableVoice.Android/2.0\r\n    X-Twilio-Client: %7B%22p%22%3A%22android%22%2C%22v%22%3A%222.0.8%22%2C%22mobile%22%3A%7B%22name%22%3A%22athene_f%22%2C%22product%22%3A%22motorola%20Moto%20G%20(4)%22%2C%22arch%22%3A%22armeabi-v7a%22%2C%22v%22%3A%227.0%22%7D%7D\r\n    Content-Type: application/sdp\r\n    Content-Length:   708\r\n    \r\n    v=0\r\n    o=- 3749413052 3749413052 IN IP4 192.168.1.2\r\n    s=pjmedia\r\n    b=AS:84\r\n    t=0 0\r\n    a=X-nat:0\r\n    m=audio 4532 RTP/SAVP 98\r\n    97 0 96\r\n    c=IN IP4 192.168.1.2\r\n    b=TIAS:64000\r\n    a=rtcp:4533 IN IP4 192.168.1.2\r\n    a=sendrecv\r\n    a=rtpmap:98 speex/16000\r\n    a=rtpmap:97 speex/8000\r\n    a=rtpmap:0 PCMU/8000\r\n    a=rtpmap:96 telephone-event/8000\r\n    a=fmtp:96 0-16\r\n    a=crypto:1 AES_CM_256_HMAC_SHA1_80 inline:N/SHyc6hRUVSTgQ5XztRksSKPs4+6zOROkUtfw06s/40vxIMVyfoxSq+KwEXOg==\r\n    a=crypto:2 AES_CM_256_HMAC_SHA1_32 inline:MxQezxcFdANySI2a/KBQvi2nYds2lOgN/ttGNbj9A1xT2zT029lTmbFWDKP3zg==\r\n    a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:sCHVOBZumj+NrAbwLG9x+zi5n1qKyy8NhmJWCOJe\r\n    a=crypto:4 AES_CM_128_HMAC_SHA1_32 inline:YBnKp6MaHljNTY785nGIA0q7RTEpnb2TXVukdelB\r\n    \r\n    --end msg--\r\n10-25 12:37:33.233 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.233 tlsc0x8c9d5c14  TLS transport 192.168.1.2:49348 is connected to chunderm.au1.twilio.com:10194\r\n10-25 12:37:33.266 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.266   pjsua_core.c  .RX 477 bytes Response msg 302/INVITE/cseq=14536 (rdata0x8c9d5de0) from TLS 54.252.181.6:10194:\r\n    SIP/2.0 302 Moved Temporarily\r\n    Via: SIP/2.0/TLS 192.168.1.2:49348;received=114.23.236.250;rport=49348;branch=z9hG4bKPj9EYmtSbl8n5UUlBc7UsVetdF2.weDgC7;alias\r\n    From: sip:twilio@chunderm.au1.twilio.com;tag=CsD2hYDViFnAMSJ6t8rePNj5Svwb1crt\r\n    To: sip:None@chunderm.au1.twilio.com;tag=dc70e849805c176718d21f80bfa41bad.2dbd\r\n    Call-ID: 0AyU63nOKApIfCWYVjA0O7UaQNai75.e\r\n    CSeq: 14536 INVITE\r\n    Contact: <sip:13.236.91.77:10194;transport=tls>\r\n    Server: Twilio Client SBC\r\n    Content-Length: 0\r\n    \r\n    \r\n    --end msg--\r\n10-25 12:37:33.267 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.267   pjsua_core.c  ..TX 416 bytes Request msg ACK/cseq=14536 (tdta0x8c311000) to TLS 54.252.181.6:10194:\r\n    ACK sip:None@chunderm.au1.twilio.com;transport=TLS SIP/2.0\r\n    Via: SIP/2.0/TLS 192.168.1.2:49348;rport;branch=z9hG4bKPj9EYmtSbl8n5UUlBc7UsVetdF2.weDgC7;alias\r\n    Max-Forwards: 70\r\n    From: sip:twilio@chunderm.au1.twilio.com;tag=CsD2hYDViFnAMSJ6t8rePNj5Svwb1crt\r\n    To: sip:None@chunderm.au1.twilio.com;tag=dc70e849805c176718d21f80bfa41bad.2dbd\r\n    Call-ID: 0AyU63nOKApIfCWYVjA0O7UaQNai75.e\r\n    CSeq: 14536 ACK\r\n    Content-Length:  0\r\n    \r\n    \r\n    --end msg--\r\n10-25 12:37:33.268 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.268 tlsc0x8c9bb414  .......TLS client transport created\r\n10-25 12:37:33.270 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.270 tlsc0x8c9bb414  .......TLS transport 192.168.1.2:47100 is connecting to 13.236.91.77:10194...\r\n    12:37:33.270   pjsua_core.c  .......TX 2515 bytes Request msg INVITE/cseq=14537 (tdta0x8c97b000) to TLS 13.236.91.77:10194:\r\n    INVITE sip:13.236.91.77:10194;transport=tls SIP/2.0\r\n    Via: SIP/2.0/TLS 192.168.1.2:47100;rport;branch=z9hG4bKPjml9qJyvpRhX6afBTjD-.6N1xTiWJaHqC;alias\r\n    Max-Forwards: 70\r\n    From: sip:twilio@chunderm.au1.twilio.com;tag=CsD2hYDViFnAMSJ6t8rePNj5Svwb1crt\r\n    To: sip:None@chunderm.au1.twilio.com\r\n    Contact: <sip:twilio@192.168.1.2:37271;transport=TLS;ob>\r\n    Call-ID: 0AyU63nOKApIfCWYVjA0O7UaQNai75.e\r\n    CSeq: 14537 INVITE\r\n    Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS\r\n    Supported: replaces, 100rel, timer, norefersub\r\n    Session-Expires: 14400\r\n    Min-SE: 90\r\n    X-Twilio-ClientVersion: 3\r\n    X-Twilio-BridgeToken: eyJraWQiOiJKd2VTM0JpZi0xIiwiY3R5IjoidHdpbGlvLWZwYTt2PTEiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..pH65Xc4SrEIBaqWk.zglBajc5m3LJ-F-5sAi_SV44Rz5kSs_I4ysxz1me9wNXVAi70V94m0tvwY9lOmbhiud6x_kHzIUOIRXL__WZvjL6yFqWxUmngQZnwHo-XUwG7auJqor1VHokDY4A_nOWmOY1qZhfG2h3dXLGrhMB\r\n    AaRKGOekGnCM-lPIwq3bV1ctNi-1Qu7shrm9tC5foPA3Vi_2eVYrxukNa8lCHXK8NTnhevvCHHv55hJbSjoeWWMzmFwFrjMdwZOIWFMf2PfuczEgUOggR7RPPU3q81eHDNXpbul9VfY0F-z2Cc6wj1KaPcT7fJHUB51qty02bA5L2Ye305LyYvEeLhZozCTiUnMRlFYh3G44D5Kn7Gu8rwyq7fpuvJD4e4kk4oBl_nYN-LLLIfH-5nf2qRfuWPUtBbc0-41svjwrDrkZJ5yFv1303RL5F8cA0KriDondgGasFojVOEwecNVhmN06ak8xYSN9lKTnNi62g6U1L4lGkwQkXjKo3wSHbgckwpPmy8ERpLabZ3gA4V9g8xaQRyg2QaEgIYr4BJ31g14MBFpf9ZUZoKJ3IEgBneFaRWMuS8yHGc_YXdrbUUqhKs42YweMB6gjip93FCvJyF6fdoSBkeLRuL9Xqp6tmk_5Pu8qSTUVVdcFynFfrMwY08lVK5V1Pd8LSve_QRS-HDIdt1rAwLRlWMVzXMyZ-Rj7w.UtFisfZJBD3gBmpRJqcwIQ\r\n    User-Agent: TwilioProgrammableVoice.Android/2.0\r\n    X-Twilio-Client: %7B%22p%22%3A%22android%22%2C%22v%22%3A%222.0.8%22%2C%22mobile%22%3A%7B%22name%22%3A%22athene_f%22%2C%22product%22%3A%22motorola%20Moto%20G%20(4)%22%2C%22arch%22%3A%22armeabi-v7a%22%2C%22v%22%3A%227.0%22%7D%7D\r\n    Content-Type: application/sdp\r\n    Content-Length:   708\r\n    \r\n    v=0\r\n    o=- 3749413052 3749413052 IN IP4 192.168.1.2\r\n    s=pjmedia\r\n    b=AS:84\r\n    t=0 0\r\n    a=X-nat:0\r\n    m=audio 4532 RTP/SAVP 98 97\r\n    0 96\r\n    c=IN IP4 192.168.1.2\r\n    b=TIAS:64000\r\n    a=rtcp:4533 IN IP4 192.168.1.2\r\n    a=sendrecv\r\n    a=rtpmap:98 speex/16000\r\n    a=rtpmap:97 speex/8000\r\n    a=rtpmap:0 PCMU/8000\r\n    a=rtpmap:96 telephone-event/8000\r\n    a=fmtp:96 0-16\r\n    a=crypto:1 AES_CM_256_HMAC_SHA1_80 inline:N/SHyc6hRUVSTgQ5XztRksSKPs4+6zOROkUtfw06s/40vxIMVyfoxSq+KwEXOg==\r\n    a=crypto:2 AES_CM_256_HMAC_SHA1_32 inline:MxQezxcFdANySI2a/KBQvi2nYds2lOgN/ttGNbj9A1xT2zT029lTmbFWDKP3zg==\r\n    a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:sCHVOBZumj+NrAbwLG9x+zi5n1qKyy8NhmJWCOJe\r\n    a=crypto:4 AES_CM_128_HMAC_SHA1_32 inline:YBnKp6MaHljNTY785nGIA0q7RTEpnb2TXVukdelB\r\n    \r\n    --end msg--\r\n10-25 12:37:33.461 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.461 tlsc0x8c9bb414  TLS transport 192.168.1.2:47100 is connected to 13.236.91.77:10194\r\n10-25 12:37:33.695 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:33.695   pjsua_core.c  .RX 368 bytes Response msg 100/INVITE/cseq=14537 (rdata0x8c9bb5e0) from TLS 13.236.91.77:10194:\r\n    SIP/2.0 100 Trying\r\n    CSeq: 14537 INVITE\r\n    Call-ID: 0AyU63nOKApIfCWYVjA0O7UaQNai75.e\r\n    From: <sip:twilio@chunderm.au1.twilio.com>;tag=CsD2hYDViFnAMSJ6t8rePNj5Svwb1crt\r\n    To: <sip:None@chunderm.au1.twilio.com>\r\n    Via: SIP/2.0/TLS 192.168.1.2:47100;rport=47100;branch=z9hG4bKPjml9qJyvpRhX6afBTjD-.6N1xTiWJaHqC;alias;received=114.23.236.250\r\n    Server: Twilio\r\n    Content-Length: 0\r\n    \r\n    \r\n    --end msg--\r\n10-25 12:37:34.672 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:34.672   pjsua_core.c  .RX 1112 bytes Response msg 200/INVITE/cseq=14537 (rdata0x8c9bb5e0) from TLS 13.236.91.77:10194:\r\n    SIP/2.0 200 OK\r\n    CSeq: 14537 INVITE\r\n    Call-ID: 0AyU63nOKApIfCWYVjA0O7UaQNai75.e\r\n    From: <sip:twilio@chunderm.au1.twilio.com>;tag=CsD2hYDViFnAMSJ6t8rePNj5Svwb1crt\r\n    To: <sip:None@chunderm.au1.twilio.com>;tag=97417927_6772d868_be3aa9be-2e67-4dd8-a213-11ec7a246ab8\r\n    Via: SIP/2.0/TLS 192.168.1.2:47100;rport=47100;branch=z9hG4bKPjml9qJyvpRhX6afBTjD-.6N1xTiWJaHqC;alias;received=114.23.236.250\r\n    Server: Twilio\r\n    Contact: <sip:ec2-13-236-91-77.ap-southeast-2.compute.amazonaws.com:10194;transport=tls>\r\n    Allow: INVITE,ACK,CANCEL,OPTIONS,BYE\r\n    Content-Type: application/sdp\r\n    X-Twilio-CallSid: CA1fd3bb516a7d94b1f60f40ed2c2f8f45\r\n    X-Twilio-VoiceTrace: 2\r\n    X-Twilio-LegInfo: external\r\n    Content-Length: 422\r\n    \r\n    v=0\r\n    o=root 1377137547 1377137547 IN IP4 172.21.154.114\r\n    s=Twilio Media Gateway\r\n    c=IN IP4 54.252.254.91\r\n    t=0 0\r\n    m=audio 14384 RTP/SAVP 0 96\r\n    a=crypto:1 AES_CM_256_HMAC_SHA1_80 inline:GxU3qkT9yx9Mq/XRpzQpwBop\r\n    Utxk5t23lb6e/xfC1h+gFHvUvf0QudaFvw5Hw==\r\n    a=rtpmap:0 PCMU/8000\r\n    a=rtpmap:96 telephone-event/8000\r\n    a=fmtp:96 0-16\r\n    a=ptime:20\r\n    a=maxptime:150\r\n    a=ssrc:549890477 cname:05262c49-0346-4fee-afe0-04193fc11da6\r\n    a=sendrecv\r\n    \r\n    --end msg--\r\n10-25 12:37:34.676 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:34.676  pjsua_media.c  .....Call 0: updating media..\r\n    12:37:34.676    pjsua_aud.c  ......Audio channel update..\r\n10-25 12:37:34.677 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:34.677 strm0x8cdcf814  .......Encoder stream started\r\n    12:37:34.677 strm0x8cdcf814  .......Decoder stream started\r\n    12:37:34.677  pjsua_media.c  ......Audio updated, stream #0: PCMU (sendrecv)\r\n10-25 12:37:34.680 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:34.680     resolver.c  .....Transmitting 71 bytes to NS 0 (192.168.1.1:53): DNS A query for ec2-13-236-91-77.ap-southeast-2.compute.amazonaws.com: Success\r\n10-25 12:37:34.680 19017-19089/com.twilio.voice.quickstart I/PJSIP: 12:37:34.680    pjsua_aud.c !Conf connect: 0 --> 1\r\n    12:37:34.680   conference.c  .Port 0 (Android JNI) transmitting to port 1 (sip:None@chunderm.au1.twilio.com;transport=TLS)\r\n    12:37:34.680    pjsua_aud.c  Conf connect: 1 --> 0\r\n    12:37:34.680   conference.c  .Port 1 (sip:None@chunderm.au1.twilio.com;transport=TLS) transmitting to port 0 (Android JNI)\r\n10-25 12:37:34.683 19017-19098/com.twilio.voice.quickstart I/PJSIP: 12:37:34.683   Master/sound !Underflow, buf_cnt=0, will generate 1 frame\r\n10-25 12:37:34.685 19017-19098/com.twilio.voice.quickstart I/PJSIP: 12:37:34.685   Master/sound  Underflow, buf_cnt=0, will generate 1 frame\r\n10-25 12:37:34.714 19017-19092/com.twilio.voice.quickstart I/PJSIP: 12:37:34.714   pjsua_core.c  TX 464 bytes Request msg ACK/cseq=14537 (tdta0x8c313000) to TLS 13.236.91.77:10194:\r\n    ACK sip:ec2-13-236-91-77.ap-southeast-2.compute.amazonaws.com:10194;transport=tls SIP/2.0\r\n    Via: SIP/2.0/TLS 192.168.1.2:47100;rport;branch=z9hG4bKPj6yY2rnS-bLIptDuBRnY8kz-pVUcHRlr0;alias\r\n    Max-Forwards: 70\r\n    From: sip:twilio@chunderm.au1.twilio.com;tag=CsD2hYDViFnAMSJ6t8rePNj5Svwb1crt\r\n    To: sip:None@chunderm.au1.twilio.com;tag=97417927_6772d868_be3aa9be-2e67-4dd8-a213-11ec7a246ab8\r\n    Call-ID: 0AyU63nOKApIfCWYVjA0O7UaQNai75.e\r\n    CSeq: 14537 ACK\r\n    Content-Length:  0\r\n    \r\n    \r\n    --end msg--\r\n10-25 12:37:34.758 19017-19017/com.twilio.voice.quickstart D/++VoiceActivity: ======= Connected (PJSIP/pjsua event received) === 2133ms\r\n```\r\n\r\n### Versions\r\n\r\nAll versions, IOS and Android.\r\n\r\n#### Voice Android SDK\r\n\r\nLatest 2.0\r\n\r\n#### OS Version\r\n\r\nAll Android and IOS versions\r\n\r\n#### Device Model\r\n\r\nAll devices (Android and IOS)\r\n"},"comment":{"url":"https://api.github.com/repos/twilio/voice-quickstart-android/issues/comments/433139566","html_url":"https://github.com/twilio/voice-quickstart-android/issues/217#issuecomment-433139566","issue_url":"https://api.github.com/repos/twilio/voice-quickstart-android/issues/217","id":433139566,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzEzOTU2Ng==","user":{"login":"idelgado","id":882552,"node_id":"MDQ6VXNlcjg4MjU1Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/882552?v=4","gravatar_id":"","url":"https://api.github.com/users/idelgado","html_url":"https://github.com/idelgado","followers_url":"https://api.github.com/users/idelgado/followers","following_url":"https://api.github.com/users/idelgado/following{/other_user}","gists_url":"https://api.github.com/users/idelgado/gists{/gist_id}","starred_url":"https://api.github.com/users/idelgado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idelgado/subscriptions","organizations_url":"https://api.github.com/users/idelgado/orgs","repos_url":"https://api.github.com/users/idelgado/repos","events_url":"https://api.github.com/users/idelgado/events{/privacy}","received_events_url":"https://api.github.com/users/idelgado/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T17:33:37Z","updated_at":"2018-10-25T17:33:37Z","author_association":"CONTRIBUTOR","body":"Thanks for the detailed summary and detailed report.\r\n\r\nOne of the issues you are encountering is that while media can be localized to a region as you noted above, at the moment, all signaling communication is done in the US region. There is an internal initiative to improve this by providing regionalized signaling. Unfortunately I don't have a firm timeline for when this work will be completed. Some of this work is starting in Q1 of 2019.\r\n\r\nHowever, a nearer term solution will be to move to Voice 3.X SDKs. We expect the call setup time to improve, for instance in 3.X we will no longer redirect with a 302 in the call flow. There is a caveat which is that at the moment to ensure media can be established in restrictive network environments ICE servers must be provided when making or accepting a Call. Eventually we want to provide ICE servers in-band to avoid this out-of-band configuration altogether.\r\n\r\nTo get a better sense of the changes in the 3.X you can have a look at the [new features](https://github.com/twilio/voice-quickstart-android/tree/3.x#new-features) and [migration guide](https://github.com/twilio/voice-quickstart-android/tree/3.x#migration-guide).\r\n\r\nI will follow up with more concrete data on the expected change in call setup time between 2.X and 3.X. It is still under development so there are still many areas we are improving."}}
{"actor":{"display_login":"idelgado"}}