Closed wenxiao11 closed 1 year ago
Hi @wenxiao11
Can you try to update to release/v2.4, because the new version has some sip bugfixes.
But I also see some errors like the CSeq should not be 3, due to the fail.log is incomplete and some SIP fields are missing, so it's not easy to analyze the reasons.
Thanks.
Hi @ahhfzhang I am Sungsu working with Wenxiao11. First of all, we were using the 2022 Feb version of esp-adf. We tested with ESP32-LyraT 4.3 with the latest version 2.4 as you recommened. The hangup problem still occurs. To reproduce this problem, a more detailed explanation is as follows.
Test Environment :
It is currently being developed using ESP32-LyraT, and MicroSIP is installed on the development PC to test the call. PC (MicroSIP) <--> Twilio SIP server <--> ESP32-LyraT Problem :
The VoIP call session is not ended correctly when caller is not the ESP device.
That is, if I use MicroSIP to call the device, the device accept the call and then hangup, the session cannot be ended. o PC (MicroSIP) -----> Twilio SIP server --> ESP32-LyraT Call ----------------------------> Accept call <-------------------------- Hang up Fail Call status is maintained.
However, if I do it reversely, use device to call MicroSIP and MicroSIP hangup, the session is closed correctly. o PC (MicroSIP) <------Twilio SIP server <----- ESP32-LyraT <--------------------------------- Call Accept call Hang up ---------------------------------> Success
We have reached out to Twilio regarding this issue. Twilio answer said that there is a problem with Hang up on the device. Please confirm.
Below is Twilio's answer: Please check it out and let me know how to solve it.
Thanks Sungsu
===============================================================================
In summary you will need to make changes on your end as your hardware client is sending the wrong SIP BYE request URI(RURI). Here is my detail analysis on the issue that you have faced.
SIP BYE Request URI should be populated based on the contact header that was shared previously. In the success BYE case, this was followed and as such there was no issue. Contact header from SIP 200 (from Twilio to your SIP Client):
SIP BYE RURI based on the above contact header:
In the failed BYE case, if we look at the contact header at SIP from the INVITE that is send from Twilio to your SIP client:
The SIP BYE generated from your hardware client is sip:101@epicsafetysiptest.sip.twilio.com:5060. The correct RURI should be sip:101@172.25.78.174:5060. Once you make this changes it should not be throwing such error again.
Hi @charon22
As twillo replied, we should use the 'INVITE' contact header, but it was cleared by ‘OPTION’, so it replaced by new one. I think the latest ADF master had fix this issue, we use keep-alive instead of 'option' to keep the NAT hole opened. So you can set 'send_options = false' and try again.
Thanks.
Hi @ahhfzhang As you said, I set send_option to false and tested it. However, the same problem still occurred. (FAIL)
static esp_err_t wifi_service_cb(..) { ..... sip_config_t sip_cfg = { .uri = SIP_URI, .event_handler = _sip_event_handler, .send_options = false, .... }
I will send you the corresponding device logo.
You can check that send_option is set to false in the log as follows in the log. I (4549) VOIP_EXAMPLE: [ 5 ] Create SIP Service I (4549) VOIP_EXAMPLE: send_options (0)
Lyrat device log
teraterm_COM7_20230201_092223.log
Thanks
Hi @charon22
Thanks, we will fix it soon.
Hi @ahhfzhang We look forward to your corrections. Thank you
Environment
Problem Description
The VoIP call session is not ended correctly when caller is not the ESP device. That is, if I use MicroSIP to call the device, the device accept the call and then hangup, the session cannot be ended. However, if I do it reversely, use device to call MicroSIP and MicroSIP hangup, the session is closed correctly.
Expected Behavior
Receive 200 OK message
Actual Behavior
Receive 481 Call/Transaction Does not Exist
Steps to Reproduce
Debug Logs
log.txt: The SIP BYE messages for both success and fail cases success.log: Full log for the successful case. (Device call, MicroSIP hangup) fail.log: Full log for the fail case. (MicroSIP call, Device hangup)