Asterisk RTP with WebRTC

Hi, I am building a website to make outbound calls with Asterisk as a gateway. I used JsSIP+Websocket secure for frontend WebRTC setting and configured pjsip.conf, extensions.conf, http.conf. I have three SIP accounts in pjsip.conf: a WebRTC account, a local SIP account and a SIP account from SIP2SIP.info:
[webrtc_client]
type=endpoint
aors=webrtc_client
auth=webrtc_client
dtls_auto_generate_cert=yes
webrtc=yes
context=from-internal
disallow=all
allow=ulaw
force_rport=yes
rewrite_contact=yes
transport=transport-udp

[webrtc_client]
type=aor
max_contacts=5
remove_existing=yes

[webrtc_client]
type=auth
auth_type=userpass
username=webrtc_client
password=****** ;

[6002]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=6002-auth
aors=6002
direct_media=yes
transport=transport-udp

[6002-auth]
type=auth
auth_type=userpass
username=6002
password=******

[6002]
type=aor
max_contacts=2

[sip2sip_provider]
type = endpoint
context = outbound
disallow = all
allow = ulaw
outbound_auth = sip2sip_provider_auth
aors = sip2sip_provider_aor
rtp_symmetric=yes
force_rport=yes
direct_media=no
rtcp_mux=yes
ice_support=yes
transport=transport-tcp
from_user=******
from_domain=sip2sip.info

[sip2sip_provider_auth]
type = auth
auth_type = userpass
username = sip2sip_account
password = ******

[sip2sip_provider_aor]
type = aor
contact = sip:sip2sip.info

[sip2sip_provider_registration]
type = registration
outbound_auth = sip2sip_provider_auth
server_uri = sip:sip2sip.info
client_uri = sip:******@sip2sip.info
retry_interval = 60

[sip2sip_identify]
type=identify
endpoint=sip2sip_provider
match=sip2sip.info

I made a call between webrtc_client (browser) and 6002 (logged on Zoiper) with normal audio. However, when I call from webrtc_client (via sip2sip_account) to another SIP2SIP account on Zoiper, the SIP invitation is fine but when I accept the call, there is no media at all.

I checked pjsip registrations and endpoints, with no problem. I also added NAT-related configuration in rtp.conf:
[general]
stunaddr:3478=stun.voip.blackberry.com
rtpstart=10000
rtpend=20000

and pjsip.conf:
[general]
stunaddr:3478=stun.voip.blackberry.com
rtpstart=10000
rtpend=20000
externip=******
localnet=172...**/255.255.255.0
nat=force_rport,comedia
codec_translate=yes
tls_server=yes
tls_cert_file=/etc/asterisk/keys/asterisk.pem
tls_private_key=/etc/asterisk/keys/asterisk.key

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
local_net=172.../24
local_net=127.0.0.1/32
external_media_address=
****
external_signaling_address=******

[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0
local_net=172.../24
external_media_address=
****
external_signaling_address=******

I used rtp set debug on and see that when I established the call to the SIP2SIP account, there is no rtp channel built. I wonder what makes my outbound call (to SIP2SIP.info) with no audio but the local call is fine? Is it because I used a self-signed certificate or the NAT configuration is not properly set? Thanks!

Please provide “pjsip set logger on” type logs.

I don’t think the certificate is an issue. Certificate problems generally result in the receiving end not seeing any signalling. Also “self signed” is misused in the Asterisk world. Typically the certificates are signed by a corporate signing certificate, which might be a root certficate, and therefore, like all root certificates, sel signed, but is not th e certificate actually.

Although not relevant to the issue, context=outbound is confusing. context relates to incoming requests and when used in relation to a provider, it will apply to calls that are incoming to your site.

I’m not sure that chan_pjsip has a general section, at all, but it certainly doesn’t have a parameter called nat.

I don’t think WebRTC supports TLS connections being created in the to browser direction, so I don’t think rewrite_contact serves any purpose.

Given those, I’d suggest you check all the settings against the documentation, and make sure they are valid and relevant.

Thanks for you help!

The pjsip set logger on is partly as below:

I compared it with the normal internal call and found they are almost the same. However, with “rtp set debug on”, the internal call will immediately show a lot:
Got RTP packet from 172.16..:49685 (type 00, seq 037118, ts 1795590354, len 000160)
Sent RTP packet to 172.16..:46864 (via ICE) (type 00, seq 011646, ts 1795590352, len 000170)
right after the two accounts joined ‘simple_bridge’ basic-bridge. There is no rtp packet for the outbound call.

For context=outbound, I mean the dial plan in the extensions.conf:
[outbound]
exten => _[a-z].,1,Dial(PJSIP/${EXTEN}@sip2sip_provider,30)
exten => _X.,n,Hangup()

I will check those settings like nat, and rewrite_contact from the documentation. Thx!

Please use plain text, not images, for logs.

The log of the outbound call is incomplete, and missing an important part. However, you need to explain why the OK comes from a different address from the media address, in its SDP.

I tried to copy the plain text but the community does not allow more than two links published by a new account. The different address do you mean the contact: sip: another_account@36.7..? This address is the external IP while 172.16.. is the internal IP behind NAT.

The complete log is shown below:

Executing [another_account@from-internal:1] Dial(“PJSIP/webrtc_client-00000004”, “PJSIP/another_account@sip2sip_provider,30”) in new stack
– Called PJSIP/another_account@sip2sip_provider
<— Transmitting SIP request (1269 bytes) to TCP:212.95.45.179:5060 —>
INVITE sip:another_account@sip2sip.info SIP/2.0
Via: SIP/2.0/TCP 36.7..:5060;rport;branch=z9hG4bKPjf178dde7-80e0-424e-b708-c47f91e4d73d;alias
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
To: sip:another_account@sip2sip.info
Contact: sip:sip2sip_account@36.7.:5060*.*;transport=TCP
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27154 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 22.1.1
Content-Type: application/sdp
Content-Length: 580

v=0
o=- 420294206 420294206 IN IP4 36.7..
s=Asterisk
c=IN IP4 36.7..
t=0 0
m=audio 13112 RTP/AVP 0 101
a=ice-ufrag:5b13cc4e08a228cc58eeab973509d39c
a=ice-pwd:54ec330c1e811d4033059d0c09e46760
a=candidate:Hac100935 1 UDP 2130706431 172.16.. 13112 typ host
a=candidate:H4742a809 1 UDP 2130706431 fe80::1f08:33aa:e8f:c545 13112 typ host
a=candidate:S24079f4e 1 UDP 1694498815 36.7.. 15326 typ srflx raddr 172.16.. rport 13112
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv
a=rtcp-mux

<— Received SIP response (389 bytes) from TCP:212.95.45.179:5060 —>
SIP/2.0 100 Giving it a try
Via: SIP/2.0/TCP 36.7..:5060;received=36.7..;rport=38534;branch=z9hG4bKPjf178dde7-80e0-424e-b708-c47f91e4d73d;alias
To: sip:another_account@sip2sip.info
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27154 INVITE
Server: SIP Thor on OpenSIPS XS 3.2
Content-Length: 0

<— Received SIP response (569 bytes) from TCP:212.95.45.179:5060 —>
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/TCP 36.7..:5060;received=36.7..;rport=38534;branch=z9hG4bKPjf178dde7-80e0-424e-b708-c47f91e4d73d;alias
To: sip:another_account@sip2sip.info;tag=424d.4e7b475c2e0ef26b35bf812286b0ec69
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27154 INVITE
Proxy-Authenticate: Digest realm=“sip2sip.info”, nonce=“kR2SvyBkIbok1PlvcWcT7PTdRQ85R20YaeZVzHIYXdkA”, qop=“auth,auth-int”
Server: SIP Thor on OpenSIPS XS 3.2
Content-Length: 0

<— Transmitting SIP request (423 bytes) to TCP:212.95.45.179:5060 —>
ACK sip:another_account@sip2sip.info SIP/2.0
Via: SIP/2.0/TCP 36.7..:5060;rport;branch=z9hG4bKPjf178dde7-80e0-424e-b708-c47f91e4d73d;alias
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
To: sip:another_account@sip2sip.info;tag=424d.4e7b475c2e0ef26b35bf812286b0ec69
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27154 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 22.1.1
Content-Length: 0

<— Transmitting SIP request (1537 bytes) to TCP:212.95.45.179:5060 —>
INVITE sip:another_account@sip2sip.info SIP/2.0
Via: SIP/2.0/TCP 36.7..:5060;rport;branch=z9hG4bKPj6cfd673b-6745-44b1-982e-97c8efcb37d8;alias
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
To: sip:another_account@sip2sip.info
Contact: sip:sip2sip_account@36.7.:5060*.*;transport=TCP
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27155 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 22.1.1
Proxy-Authorization: Digest username=“sip2sip_account”, realm=“sip2sip.info”, nonce=“kR2SvyBkIbok1PlvcWcT7PTdRQ85R20YaeZVzHIYXdkA”, uri=“sip:another_account@sip2sip.info”, response=“b93a43667e48ea4a76171d9662f651b9”, cnonce=“7d04b044e3884276afc66d97769bd1a3”, qop=auth, nc=00000001
Content-Type: application/sdp
Content-Length: 580

v=0
o=- 420294206 420294206 IN IP4 36.7..
s=Asterisk
c=IN IP4 36.7..
t=0 0
m=audio 13112 RTP/AVP 0 101
a=ice-ufrag:5b13cc4e08a228cc58eeab973509d39c
a=ice-pwd:54ec330c1e811d4033059d0c09e46760
a=candidate:Hac100935 1 UDP 2130706431 172.16.. 13112 typ host
a=candidate:H4742a809 1 UDP 2130706431 fe80::1f08:33aa:e8f:c545 13112 typ host
a=candidate:S24079f4e 1 UDP 1694498815 36.7.. 15326 typ srflx raddr 172.16.. rport 13112
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv
a=rtcp-mux

<— Received SIP response (389 bytes) from TCP:212.95.45.179:5060 —>
SIP/2.0 100 Giving it a try
Via: SIP/2.0/TCP 36.7..:5060;received=36.7..;rport=38534;branch=z9hG4bKPj6cfd673b-6745-44b1-982e-97c8efcb37d8;alias
To: sip:another_account@sip2sip.info
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27155 INVITE
Server: SIP Thor on OpenSIPS XS 3.2
Content-Length: 0

<— Received SIP response (1210 bytes) from TCP:212.95.45.179:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/TCP 36.7..:5060;received=36.7..;rport=38534;branch=z9hG4bKPj6cfd673b-6745-44b1-982e-97c8efcb37d8;alias
Record-Route: sip:212.95.45.179;transport=tcp;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Record-Route: sip:212.95.45.179;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Record-Route: sip:174.142.205.46;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.7e99d37
Record-Route: sip:212.95.45.179;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Record-Route: sip:212.95.45.179;transport=tcp;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Contact: sip:another_account@36.7.:27555*.*;transport=TCP
To: sip:another_account@sip2sip.info;tag=10c0877a
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27155 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.6 v2.10.20.5
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 0

-- PJSIP/sip2sip_provider-00000005 is ringing

<— Transmitting SIP response (490 bytes) to WSS:172.16..:49638 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/WSS fjoqd5gjb1p6.invalid;rport=49638;received=172.16..;branch=z9hG4bK6143434
Call-ID: cgjj64hg09hvo64q00r0
From: sip:webrtc_client@172.16.*.*;tag=r973a39flu
To: sip:another_account@172.16.*.*;tag=dcc20b1a-9d2d-40cb-9b2a-a228bbe05526
CSeq: 9821 INVITE
Server: Asterisk PBX 22.1.1
Contact: sip:172.16.:5060*.*
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Content-Length: 0

<— Received SIP response (1634 bytes) from TCP:212.95.45.179:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP 36.7..:5060;received=36.7..;rport=38534;branch=z9hG4bKPj6cfd673b-6745-44b1-982e-97c8efcb37d8;alias
Record-Route: sip:212.95.45.179;transport=tcp;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Record-Route: sip:212.95.45.179;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Record-Route: sip:174.142.205.46;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.7e99d37
Record-Route: sip:212.95.45.179;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Record-Route: sip:212.95.45.179;transport=tcp;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Require: timer
Contact: sip:another_account@36.7.:27555*.*;transport=TCP
To: sip:another_account@sip2sip.info;tag=10c0877a
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27155 INVITE
Session-Expires: 1800;refresher=uac
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.6 v2.10.20.5
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 343

v=0
o=Z 0 2756944404 IN IP4 172.16.9.52
s=Z
c=IN IP4 67.205.116.200
t=0 0
m=audio 52800 RTP/AVP 0 106 9 8 3 101 98
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=sendrecv
a=rtcp-mux

<— Transmitting SIP request (905 bytes) to TCP:212.95.45.179:5060 —>
ACK sip:another_account@36.7..:27555;transport=TCP SIP/2.0
Via: SIP/2.0/TCP 36.7..:5060;rport;branch=z9hG4bKPj732791c3-a31d-4b00-aac1-d32e20ebc72e;alias
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
To: sip:another_account@sip2sip.info;tag=10c0877a
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27155 ACK
Route: sip:212.95.45.179;transport=tcp;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Route: sip:212.95.45.179;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Route: sip:174.142.205.46;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.7e99d37
Route: sip:212.95.45.179;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Route: sip:212.95.45.179;transport=tcp;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Max-Forwards: 70
User-Agent: Asterisk PBX 22.1.1
Content-Length: 0

-- PJSIP/sip2sip_provider-00000005 answered PJSIP/webrtc_client-00000004

<— Transmitting SIP response (1555 bytes) to WSS:172.16..:49638 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS fjoqd5gjb1p6.invalid;rport=49638;received=172.16..;branch=z9hG4bK6143434
Call-ID: cgjj64hg09hvo64q00r0
From: sip:webrtc_client@172.16.*.*;tag=r973a39flu
To: sip:another_account@172.16.*.*;tag=dcc20b1a-9d2d-40cb-9b2a-a228bbe05526
CSeq: 9821 INVITE
Server: Asterisk PBX 22.1.1
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Contact: sip:172.16.:5060*.*
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 90;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length: 937

v=0
o=- 3064053736346234544 4 IN IP4 172.16..
s=Asterisk
c=IN IP4 172.16..
t=0 0
a=msid-semantic:WMS *
a=group:BUNDLE 0
m=audio 18496 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:active
a=fingerprint:SHA-256 47:D2:2F:CB:44:63:C4:AE:BA:BE:B4:A2:48:1F:22:01:7A:D7:6E:D6:E0:DA:EA:2F:0F:43:85:58:E2:84:69:24
a=ice-ufrag:2e5d32be54af2edb7f3b934f55a8a1a1
a=ice-pwd:575112a551e8f37b459966d25b989bbf
a=candidate:Hac100935 1 UDP 2130706431 172.16.. 18496 typ host
a=candidate:S24079f4e 1 UDP 1694498815 36.7.. 15315 typ srflx raddr 172.16.. rport 18496
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:140
a=sendrecv
a=rtcp-mux
a=ssrc:362561819 cname:d0c4184f-806a-47c0-8341-1ba343898657
a=msid:6490807e-13a8-4c45-ab47-45fb3d599963 6d66a681-73a8-4176-ab1b-dec135ade4e6
a=rtcp-fb:* transport-cc
a=mid:0
m=audio 0 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126

-- Channel PJSIP/sip2sip_provider-00000005 joined 'simple_bridge' basic-bridge <939c157d-45a0-40ba-9ba9-e2c3b93e6f8a>
-- Channel PJSIP/webrtc_client-00000004 joined 'simple_bridge' basic-bridge <939c157d-45a0-40ba-9ba9-e2c3b93e6f8a>

<— Received SIP request (415 bytes) from WSS:172.16..:49638 —>
ACK sip:172.16..:5060 SIP/2.0
Via: SIP/2.0/WSS fjoqd5gjb1p6.invalid;branch=z9hG4bK4796425
Max-Forwards: 69
To: sip:another_account@172.16.*.*;tag=dcc20b1a-9d2d-40cb-9b2a-a228bbe05526
From: sip:webrtc_client@172.16.*.*;tag=r973a39flu
Call-ID: cgjj64hg09hvo64q00r0
CSeq: 9821 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: outbound
User-Agent: JsSIP 3.1.1
Content-Length: 0

<— Received SIP response (1634 bytes) from TCP:212.95.45.179:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP 36.7..:5060;received=36.7..;rport=38534;branch=z9hG4bKPj6cfd673b-6745-44b1-982e-97c8efcb37d8;alias
Record-Route: sip:212.95.45.179;transport=tcp;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Record-Route: sip:212.95.45.179;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Record-Route: sip:174.142.205.46;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.7e99d37
Record-Route: sip:212.95.45.179;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Record-Route: sip:212.95.45.179;transport=tcp;r2=on;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Require: timer
Contact: sip:another_account@36.7.:27555*.*;transport=TCP
To: sip:another_account@sip2sip.info;tag=10c0877a
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27155 INVITE
Session-Expires: 1800;refresher=uac
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.6 v2.10.20.5
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 343

v=0
o=Z 0 2756944404 IN IP4 172.16.9.52
s=Z
c=IN IP4 67.205.116.200
t=0 0
m=audio 52800 RTP/AVP 0 106 9 8 3 101 98
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=sendrecv
a=rtcp-mux

<— Transmitting SIP request (905 bytes) to TCP:212.95.45.179:5060 —>
ACK sip:another_account@36.7..:27555;transport=TCP SIP/2.0
Via: SIP/2.0/TCP 36.7..:5060;rport;branch=z9hG4bKPj732791c3-a31d-4b00-aac1-d32e20ebc72e;alias
From: sip:sip2sip_account@sip2sip.info;tag=add5ef57-107a-40ee-ac41-c776e1de09c6
To: sip:another_account@sip2sip.info;tag=10c0877a
Call-ID: cef2e79c-2334-416b-9e2a-16b73b80b4cf
CSeq: 27155 ACK
Route: sip:212.95.45.179;transport=tcp;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Route: sip:212.95.45.179;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.56b32013
Route: sip:174.142.205.46;lr;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.7e99d37
Route: sip:212.95.45.179;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Route: sip:212.95.45.179;transport=tcp;lr;r2=on;ftag=add5ef57-107a-40ee-ac41-c776e1de09c6;did=e.66b32013
Max-Forwards: 70
User-Agent: Asterisk PBX 22.1.1
Content-Length: 0

<— Received SIP request (413 bytes) from WSS:172.16..:49638 —>
BYE sip:172.16..:5060 SIP/2.0
Via: SIP/2.0/WSS fjoqd5gjb1p6.invalid;branch=z9hG4bK85992
Max-Forwards: 69
To: sip:another_account@172.16.*.*;tag=dcc20b1a-9d2d-40cb-9b2a-a228bbe05526
From: sip:webrtc_client@172.16.*.*;tag=r973a39flu
Call-ID: cgjj64hg09hvo64q00r0
CSeq: 9822 BYE
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: outbound
User-Agent: JsSIP 3.1.1
Content-Length: 0

I mean

doesn’t match

This is a broken NAT configuration at the remote side, which means that, for media to work, both Asterisk has to be configured for symmetric_rtp, and the they have to send media to Asterisk first, so that Asterisk can learn their public media address.

Thanks for your clarification. I checked the two IP addresses: 212.95.45.179 and 67.205.116.200. Neither of them belongs to my part. I think they are the servers from sip2sip or Zoiper.

I wonder what should be the IP in “c=IN IP4 67.205.116.200”, my external IP or the IP of the other side?

Do you mean the problem is from the other side (sip2sip)? My intended workflow is: dial a number from the website (webrtc_account) => use the registered sip2sip account (sip2sip_account) to make the call => talk with another sip2sip account (another_account).

I solved the problem. I replaced Zoiper with Linephone and the RTP is fine now. Very strange!

In that particular one, the external IP of the other side, as it is the SDP coming from them.

Got it. So the problem is indeed caused by the server on the Zoiper side, right? Anyway, thank you for your kind help, David!