espressif / esp-adf

Espressif Audio Development Framework
Other
1.49k stars 667 forks source link

Voip No Audio when Making Call (AUD-5169) #1140

Closed hardware-samelement closed 5 months ago

hardware-samelement commented 5 months ago

Environment

Problem Description

i run voip example and connecting it to yeastar s20 ippbx server. the problem came when i try to make a call with esp32-LyraT-Mini there is no voice in my esp client but in other client (i use linphone and sipnetic android app) the audio works normally, the audio is only one way. there is no problem when the esp client is the one that receive calls.

i tried to swap the uri in esp client with the other client but the problem still there. i also tried to connect in miniSIPServer and the audio works normally.

is the problem came from the esp client or the yeastar s20 ippbx server?

Expected Behavior

the call run normally in two way when making call.

Actual Behavior

no audio in the esp client when making a call. the audio only run one way.

Steps to Reproduce

  1. run the voip example
  2. set URI to connect with yeastar s20 ippbx server
  3. make a call from esp client.

Debug Logs

W (495699) SIP: CHANGE STATE FROM 2, TO 64, :func: esp_sip_uac_invite:2289
I (495766) SIP: [1970-01-01/00:08:07]=======WRITE 0973 bytes>>
I (495766) SIP: 

INVITE sip:2004@192.168.2.150:5060 SIP/2.0

Via: SIP/2.0/TCP 192.168.2.244:60174;branch=z9hG4bK-2091182445;rport

From: <sip:2000@192.168.2.150:5060>;tag=1654031919

To: <sip:2004@192.168.2.150:5060>

Contact: <sip:2000@192.168.2.244:60174;transport=TCP>

Max-Forwards: 70

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

CSeq: 3 INVITE

Expires: 100

User-Agent: MOT-SIP v1.0

Content-Length: 164

Allow: INVITE, ACK, CANCEL, BYE, UPDATE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE

Content-Type: application/sdp

Authorization: Digest username="2000", realm="YSAsterisk", nonce="1705547923/30956f77a7bbec0aa766d83ef50a158f", uri="sip:192.168.2.150:5060", response="0abb803eb860996d76004294a88e8b35", algorithm=md5, qop=auth, nc=00000001, cnonce="8493158ea9d52f1a", opaque="1f2ea9ac3643419a"

v=0

o=Z 0 3 IN IP4 192.168.2.244

s=SIP Call

c=IN IP4 192.168.2.244

t=0 0

m=audio 33913 RTP/AVP 8 101

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000


I (495851) SIP: [1970-01-01/00:08:07]=======================>>
I (495870) SIP: [1970-01-01/00:08:07]<<=====READ 0322 bytes==
I (495871) SIP: 

SIP/2.0 100 Trying

Via: SIP/2.0/TCP 192.168.2.244:60174;rport=60174;received=192.168.2.244;branch=z9hG4bK-2091182445

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

From: <sip:2000@192.168.2.150>;tag=1654031919

To: <sip:2004@192.168.2.150>

CSeq: 3 INVITE

Server: Yeastar S20-30.15.0.125

Content-Length:  0


I (495898) SIP: [1970-01-01/00:08:07]<<======================
I (496095) SIP: [1970-01-01/00:08:07]<<=====READ 0656 bytes==
I (496096) SIP: 

SIP/2.0 180 Ringing

Via: SIP/2.0/TCP 192.168.2.244:60174;rport=60174;received=192.168.2.244;branch=z9hG4bK-2091182445

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

From: <sip:2000@192.168.2.150>;tag=1654031919

To: <sip:2004@192.168.2.150>;tag=4fb484b0-a0ed-40cf-90a8-b5cd28ccf035

CSeq: 3 INVITE

Server: Yeastar S20-30.15.0.125

Contact: <sip:2004@192.168.2.150:5060;transport=TCP>

Allow: OPTIONS, NOTIFY, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, REGISTER, MESSAGE, REFER

P-Asserted-Identity: "tes5" <sip:2004@192.168.2.150>

Remote-Party-ID: "tes5" <sip:2004@192.168.2.150>;privacy=off;screen=no

Content-Length:  0


I (496152) SIP: [1970-01-01/00:08:07]<<======================
W (496159) SIP: CHANGE STATE FROM 64, TO 68, :func: _sip_uac_request_invite:1372
I (496167) SIP_SERVICE: ESP_RTC_EVENT_CALLING Remote Ring...
SIPCI (497959) SIP: [1970-01-01/00:08:08]<<=====READ 0946 bytes==
I (497959) SIP: 

SIP/2.0 200 OK

Via: SIP/2.0/TCP 192.168.2.244:60174;rport=60174;received=192.168.2.244;branch=z9hG4bK-2091182445

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

From: <sip:2000@192.168.2.150>;tag=1654031919

To: <sip:2004@192.168.2.150>;tag=4fb484b0-a0ed-40cf-90a8-b5cd28ccf035

CSeq: 3 INVITE

Server: Yeastar S20-30.15.0.125

Contact: <sip:2004@192.168.2.150:5060;transport=TCP>

Allow: OPTIONS, NOTIFY, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, REGISTER, MESSAGE, REFER

Supported: timer, replaces, norefersub

P-Asserted-Identity: "tes5" <sip:2004@192.168.2.150>

Remote-Party-ID: "tes5" <sip:2004@192.168.2.150>;privacy=off;screen=no

Content-Type: application/sdp

Content-Length:   221

v=0

o=- 0 5 IN IP4 192.168.2.150

s=Asterisk

c=IN IP4 192.168.2.150

t=0 0

m=audio 10258 RTP/AVP 8 101

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

a=maxptime:150

a=sendrecv


I (498042) SIP: [1970-01-01/00:08:08]<<======================
I (498050) SIP: Remote ARTP port=10258
I (498053) SIP: Remote RTP addr=192.168.2.150

I (498060) SIP_SERVICE: ESP_RTC_EVENT_AUDIO_SESSION_BEGIN
I (498065) AUDIO_PIPELINE: link el->rb, el:0x3f822bf4, tag:algo, rb:0x3f823554
I (498072) AUDIO_THREAD: The algo task allocate stack on external memory
I (498080) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:4221976 Bytes, Inter:232783 Bytes, Dram:192523 Bytes


I (498093) AFE_VC: afe interface for voice communication

I (498098) AFE_VC: AFE version: VC_V220727

I (498103) AFE_VC: Initial auido front-end, total channel: 2, mic num: 1, ref num: 1

I (498111) AFE_VC: aec_init: 1, se_init: 1, vad_init: 0

I (498117) AFE_VC: wakenet_init: 0, voice_communication_agc_init: 0

I (498154) AUDIO_PIPELINE: Pipeline started
I (498154) AUDIO_THREAD: The _audio_enc task allocate stack on external memory
I (498158) AV_STREAM: audio_enc started
I (498161) AUDIO_THREAD: The _audio_dec task allocate stack on external memory
I (498164) AFE_VC: mode: 1, (Sep 14 2023 14:49:47)

I (498174) AUDIO_THREAD: The algo_fetch task allocate stack on external memory
I (498188) AV_STREAM: audio_dec started
audio session begin 
W (498196) SIP: CHANGE STATE FROM 68, TO 96, :func: _sip_uac_process_res_ok:1328
I (498201) SIP: [1970-01-01/00:08:08]=======WRITE 0724 bytes>>
I (498205) SIP: 

ACK sip:2004@192.168.2.150:5060;transport=TCP SIP/2.0

Via: SIP/2.0/TCP 192.168.2.244:60174;branch=z9hG4bK-2091182445;rport

From: <sip:2000@192.168.2.150>;tag=1654031919

To: <sip:2004@192.168.2.150>;tag=4fb484b0-a0ed-40cf-90a8-b5cd28ccf035

Contact: <sip:2000@192.168.2.244:60174;transport=TCP>

Max-Forwards: 70

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

CSeq: 3 ACK

Expires: 100

User-Agent: MOT-SIP v1.0

Content-Length: 0

Authorization: Digest username="2000", realm="YSAsterisk", nonce="1705547923/30956f77a7bbec0aa766d83ef50a158f", uri="sip:192.168.2.150:5060", response="616f66a43747bfeba2cf87d5fca602f9", algorithm=md5, qop=auth, nc=00000001, cnonce="037ce9906a4863f3", opaque="1f2ea9ac3643419a"


I (498272) SIP: [1970-01-01/00:08:08]=======================>>
I (498281) SIP: [1970-01-01/00:08:08]<<=====READ 0946 bytes==
I (498289) SIP: 

SIP/2.0 200 OK

Via: SIP/2.0/TCP 192.168.2.244:60174;rport=60174;received=192.168.2.244;branch=z9hG4bK-2091182445

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

From: <sip:2000@192.168.2.150>;tag=1654031919

To: <sip:2004@192.168.2.150>;tag=4fb484b0-a0ed-40cf-90a8-b5cd28ccf035

CSeq: 3 INVITE

Server: Yeastar S20-30.15.0.125

Contact: <sip:2004@192.168.2.150:5060;transport=TCP>

Allow: OPTIONS, NOTIFY, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, REGISTER, MESSAGE, REFER

Supported: timer, replaces, norefersub

P-Asserted-Identity: "tes5" <sip:2004@192.168.2.150>

Remote-Party-ID: "tes5" <sip:2004@192.168.2.150>;privacy=off;screen=no

Content-Type: application/sdp

Content-Length:   221

v=0

o=- 0 5 IN IP4 192.168.2.150

s=Asterisk

c=IN IP4 192.168.2.150

t=0 0

m=audio 10258 RTP/AVP 8 101

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

a=maxptime:150

a=sendrecv


I (498372) SIP: [1970-01-01/00:08:08]<<======================
I (498389) SIP: [1970-01-01/00:08:08]=======WRITE 0724 bytes>>
I (498390) SIP: 

ACK sip:2004@192.168.2.150:5060;transport=TCP SIP/2.0

Via: SIP/2.0/TCP 192.168.2.244:60174;branch=z9hG4bK-2091182445;rport

From: <sip:2000@192.168.2.150>;tag=1654031919

To: <sip:2004@192.168.2.150>;tag=4fb484b0-a0ed-40cf-90a8-b5cd28ccf035

Contact: <sip:2000@192.168.2.244:60174;transport=TCP>

Max-Forwards: 70

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

CSeq: 3 ACK

Expires: 100

User-Agent: MOT-SIP v1.0

Content-Length: 0

Authorization: Digest username="2000", realm="YSAsterisk", nonce="1705547923/30956f77a7bbec0aa766d83ef50a158f", uri="sip:192.168.2.150:5060", response="bf971310bacffe2a589356e4efdf20b9", algorithm=md5, qop=auth, nc=00000001, cnonce="af1675a3baa9b79e", opaque="1f2ea9ac3643419a"


I (498452) SIP: [1970-01-01/00:08:08]=======================>>
I (503189) SIP: [1970-01-01/00:08:11]<<=====READ 0449 bytes==
I (503190) SIP: 

BYE sip:2000@192.168.2.244:60174;transport=TCP SIP/2.0

Via: SIP/2.0/TCP 192.168.2.150:5060;rport;branch=z9hG4bKPj10316b9e-e5b4-4cd9-802c-47dffcba7a66;alias

From: <sip:2004@192.168.2.150>;tag=4fb484b0-a0ed-40cf-90a8-b5cd28ccf035

To: <sip:2000@192.168.2.150>;tag=1654031919

Call-ID: DC2A214DA3C2FDEFEF971F1E3D02DB586F707EA503B3

CSeq: 26943 BYE

Reason: Q.850;cause=16

Max-Forwards: 70

User-Agent: Yeastar S20-30.15.0.125

Content-Length:  0


I (503228) SIP: [1970-01-01/00:08:11]<<======================
I (503238) SIP_SERVICE: ESP_RTC_EVENT_AUDIO_SESSION_END
I (503241) AV_STREAM: _audio_enc task stoped
I (503284) ALGORITHM_STREAM: _algo_fetch_task is stopped
I (503288) AFE_VC: afe_se_task quit

I (503288) AFE_VC: afe task destroy finished

I (503289) AFE_VC: exit function: afe_destory

W (503294) AUDIO_PIPELINE: There are no listener registered
I (503300) AUDIO_PIPELINE: audio_pipeline_unlinked
I (503305) AV_STREAM: _audio_dec task stoped
audio session end 
I (503321) SIP_SERVICE: ESP_RTC_EVENT_HANGUP
W (503321) SIP: CHANGE STATE FROM 96, TO 2, :func: sip_uas_process_req:1042
I (503325) SIP: [1970-01-01/00:08:11]=======WRITE 0476 bytes>>
I (503331) SIP: