Comments (6)
I have checked the log seems the issue is caused by second invite response not contain sdp body, I have build one version with response with sdp also when reply after connection build, you can have a try. I just upload the version for ESP32, you can replace it to folder https://github.com/espressif/esp-adf-libs/tree/master/esp_media_protocols/lib/esp32.
libesp_media_protocols.zip
from esp-adf.
Thanks for you investigation. I have fixed the issue you mentioned, please help to try if OK we will merge it
esp_media_protocol.zip
from esp-adf.
I have checked the log seems the issue is caused by second invite response not contain sdp body, I have build one version with response with sdp also when reply after connection build, you can have a try. I just upload the version for ESP32, you can replace it to folder https://github.com/espressif/esp-adf-libs/tree/master/esp_media_protocols/lib/esp32. libesp_media_protocols.zip
Hi,
Thank you for the quick response and for providing the updated version.
I have tested the solution and observed in Wireshark that the ESP32 is now responding to the INVITE SDP messages with the corresponding 200 OK SDP messages. However, I'm still receiving more INVITE messages from the server. This indicates that there might be something missing or incorrect in the response message from the ESP32.
![Screenshot 2024-06-18 at 17 06 56](https://private-user-images.githubusercontent.com/73194683/340730341-e02949d0-b4fe-41c3-bb95-d1ecc25db1c6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMzNDEyOTMsIm5iZiI6MTcyMzM0MDk5MywicGF0aCI6Ii83MzE5NDY4My8zNDA3MzAzNDEtZTAyOTQ5ZDAtYjRmZS00MWMzLWJiOTUtZDFlY2MyNWRiMWM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODExVDAxNDk1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2NGNjMWJhY2E5NGU5YTE5ZTFhODg3NzgxMWFiM2Q0ZmMyNzUxYzVjY2U4MWFmNmY2MmU4MzY3Y2FiMjAwZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.jYQny__lotcSK63k8OsEu5iMq4svsSZgCSiHnKZbYQ0)
I will continue to perform tests to identify the exact issue and will post a new comment with my findings as soon as possible.
Thanks again for your assistance.
from esp-adf.
Hi @TempoTian ,
I have completed the necessary tests and have some findings to share.
Using a Python VoIP library, I reproduced the OK SDP replies that the ESP32 is sending to the server to debug the SIP packets. Here are my analysis and conclusions:
Analysis of Frames Replicating ESP32 Behavior:
INVITE SDP from Server:
INVITE sip:[email protected]:5060;transport=udp SIP/2.0
Call-ID: [email protected]
Contact: <sip:XX.XXX.XXX.XXX:5060>
Content-Type: application/sdp
CSeq: 1992890617 INVITE
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=07739-HP-e9e0fd69-5378e1814
Max-Forwards: 29
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=467403
To: <sip:[email protected];user=phone>
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-OHOR-13ec59b9-147ba413
Allow: REFER,INVITE,NOTIFY,ACK,UPDATE,OPTIONS,REGISTER,SUBSCRIBE,NOTIFY,CANCEL,BYE,PRACK
User-Agent: Cirpack/v4.76 (gw_sip)
Content-Length: 323
v=0
o=anonymous 171932821733 171932821733 IN IP4 XX.XXX.XXX.XXX
s=SIP Call
c=IN IP4 91.121.129.155
t=0 0
m=audio 36700 RTP/AVP 8 0 18 101
b=AS:82
a=rtpmap:8 PCMA/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
First 200 OK SDP:
SIP/2.0 200 OK
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-OHOR-13ec59b9-147ba413
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=467403
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=07739-HP-e9e0fd69-5378e1814
To: <sip:[email protected];user=phone>;tag=-1239239399
Call-ID: [email protected]
CSeq: 1992890617 INVITE
Server: ESP32 SIP/2.0
Contact: <sip:[email protected]:5060;transport=UDP>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 153
v=0
o=Z 0 3 IN IP4 192.168.2.6
s=Z
t=0 0
c=IN IP4 192.168.2.6
m=audio 31952 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
Second INVITE SDP from Server:
INVITE sip:[email protected]:5060;transport=udp SIP/2.0
Call-ID: [email protected]
Contact: <sip:XX.XXX.XXX.XXX:5060>
Content-Type: application/sdp
CSeq: 1992890618 INVITE
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=07739-HP-e9e0fd69-5378e1814
Max-Forwards: 29
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=467403
To: <sip:[email protected];user=phone>;tag=-1239239399
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-JZSQ-13ec5dba-634a921c
Allow: REFER,INVITE,NOTIFY,ACK,UPDATE,OPTIONS,REGISTER,SUBSCRIBE,NOTIFY,CANCEL,BYE,PRACK
User-Agent: Cirpack/v4.76 (gw_sip)
Content-Length: 248
v=0
o=anonymous 171932821733 171932821734 IN IP4 XX.XXX.XXX.XXX
s=SIP Call
c=IN IP4 91.121.129.155
t=0 0
m=audio 36700 RTP/AVP 8 101
b=AS:82
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
Second 200 OK SDP Reply:
SIP/2.0 200 OK
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-JZSQ-13ec5dba-634a921c
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=467403
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=07739-HP-e9e0fd69-5378e1814
To: <sip:[email protected];user=phone>;tag=-1239239399;tag=-2004755355
Call-ID: [email protected]
CSeq: 1992890617 INVITE
Server: ESP32 SIP/2.0
Contact: <sip:[email protected]:5060;transport=UDP>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 153
v=0
o=Z 0 3 IN IP4 192.168.2.6
s=Z
t=0 0
c=IN IP4 192.168.2.6
m=audio 31952 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
Issue Identified:
The ESP32 is sending an extra tag in the "To" Header, which causes the packet to not be recognized and acknowledged by the server. When the second tag is removed from this header, the server responds with an ACK, and the INVITE SDP requests stop As we see next :
Frame Analysis with Corrected "To" Header:
INVITE SDP from Server:
INVITE sip:[email protected]:5060;transport=udp SIP/2.0
Call-ID: [email protected]
Contact: <sip:XX.XXX.XXX.XXX:5060>
Content-Type: application/sdp
CSeq: 2003502912 INVITE
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=02587-OF-ea6c106b-3ddada606
Max-Forwards: 29
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=225575
To: <sip:[email protected];user=phone>
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-GNBF-175f9337-1fe841e0
Allow: REFER,INVITE,NOTIFY,ACK,UPDATE,OPTIONS,REGISTER,SUBSCRIBE,NOTIFY,CANCEL,BYE,PRACK
User-Agent: Cirpack/v4.76 (gw_sip)
Content-Length: 323
v=0
o=anonymous 171938964817 171938964817 IN IP4 XX.XXX.XXX.XXX
s=SIP Call
c=IN IP4 91.121.129.146
t=0 0
m=audio 36926 RTP/AVP 8 0 18 101
b=AS:82
a=rtpmap:8 PCMA/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
First 200 OK SDP:
SIP/2.0 200 OK
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-GNBF-175f9337-1fe841e0
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=225575
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=02587-OF-ea6c106b-3ddada606
To: <sip:[email protected];user=phone>;tag=-1239239399
Call-ID: [email protected]
CSeq: 2003502912 INVITE
Server: ESP32 SIP/2.0
Contact: <sip:[email protected]:5060;transport=UDP>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 153
v=0
o=Z 0 3 IN IP4 192.168.2.6
s=Z
t=0 0
c=IN IP4 192.168.2.6
m=audio 31952 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
Second INVITE SDP from Server:
INVITE sip:[email protected]:5060;transport=udp SIP/2.0
Call-ID: [email protected]
Contact: <sip:XX.XXX.XXX.XXX:5060>
Content-Type: application/sdp
CSeq: 2003502913 INVITE
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=02587-OF-ea6c106b-3ddada606
Max-Forwards: 29
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=225575
To: <sip:[email protected];user=phone>;tag=-1239239399
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-RLJA-175f976a-4c0300ec
Allow: REFER,INVITE,NOTIFY,ACK,UPDATE,OPTIONS,REGISTER,SUBSCRIBE,NOTIFY,CANCEL,BYE,PRACK
User-Agent: Cirpack/v4.76 (gw_sip)
Content-Length: 248
v=0
o=anonymous 171938964817 171938964818 IN IP4 XX.XXX.XXX.XXX
s=SIP Call
c=IN IP4 91.121.129.146
t=0 0
m=audio 36926 RTP/AVP 8 101
b=AS:82
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
Second 200 OK SDP Reply:
SIP/2.0 200 OK
Via: SIP/2.0/UDP XX.XXX.XXX.XXX:5060;branch=z9hG4bK-RLJA-175f976a-4c0300ec
Record-Route: <sip:XX.XXX.XXX.XXX:5060;lr>;session=225575
From: "+33XXXXXXXXX" <sip:[email protected];user=phone>;tag=02587-OF-ea6c106b-3ddada606
To: <sip:[email protected];user=phone>;tag=-1239239399
Call-ID: [email protected]
CSeq: 2003502912 INVITE
Server: ESP32 SIP/2.0
Contact: <sip:[email protected]:5060;transport=UDP>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 153
v=0
o=Z 0 3 IN IP4 192.168.2.6
s=Z
t=0 0
c=IN IP4 192.168.2.6
m=audio 31952 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
After making the correction, the server properly acknowledges the OK replies with an ACK and stops the continuous INVITE SDP requests.
Note on CSeq Number:
It was also observed that the ESP32 replies to the first INVITE SDP with the same CSeq number as the request, which is correct. However, for subsequent INVITE requests from the server, the CSeq increments while the ESP32 replies with the same CSeq as the first request. Currently, this is not causing any issues with the server's acceptance of the response, but it might be a potential issue with different servers in the future.
Finally, I would like to request this correction specifically for the ESP32-S3, as we are currently using a custom ESP32-S3 board to implement our solution. The Lyra Board was utilized solely for testing purposes.
Please let me know if there are any further steps or additional information required.
from esp-adf.
Thank you for the quick response and fix. I have tested the updated library on both the ESP32 and ESP32S3, and I can confirm that both are now working as expected. Thanks again for your help!
from esp-adf.
hi, @TempoTian Could you please remember to merge the fix once it's verified? Thank you!
from esp-adf.
Related Issues (20)
- ESP32-LyraTD-MSC v2.2 can not control the volumes when run the example "get-started/play_mp3_control" (AUD-5501) HOT 1
- play bt source, mp3 decoder crash (AUD-5505) HOT 1
- A lot of "deprecated" in VoIP example (AUD-5517) HOT 1
- To configure DTMF RTP events duration and volume. (AUD-5521) HOT 4
- To trigger actions on DTMF rtp events' start and end. (AUD-5522) HOT 6
- examples\advanced_examples\algorithm 这个例程中,请问下如何获取到 aec和ns后的音频数据呢 (AUD-5526) HOT 3
- Examples give warnings and not work (AUD-5538) HOT 6
- ESP-ADF does not get recognized in VSCode after install (AUD-5539) HOT 4
- 关于AEC信号延迟调整的问题,如果让参考信号更靠前 (AUD-5540) HOT 1
- I2C 驱动提示冲突(AUD-5547) HOT 2
- 使用pipeline_spiffs_mp3和pipeline_wav_amr_sdcard例程时喇叭会有破音的 (AUD-5550) HOT 4
- 关于VOIP AEC效果问题请教,如何可以让AEC质量变得更好? (AUD-5559) HOT 6
- How to enable NS_MODE_NET ? (AUD-5565) HOT 1
- Http_Stream resume behavior should restart at last read, not from beginning. (AUD-5571) HOT 2
- ESP-ADF Release/v2.7 (AUD-5577) HOT 3
- 关于audio_hal/driver/es7210的问题请教 (AUD-5580) HOT 1
- Facing issue while streaming audio to connected device HOT 3
- VOIP Example calls don't hang-up with Asteriks (AUD-5592) HOT 2
- esp_codec_dev: Breaking change in v1.2.0 (AUD-5594) HOT 2
- Unable to open the sd card file while transmitting audio data to connected device through bluetooth a2dp (AUD-5602) HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-adf.