Closed tongsoftinfo closed 2 years ago
Hi @tongsoftinfo.
From the logs I can see what the root cause of the issue is.
2022-03-09 16:49:33.459 19684-19800/com.tongsoft.callphone I/TxSocket: Socket is closed: null java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String
The Socket connection is closing because of a Null Pointer exception. This is because there are parameters missing from the onRingingReceived message:
2022-03-09 16:49:33.457 19684-19800/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onRingingReceived [{"jsonrpc":"2.0","id":671517,"method":"telnyx_rtc.ringing","params":{"callID":"65c2aea6-edf3-45fd-9be2-72f989a867d2","caller_id_name":"alice","caller_id_number":"+15053873173","callee_id_name":"Outbound Call","callee_id_number":"+18259020274","display_direction":"inbound"}}]
There should be a telnyx_session_id and telnyx_leg_id with every one of these messages. We are busy investigating why they do not appear for you. I cannot personally recreate the scenario.
Just to confirm. Here is the scenario we are trying to recreate. I have 2 devices: Device A with Telnyx number A and Device B with Telnyx number B
Both devices are running the Telnyx Sample Android application.
Is this the scenario you are doing? We just want to double-check. The issue is not happening on our side in this case.
Finally, in order to isolate the incident, can you please see if the same thing is happening with our JS example client here: https://webrtc.telnyx.com/
Please open that link in 2 tabs and log in like you did on the Android clients and do the same test. Please let me know if the same thing occurs.
You can click on the wsMessages to see the messages like so:
Please copy these messages and share it here so that we can see the potential differences
We've had this in many of our tests, where the numbers on both devices belong to one telnyx account
This is the log of the call to https://webrtc.telnyx.com/ It is normal to dial the number here { "jsonrpc": "2.0", "id": 910700, "method": "telnyx_rtc.bye", "params": { "callID": "d0266eb5-16b1-4cbe-a8d8-d096e226b2bc", "sip_call_id": "6befba4c-29f1-4155-af16-bf2630d6c47d", "sipCode": 200, "causeCode": 16, "cause": "NORMAL_CLEARING" } } { "jsonrpc": "2.0", "id": 910695, "method": "telnyx_rtc.answer", "params": { "callID": "d0266eb5-16b1-4cbe-a8d8-d096e226b2bc", "variables": { "Event-Name": "CHANNEL_DATA", "Core-UUID": "d4c6e9b9-a13b-401f-b177-f469267f2072", "FreeSWITCH-Hostname": "b2bua-rtc.tel-sy1-ibm-prod-133", "FreeSWITCH-Switchname": "b2bua-rtc.tel-sy1-ibm-prod-133", "FreeSWITCH-IPv4": "10.33.0.80", "FreeSWITCH-IPv6": "::1", "Event-Date-Local": "2022-03-10 00:35:58", "Event-Date-GMT": "Thu, 10 Mar 2022 00:35:58 GMT", "Event-Date-Timestamp": "1646872558533128", "Event-Calling-File": "switch_channel.c", "Event-Calling-Function": "switch_channel_get_variables_prefix", "Event-Calling-Line-Number": "4572", "Event-Sequence": "1645710" } } } { "jsonrpc": "2.0", "id": 910679, "method": "telnyx_rtc.ringing", "params": { "callID": "d0266eb5-16b1-4cbe-a8d8-d096e226b2bc", "caller_id_name": "boby", "caller_id_number": "+12056348866", "callee_id_name": "Outbound Call", "callee_id_number": "17789012077", "display_direction": "inbound" } }
@tongsoftinfo it appears you have only copied 3 of the websocket messages. Was the test done twice with the same numbers? Can you also please confirm the scenario I explained. Are we properly trying to reproduce it? ie:
Both devices are running the Telnyx Sample Android application.
I have included a video here to demonstrate the above scenario:
https://user-images.githubusercontent.com/9112652/157636550-b06508c4-6adb-4d23-a68f-e0b407f60022.mov
As a last resort could you please include a video showing the test? I understand what the issue is but we cannot reproduce it and having the correct steps would be key to identifying the issue. You can email the test video privately to me at oliver@telnyx.com if you would rather not share it publicly.
I recorded a video, the APP in the video has been added to the sdk, and the video has been sent to oliver@telnyx.com
Hey, @tongsoftinfo just letting you know that we are still looking into this issue. Your video has been a big help. I think Call Control might be the issue, I wasn't aware that you were using that.
I'll update you here soon
@tongsoftinfo after reviewing your video I have noticed that at about 2:30 minutes in, the number you are dialling is not connected to any Connection or Application. Can you please connect this to a SIP connection and see if this remedies the issue?
You are calling different numbers from web dialer (+182274) and the android app (+150173).
Aside from that, I have been testing with call control and can still not recreate your issue. Would you be open to hopping on a Zoom meeting to debug this together if it is still occurring?
I have used + 150_____ 173 is connected to the SIP, but the username and password in the demo also use the username and password of the SIP, but the call still fails. My inbound webhook can receive information, but the outbound webhook does not receive information
The overall logic of my android app is as follows. Android app uses the on-demand credentials generated by SIP credentials to make calls, and my number is connected to call control. When the call control webhook receives an inbound call, the server uses FCM to push it to my app. When the app clicks to answer, the app logs in with on-demand credentials, and the server sends a call invitation, bridging the inbound call of call control and the call invitation sent by the server
This section is the log file generated by your demo call in the morning
2022-03-24 10:36:06.250 19104-19246/com.tongsoft.callphone D/TelnyxClient$networkCallback: [TelnyxClient] :: There is a network available 2022-03-24 10:36:08.494 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Connection established :: rtc.telnyx.com 2022-03-24 10:36:08.495 19104-19250/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onConnectionEstablished 2022-03-24 10:36:08.774 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"223a6a8f-d9c6-4b0d-8db8-a6dab77cc310","result":{"message":"logged in","sessid":"33d9e910-8ece-4f58-9611-053f0b14920d"}}] 2022-03-24 10:36:08.842 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":5259284,"method":"telnyx_rtc.clientReady","params":{"reattached_sessions":[]}}] 2022-03-24 10:36:08.847 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Received Method [telnyx_rtc.clientReady] 2022-03-24 10:36:08.849 19104-19250/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onClientReady :: retrieving gateway state 2022-03-24 10:36:09.119 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"735c8e4d-3951-41f2-bfd2-e4ae90b746f1","result":{"params":{"state":"REGED"},"sessid":"33d9e910-8ece-4f58-9611-053f0b14920d"}}] 2022-03-24 10:36:09.120 19104-19250/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onLoginSuccessful :: [33d9e910-8ece-4f58-9611-053f0b14920d] :: Ready to make calls 2022-03-24 10:36:14.952 19104-19104/com.tongsoft.callphone D/TelnyxClient: ringtone/ringback media player stopped and released 2022-03-24 10:36:15.558 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"7ea3f652-a37a-4f3f-a707-806904625ec6","result":{"message":"CALL CREATED","callID":"d0a9d3b8-ab01-4ac3-8d86-af797983ae27","sessid":"33d9e910-8ece-4f58-9611-053f0b14920d"}}] 2022-03-24 10:36:16.830 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":5259304,"method":"telnyx_rtc.ringing","params":{"callID":"d0a9d3b8-ab01-4ac3-8d86-af797983ae27","caller_id_name":"alice","caller_id_number":"+15053873173","callee_id_name":"Outbound Call","callee_id_number":"+18259020274","display_direction":"inbound"}}] 2022-03-24 10:36:16.831 19104-19250/com.tongsoft.callphone D/VERTO: [TxSocket] Received Method [telnyx_rtc.ringing] 2022-03-24 10:36:16.832 19104-19250/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onRingingReceived [{"jsonrpc":"2.0","id":5259304,"method":"telnyx_rtc.ringing","params":{"callID":"d0a9d3b8-ab01-4ac3-8d86-af797983ae27","caller_id_name":"alice","caller_id_number":"+15053873173","callee_id_name":"Outbound Call","callee_id_number":"+18259020274","display_direction":"inbound"}}] 2022-03-24 10:36:16.833 19104-19250/com.tongsoft.callphone I/TxSocket: Socket is closed: null java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.gson.JsonElement.getAsString()' on a null object reference 2022-03-24 10:36:30.086 19104-19104/com.tongsoft.callphone D/TelnyxClient: ringtone/ringback media player stopped and released
Device a on demand credentials
call
Device B number connection call control
Server inbound webhook ---- > FCM push ---- > app click answer and log in with on-demand credentials ---- -- > server sends invitation to device B ----- -- > server bridge access station call control and device B
@tongsoftinfo @ShiXiaoXiang2019 I believe we have resolved the issue. We have drafted a new release of the SDK here: https://jitpack.io/#team-telnyx/telnyx-webrtc-android/v1.2.14-alpha
You can test the sample app by cloning main which includes the fix. Please let me know if it is still happening.
Thanks for your help
I downloaded your latest SDK and demo, and now I can dial my own number normally
I use call control to receive incoming calls, and then use Google FCM to notify the app. After receiving the push, the app logs in with on-demand credentials, and the server sends a call invitation to the app and bridges the incoming call
I'm not sure whether this is in line with the original intention of your design. Looking at your video, it seems that each number generates a separate SIP credential and connects. Then, when there is an inbound call, how can the app receive the inbound call outside the app and arouse the answer page?
Hi, @ShiXiaoXiang2019 this is how we designed it for this sample app.
Each login sends a FCM token which "connects" it to that SIP login on that device. From then on, when a call is sent and the user isn't logged on, a push notification is sent. Then a call is generated but parked.
Once a user logs in (we do this automatically via shared preferences if they have logged in before but you can handle this however you want) the call is unparked and sent to that connection.
This is what we have implemented in our sample but you can use FCM in any manner you choose.
I will close this issue if it is resolved, if you have another issue please open another issue with a new name
Bug Category
SDK Version com.github.team-telnyx:telnyx-webrtc-android:v1.2.13-alpha
Describe the bug
Using the two numbers purchased by our own Telnyx account, in the telnyx-webrtc-android project, do a call test, one number is used for dialing, the other number is used for answering, but after one number is dialed, the other number can receive calls message, but will receive a hang-up message immediately and cannot answer the phone normally
Expected behaviour Make a call, both parties can hear the sound normally
To Reproduce Steps to reproduce the behaviour:
Android Device (please complete the following information):
Logs
the first time
2022-03-09 16:44:43.124 19241-19362/com.tongsoft.callphone D/TelnyxClient$networkCallback: [TelnyxClient] :: There is a network available 2022-03-09 16:44:44.614 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Connection established :: rtc.telnyx.com 2022-03-09 16:44:44.615 19241-19366/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onConnectionEstablished 2022-03-09 16:44:44.900 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"1e1461c0-c186-417b-a72b-83dcda6ae51f","result":{"message":"logged in","sessid":"232cb2b3-fba0-4ebd-8e74-7952ee9ef88f"}}] 2022-03-09 16:44:45.000 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":670823,"method":"telnyx_rtc.clientReady","params":{"reattached_sessions":[]}}] 2022-03-09 16:44:45.004 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Received Method [telnyx_rtc.clientReady] 2022-03-09 16:44:45.006 19241-19366/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onClientReady :: retrieving gateway state 2022-03-09 16:44:45.214 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"1a73b601-2ca9-424c-a0c2-d28746ba17ef","result":{"params":{"state":"REGED"},"sessid":"232cb2b3-fba0-4ebd-8e74-7952ee9ef88f"}}] 2022-03-09 16:44:45.217 19241-19366/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onLoginSuccessful :: [232cb2b3-fba0-4ebd-8e74-7952ee9ef88f] :: Ready to make calls 2022-03-09 16:44:47.122 19241-19241/com.tongsoft.callphone D/TelnyxClient: ringtone/ringback media player stopped and released 2022-03-09 16:44:47.734 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"b33c38ec-d6f5-4356-871c-a71def78ab30","result":{"message":"CALL CREATED","callID":"dfe34b6d-7f03-4b45-9fd9-a629c02d72cd","sessid":"232cb2b3-fba0-4ebd-8e74-7952ee9ef88f"}}] 2022-03-09 16:44:48.858 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":670834,"method":"telnyx_rtc.ringing","params":{"callID":"dfe34b6d-7f03-4b45-9fd9-a629c02d72cd","caller_id_name":"alice","caller_id_number":"+15053873173","callee_id_name":"Outbound Call","callee_id_number":"+18259020274","display_direction":"inbound"}}] 2022-03-09 16:44:48.859 19241-19366/com.tongsoft.callphone D/VERTO: [TxSocket] Received Method [telnyx_rtc.ringing] 2022-03-09 16:44:48.859 19241-19366/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onRingingReceived [{"jsonrpc":"2.0","id":670834,"method":"telnyx_rtc.ringing","params":{"callID":"dfe34b6d-7f03-4b45-9fd9-a629c02d72cd","caller_id_name":"alice","caller_id_number":"+15053873173","callee_id_name":"Outbound Call","callee_id_number":"+18259020274","display_direction":"inbound"}}] 2022-03-09 16:44:48.860 19241-19366/com.tongsoft.callphone I/TxSocket: Socket is closed: null java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.gson.JsonElement.getAsString()' on a null object reference 2022-03-09 16:44:59.419 19241-19241/com.tongsoft.callphone D/TelnyxClient: ringtone/ringback media player stopped and released
the second time
2022-03-09 16:49:27.433 19684-19796/com.tongsoft.callphone D/TelnyxClient$networkCallback: [TelnyxClient] :: There is a network available 2022-03-09 16:49:29.092 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Connection established :: rtc.telnyx.com 2022-03-09 16:49:29.095 19684-19800/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onConnectionEstablished 2022-03-09 16:49:29.424 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"09e42ad0-84f2-4420-b24c-4ce861c37750","result":{"message":"logged in","sessid":"cd4d748e-c9ad-4e85-ac4f-08c78c836f69"}}] 2022-03-09 16:49:29.539 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":671507,"method":"telnyx_rtc.clientReady","params":{"reattached_sessions":[]}}] 2022-03-09 16:49:29.548 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Received Method [telnyx_rtc.clientReady] 2022-03-09 16:49:29.570 19684-19800/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onClientReady :: retrieving gateway state 2022-03-09 16:49:29.787 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"ec6003b5-1423-4897-81b6-a6dadfe23199","result":{"params":{"state":"REGED"},"sessid":"cd4d748e-c9ad-4e85-ac4f-08c78c836f69"}}] 2022-03-09 16:49:29.798 19684-19800/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onLoginSuccessful :: [cd4d748e-c9ad-4e85-ac4f-08c78c836f69] :: Ready to make calls 2022-03-09 16:49:31.776 19684-19684/com.tongsoft.callphone D/TelnyxClient: ringtone/ringback media player stopped and released 2022-03-09 16:49:32.386 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":"a707b8c6-e6a3-437a-ab1a-94989aea89f3","result":{"message":"CALL CREATED","callID":"65c2aea6-edf3-45fd-9be2-72f989a867d2","sessid":"cd4d748e-c9ad-4e85-ac4f-08c78c836f69"}}] 2022-03-09 16:49:33.455 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Receiving [{"jsonrpc":"2.0","id":671517,"method":"telnyx_rtc.ringing","params":{"callID":"65c2aea6-edf3-45fd-9be2-72f989a867d2","caller_id_name":"alice","caller_id_number":"+15053873173","callee_id_name":"Outbound Call","callee_id_number":"+18259020274","display_direction":"inbound"}}] 2022-03-09 16:49:33.456 19684-19800/com.tongsoft.callphone D/VERTO: [TxSocket] Received Method [telnyx_rtc.ringing] 2022-03-09 16:49:33.457 19684-19800/com.tongsoft.callphone D/TelnyxClient: [TelnyxClient] :: onRingingReceived [{"jsonrpc":"2.0","id":671517,"method":"telnyx_rtc.ringing","params":{"callID":"65c2aea6-edf3-45fd-9be2-72f989a867d2","caller_id_name":"alice","caller_id_number":"+15053873173","callee_id_name":"Outbound Call","callee_id_number":"+18259020274","display_direction":"inbound"}}] 2022-03-09 16:49:33.459 19684-19800/com.tongsoft.callphone I/TxSocket: Socket is closed: null java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.gson.JsonElement.getAsString()' on a null object reference