PJSIP and UDP and cellphone networks

Having difficulties getting UDP to work over cell networks

So I have asterisk 16 installed using PJSIP but it doesnt work over cell networks, it works over regular networks so it must be something that the cellnetwork is doing to the packet? but; i’m not sure.
Cell network is FIDO in Canada if anyone knows anything about it.

Basicly can’t send register packets over UDP; but works over TCP. If I can get registry, I can’t get voice because of course that uses UDP. This is only over the cell network.

pjsip_chan logger on.

<— Received SIP request (635 bytes) from UDP:FIDO.IP:20372 —>
REGISTER sip:ASTERISKEXTHOSTNAME SIP/2.0
Via: SIP/2.0/UDP NoClueWhatIpThisIs-fidogateway?-25.109.120.46:5080;branch=z9hG4bK.OmsF6NghP;rport
From: sip:username@ASTERISKEXTHOSTNAME;tag=lcHCQ7S7U
To: sip:username@ASTERISKEXTHOSTNAME
CSeq: 20 REGISTER
Call-ID: bcjR7YcPFZ
Max-Forwards: 70u
Supported: replaces, outbound, gruu
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact: sip:username@NoClueWhatIpThisIs-fidogateway?-25.109.120.46:5080;transport=udp;+sip.instance=“urn:uuid:883f5ef2-690e-0058-9ebe-c04afeb8fa0b”;+org.linphone.specs=“groupchat,lime”
Expires: 3600
User-Agent: LinphoneAndroid/4.2 (Pixel 2) LinphoneSDK/4.3 (tags/4.3^0)

<— Transmitting SIP response (475 bytes) to UDP:FIDO.IP:20372 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP NoClueWhatIpThisIs-fidogateway?-25.109.120.46:5080;rport=20372;received=FIDO.IP;branch=z9hG4bK.OmsF6NghP
Call-ID: bcjR7YcPFZ
From: sip:username@ASTERISKEXTHOSTNAME;tag=lcHCQ7S7U
To: sip:username@ASTERISKEXTHOSTNAME;tag=z9hG4bK.OmsF6NghP
CSeq: 20 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1601559616/a7bac9b2dd972764d199712a3be03c03”,opaque=“1fc8f0854bd2f521”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 16.3.0
Content-Length: 0

This above just repeats… when on WIFI only - it does show

<— Received SIP request (918 bytes) from UDP:phoneIP:5080 —>
REGISTER

and continues to register…

What client are you using? What is the PJSIP configuration?

Wow that was quick. I was trying to post the logger stuff but 2 link limits so I was modifying it.

I’ve tried a bunch with the same result but using linphone right now on android.
User-Agent: LinphoneAndroid/4.2 (Pixel 2) LinphoneSDK/4.3 (tags/4.3^0)

You should be able to post things now.

thanks!. posted. above.

pjsip_wizard:
username
endpoint/context = *****
inbound_auth/password=*****
inbound_auth/username=****
endpoint/force_rport = yes
endpoint/rewrite_contact = yes
endpoint/rtp_symmetric=yes
endpoint/direct_media = no
aor/minimum_expiration = 600

user_defaults
type=wizard
;transport = ipv4
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
endpoint/allow_subscribe = yes
endpoint/allow = !all,ulaw,gsm,g722
endpoint/direct_media = no
endpoint/force_rport = yes
endpoint/disable_direct_media_on_nat = yes
endpoint/direct_media_method = invite
endpoint/ice_support = no
endpoint/moh_suggest = default
endpoint/send_rpid = yes
endpoint/rewrite_contact = yes
endpoint/send_pai = yes
endpoint/allow_transfer = yes
endpoint/trust_id_inbound = yes
endpoint/trust_id_outbound = yes
endpoint/device_state_busy_at = 1
endpoint/send_diversion = yes
endpoint/rtp_symmetric=yes
aor/qualify_frequency = 300
aor/authenticate_qualify = no
aor/max_contacts = 3
aor/remove_existing = yes
aor/minimum_expiration = 3600
aor/support_path = yes
;phoneprov/PROFILE = profile1
endpoint/permit=0.0.0.0/0

[system-udp]
type=transport
protocol=udp
bind=0.0.0.0:5080
external_media_address=EXTERNALASTERISKHOSTNAME.COM
external_signaling_address=EXTERNALASTERISKHOSTNAME.COM
local_net=192.168.2.0/255.255.255.0

[system-tcp]
type=transport
protocol=tcp
bind=0.0.0.0:5085
external_media_address=EXTERNALASTERISKHOSTNAME.COM
external_signaling_address=EXTERNALASTERISKHOSTNAME.COM
local_net=192.168.2.0/255.255.255.0

If you are seeing a retransmission of the REGISTER with the same CSeq value that means our response never got to the endpoint, despite sending to the actual source IP address and port. They may be inspecting traffic or dropping it.

For a case with TCP you’d need to provide a full SIP trace so the SDP can be seen which dictates where media goes to as well as “rtp set debug on” which shows media being received/sent.

Yes. I’m seeing the same CSeq value over and over… of 20… which aligns with the client not seeing the response.

The odd thing is that an older server setup using Asterisk 13 with chan_sip works over UDP… so its something different happening in PJSIP ?

As for TCP, it registered but I thought audio still occurs through UDP which is why the media (audio both ways) is not there…

But here is the logger on and debug on with TCP:
OpenWrtCLI> pjsip set logger on
PJSIP Logging enabled
OpenWrt
CLI> rtp set debug on
RTP Debugging Enabled
<— Received SIP request (662 bytes) from TCP:CellphoneIP:31758 —>
REGISTER sip:EXTAsteriskHOSTNAME SIP/2.0
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;alias;branch=z9hG4bK.2sQc76vuz;rport
From: sip:username@EXTAsteriskHOSTNAME;tag=4kZTQKJRN
To: sip:username@EXTAsteriskHOSTNAME
CSeq: 20 REGISTER
Call-ID: X4nwgJptbR
Max-Forwards: 70
Supported: replaces, outbound, gruu
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact: sip:username@noClueWhatIp-FidoGateway?-25.108.253.33:47036;transport=tcp;+sip.instance=“urn:uuid:883f5ef2-690e-0058-9ebe-c04afeb8fa0b”;+org.linphone.specs=“groupchat,lime”
Expires: 3600
User-Agent: LinphoneAndroid/4.2 (Pixel 2) LinphoneSDK/4.3 (tags/4.3^0)
Content-Length: 0

<— Transmitting SIP response (482 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.2sQc76vuz;alias
Call-ID: X4nwgJptbR
From: sip:username@EXTAsteriskHOSTNAME;tag=4kZTQKJRN
To: sip:username@EXTAsteriskHOSTNAME;tag=z9hG4bK.2sQc76vuz
CSeq: 20 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1601564742/29b63d6aeb743b1b277cc67b329dd791”,opaque=“3190c473302945a7”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 16.3.0
Content-Length: 0

<— Received SIP request (944 bytes) from TCP:CellphoneIP:31758 —>
REGISTER sip:EXTAsteriskHOSTNAME SIP/2.0
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;alias;branch=z9hG4bK.Ai2hXynL6;rport
From: sip:username@EXTAsteriskHOSTNAME;tag=4kZTQKJRN
To: sip:username@EXTAsteriskHOSTNAME
CSeq: 21 REGISTER
Call-ID: X4nwgJptbR
Max-Forwards: 70
Supported: replaces, outbound, gruu
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact: sip:username@CellphoneIP:31758;transport=tcp;+sip.instance=“urn:uuid:883f5ef2-690e-0058-9ebe-c04afeb8fa0b”;+org.linphone.specs=“groupchat,lime”
Expires: 3600
User-Agent: LinphoneAndroid/4.2 (Pixel 2) LinphoneSDK/4.3 (tags/4.3^0)
Content-Length: 0
Authorization: Digest realm=“asterisk”, nonce=“1601564742/29b63d6aeb743b1b277cc67b329dd791”, algorithm=md5, opaque=“3190c473302945a7”, username=“username”, uri=“sip:EXTAsteriskHOSTNAME”, response=“c126d98e04672c66fc7966527cd67b88”, cnonce=“VNzvccW~xRqaMrxx”, nc=00000001, qop – Added contact ‘sip:username@CellphoneIP:31758;transport=TCP’ to AOR ‘username’ with expiration of 3600 seconds
<— Transmitting SIP response (525 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.Ai2hXynL6;alias
Call-ID: X4nwgJptbR
From: sip:username@EXTAsteriskHOSTNAME;tag=4kZTQKJRN
To: sip:username@EXTAsteriskHOSTNAME;tag=z9hG4bK.Ai2hXynL6
CSeq: 21 REGISTER
Date: Thu, 01 Oct 2020 15:05:42 GMT
Contact: sip:username@192.168.2.200:5080;expires=3218
Contact: sip:username@CellphoneIP:31758;transport=TCP;expires=3599
Expires: 3600
Supported: path
Server: Asterisk PBX 16.3.0
Content-Length: 0

<— Received SIP request (1203 bytes) from TCP:CellphoneIP:31758 —>
INVITE sip:600@EXTAsteriskHOSTNAME SIP/2.0
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;branch=z9hG4bK.jkMYjNlQF;rport
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME
CSeq: 20 INVITE
Call-ID: ddm2xlENeV
Max-Forwards: 70
Supported: replaces, outbound, gruu
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 523
Contact: sip:username@CellphoneIP:31758;transport=tcp;expires=3599;+sip.instance=“urn:uuid:883f5ef2-690e-0058-9ebe-c04afeb8fa0b”;+org.linphone.specs=“groupchat,lime”
User-Agent: LinphoneAndroid/4.2 (Pixel 2) LinphoneSDK/4.3 (tags/4.3^0)

v=0
o=username 259 866 IN IP4 noClueWhatIp-FidoGateway?-25.108.253.33
s=Talk
c=IN IP4 noClueWhatIp-FidoGateway?-25.108.253.33
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 96 97 98 0 8 18 101 99 100
a=rtpmap:96 opus/48000/2
a=fmtp:96 us<— Transmitting SIP response (468 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.jkMYjNlQF
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=z9hG4bK.jkMYjNlQF
CSeq: 20 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1601564748/f5520fbdbb8be6e43923f79d49c77d12”,opaque=“0303c018775c71de”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 16.3.0
Content-Length: 0

<— Received SIP request (465 bytes) from TCP:CellphoneIP:31758 —>
ACK sip:600@EXTAsteriskHOSTNAME SIP/2.0
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;branch=z9hG4bK.jkMYjNlQF;rport
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=z9hG4bK.jkMYjNlQF
Contact: sip:username@CellphoneIP:31758;transport=tcp;expires=3599;+sip.instance=“urn:uuid:883f5ef2-690e-0058-9ebe-c04afeb8fa0b”;+org.linphone.specs=“groupchat,lime”
Max-Forwards: 70
CSeq: 20 ACK
Content-Length: 0

<— Received SIP request (1490 bytes) from TCP:CellphoneIP:31758 —>
INVITE sip:600@EXTAsteriskHOSTNAME SIP/2.0
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;branch=z9hG4bK.thP-b4P-4;rport
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME
CSeq: 21 INVITE
Call-ID: ddm2xlENeV
Max-Forwards: 70
Supported: replaces, outbound, gruu
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 523
Contact: sip:username@CellphoneIP:31758;transport=tcp;expires=3599;+sip.instance=“urn:uuid:883f5ef2-690e-0058-9ebe-c04afeb8fa0b”;+org.linphone.specs=“groupchat,lime”
User-Agent: LinphoneAndroid/4.2 (Pixel 2) LinphoneSDK/4.3 (tags/4.3^0)
Authorization: Digest realm=“asterisk”, nonce=“1601564748/f5520fbdbb8be6e43923f79d49c77d12”, algorithm=md5, opaque=“0303c018775c71de”, username=“username”, uri=“sip:600@EXTAsteriskHOSTNAME”, response=“c36a0f878f0bb8894b5d7d3e940d5174”, cnonce="C3eEY5zXvrlPe == Setting global variable ‘SIPDOMAIN’ to ‘EXTAsteriskHOSTNAME’
<— Transmitting SIP response (294 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 100 Trying
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.thP-b4P-4
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Content-Length: 0

-- Executing [600@context-1282:1] Set("PJSIP/username-00000002", "userLine="*****"") in new stack
-- Executing [600@context-1282:2] Goto("PJSIP/username-00000002", "context-freePhoneLine,600,1") in new stack
-- Goto (context-freePhoneLine,600,1)
-- Executing [600@context-freePhoneLine:1] Answer("PJSIP/username-00000002", "") in new stack

<— Transmitting SIP response (792 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.thP-b4P-4
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=6cbbb678-8993-4f0a-a5da-1f9d1942d6ce
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Contact: sip:192.168.2.1:5085;transport=TCP
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 221

v=0
o=- 259 868 IN IP4 192.168.2.1
s=Asterisk
c=IN IP4 192.168.2.1
t=0 0
m=audio 12038 RTP/AVP 0 100
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

-- Executing [600@context-freePhoneLine:2] Echo("PJSIP/username-00000002", "") in new stack

<— Transmitting SIP response (792 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.thP-b4P-4
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=6cbbb678-8993-4f0a-a5da-1f9d1942d6ce
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Contact: sip:192.168.2.1:5085;transport=TCP
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 221

v=0
o=- 259 868 IN IP4 192.168.2.1
s=Asterisk
c=IN IP4 192.168.2.1
t=0 0
m=audio 12038 RTP/AVP 0 100
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Transmitting SIP response (792 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.thP-b4P-4
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=6cbbb678-8993-4f0a-a5da-1f9d1942d6ce
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Contact: sip:192.168.2.1:5085;transport=TCP
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 221

v=0
o=- 259 868 IN IP4 192.168.2.1
s=Asterisk
c=IN IP4 192.168.2.1
t=0 0
m=audio 12038 RTP/AVP 0 100
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Transmitting SIP response (792 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.thP-b4P-4
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=6cbbb678-8993-4f0a-a5da-1f9d1942d6ce
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Contact: sip:192.168.2.1:5085;transport=TCP
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 221

v=0
o=- 259 868 IN IP4 192.168.2.1
s=Asterisk
c=IN IP4 192.168.2.1
t=0 0
m=audio 12038 RTP/AVP 0 100
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Transmitting SIP response (792 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.thP-b4P-4
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=6cbbb678-8993-4f0a-a5da-1f9d1942d6ce
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Contact: sip:192.168.2.1:5085;transport=TCP
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 221

v=0
o=- 259 868 IN IP4 192.168.2.1
s=Asterisk
c=IN IP4 192.168.2.1
t=0 0
m=audio 12038 RTP/AVP 0 100
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

OpenWrt*CLI> rtp set debug off
RTP Debugging Disabled
<— Transmitting SIP response (792 bytes) to TCP:CellphoneIP:31758 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.thP-b4P-4
Call-ID: ddm2xlENeV
From: sip:username@EXTAsteriskHOSTNAME;tag=1XuO7-IxJ
To: sip:600@EXTAsteriskHOSTNAME;tag=6cbbb678-8993-4f0a-a5da-1f9d1942d6ce
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Contact: sip:192.168.2.1:5085;transport=TCP
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 221

v=0
o=- 259 868 IN IP4 192.168.2.1
s=Asterisk
c=IN IP4 192.168.2.1
t=0 0
m=audio 12038 RTP/AVP 0 100
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

OpenWrtCLI> pjsip set logger off
PJSIP Logging disabled
OpenWrt
CLI>

It doesn’t look like your configuration for the TCP transport is actually applying the external IP address and port, resulting in media not flowing and the ACK to the outgoing 200 OK not being received. Does it show in the CLI using the “pjsip show transport” CLI command?

As for chan_sip working with UDP, SIP is SIP so it should work the same in PJSIP. You’d need to compare the difference in actual traffic to see.

Yah; i tried to look at the differences with the loggers on and the only difference is that i see the ordering of the via is different:
Via: SIP/2.0/TCP noClueWhatIp-FidoGateway?-25.108.253.33:47036;rport=31758;received=CellphoneIP;branch=z9hG4bK.2sQc76vuz;alias

I think for the asterisk 13 it was branch before received, but then seemed to continue. Maybe the cell network is looking for that as I dont know how the routes occur and what the VIA tag ultimately do? Again, also the mystery 25.108.253.33 IP that gets inserted by the network?

Here is the dump for show transports. I have 2, tcp and udp and both are the same except the protocol tag of course.

Transport: <TransportId…> <BindAddress…>

Transport: system-tcp tcp 0 0 0.0.0.0:5085

ParameterName : ParameterValue

allow_reload : false
async_operations : 1
bind : 0.0.0.0:5085
ca_list_file :
ca_list_path :
cert_file :
cipher :
cos : 0
domain :
external_media_address : AsteriskExternalHostname.com
external_signaling_address : AsteriskExternalHostname.com
external_signaling_port : 0
local_net : 192.168.2.0/255.255.255.0
method : unspecified
password :
priv_key_file :
protocol : tcp
require_client_cert : No
symmetric_transport : false
tos : 0
verify_client : No
verify_server : No
websocket_write_timeout : 100

tried another incoming test call:

I get:
– Added contact ‘sip:username@CellphoneIP:10541;transport=TCP’ to AOR ‘username’ with expiration of 3600 seconds
== Setting global variable ‘SIPDOMAIN’ to ‘swansony.mooo.com
– Executing [600@context-1282:1] Set(“PJSIP/username-00000000”, “userLine=”*********"") in new stack
– Executing [600@context-1282:2] Goto(“PJSIP/username-00000000”, “context-freePhoneLine,600,1”) in new stack
– Goto (context-freePhoneLine,600,1)
– Executing [600@context-freePhoneLine:1] Answer(“PJSIP/username-00000000”, “”) in new stack
> 0x9f53e0 – Strict RTP learning after remote address set to: 25.108.253.33:7078
– Executing [600@context-freePhoneLine:2] Echo(“PJSIP/username-00000000”, “”) in new stack
== Spawn extension (context-freePhoneLine, 600, 2) exited non-zero on ‘PJSIP/username-00000000’

Sets: 25.108.253.33:7078 for the RTP learning; but that is not the CellphoneIP. Instead thats the IP that gets randomly inserted into the VIA tag. Is there a way to force this to CellphoneIP ; or better yet - detect the correct CellphoneIP? The CellphoneIP correct shows in PJSIP show endpoints so it knows the correct one there…

That is the IP address in the SDP as provided by the endpoint. If rtp_symmetric is enabled and the configuration is correct for the transport, then Asterisk should latch on to the source. You are using an old version of Asterisk, and I believe there were issues resolved in the NAT code for placing the correct IP address and port in things.

Could be…

I’ve gotten one way audio now incoming. I added:
pjsip_wizard.conf
[ Username ]
endpoint/media_address=EXTERNALHOSTNAMEASTERISK.com
endpoint/bind_rtp_to_media_address=yes

Weird that this doesnt get picked out of the transport…

outgoing still getting sent to 25.108.253.33 i think… but dont know how to change that.

Also not sure how to compile asterisk newer version for openwrt if that is in fact the issue here…

ok; copied my old chan_sip config into the new asterisk 16 server and same issue; no audio .

SO it looks like something asterisk 13 and asterisk 16 is different in handling audio …

as per above, I have gotten 1 way audio but not outgoing…

You can’t use “bind_rtp_to_media_address” with an external IP address, you can only bind addresses to the local system.

Does “EXTERNALHOSTNAMEASTERISK.com” on the system resolve to the external IP address?

yes. EXTERNALHOSTNAMEASTERISK.com does resolve to an external IP address that is the same IP of the router that hosts asterisk.

On the system itself?

And what is a SIP trace from chan_sip which is not working?

yes. the system is a router. it has
192.168.x.x local address as well as a
72.x.x.x address which is external.

the asteriskhostname resolves to the 72.x.x.x address…

chan_sip asterisk 16 - not working trace:
RTP Debugging Enabled

<— SIP read from TCP:72.CellphoneIP:13801 —>
INVITE sip:600@externalasteriskhostname:6060 SIP/2.0
Via: SIP/2.0/TCP 25.100.76.20:45131;branch=z9hG4bK.L4ZqMoekh;rport
From: sip:username@externalasteriskhostname;tag=5VdOXuRFg
To: sip:600@externalasteriskhostname
CSeq: 20 INVITE
Call-ID: Daj9toci05
Max-Forwards: 70
Supported: replaces, outbound, gruu
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 271
Contact: sip:username@72.CellphoneIP:13801;transport=tcp;expires=3600;+sip.instance=“urn:uuid:ae6f7fc2-668f-0005-8a7e-5c3d69d77a94
User-Agent: LinphoneAndroid/4.2 (Pixel 2) LinphoneSDK/4.3 (tags/4.3^0)

v=0
o=username 608 1019 IN IP4 25.100.76.20
s=Talk
c=IN IP4 25.100.76.20
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 0 101
a=rtpmap:101 telephone-event/8000
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr
<------------->
— (13 headers 10 lines) —
Sending to 72.CellphoneIP:13801 (NAT)
Sending to 72.CellphoneIP:13801 (NAT)
Using INVITE request as basis request - Daj9toci05
Found peer ‘username’ for ‘username’ from 72.CellphoneIP:13801
== Using SIP RTP CoS mark 5
== Using UDPTL CoS mark 5
Found RTP audio format 0
Found RTP audio format 101
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|h263|codec2|g723|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263p|h264|mpeg4|vp8|vp9|red|t140|t38|silk|silk|silk|silk), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
> 0xb000c0 – Strict RTP learning after remote address set to: 25.100.76.20:7078
Peer audio RTP is at port 25.100.76.20:7078
Looking for 600 in context-1282 (domain externalasteriskhostname)
sip_route_dump: route/path hop: sip:username@72.CellphoneIP:13801;transport=tcp

<— Transmitting (NAT) to 72.CellphoneIP:13801 —>
SIP/2.0 100 Trying
Via: SIP/2.0/TCP 25.100.76.20:45131;branch=z9hG4bK.L4ZqMoekh;received=72.CellphoneIP;rport=13801
From: sip:username@externalasteriskhostname;tag=5VdOXuRFg
To: sip:600@externalasteriskhostname
Call-ID: Daj9toci05
CSeq: 20 INVITE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:600@72.externalasteriskIP:5060;transport=tcp
Content-Length: 0

<------------>
– Executing [600@context-1282:1] Answer(“SIP/username-00000003”, “”) in new stack
Audio is at 16346
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Reliably Transmitting (NAT) to 72.CellphoneIP:13801 —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP 25.100.76.20:45131;branch=z9hG4bK.L4ZqMoekh;received=72.CellphoneIP;rport=13801
From: sip:username@externalasteriskhostname;tag=5VdOXuRFg
To: sip:600@externalasteriskhostname;tag=as4c16f951
Call-ID: Daj9toci05
CSeq: 20 INVITE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:600@72.externalasteriskIP:5060;transport=tcp
Content-Type: application/sdp
Content-Length: 268

v=0
o=root 312133104 312133104 IN IP4 72.externalasteriskIP
s=Asterisk PBX 16.3.0
c=IN IP4 72.externalasteriskIP
t=0 0
m=audio 16346 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=maxptime:150
a=sendrecv

<------------>
– Executing [600@context-1282:2] Echo(“SIP/username-00000003”, “”) in new stack
> 0xb000c0 – Strict RTP qualifying stream type: audio
> 0xb000c0 – Strict RTP switching source address to 72.CellphoneIP:13791
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000004, ts 1769047674, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000005, ts 1769047834, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000006, ts 1769047994, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000007, ts 1769048154, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000008, ts 1769048314, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000009, ts 1769048474, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000010, ts 1769048634, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000011, ts 1769048794, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000012, ts 1769048954, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000013, ts 1769049114, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000014, ts 1769049274, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000015, ts 1769049434, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000016, ts 1769049594, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000017, ts 1769049754, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000018, ts 1769049914, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000019, ts 1769050074, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000020, ts 1769050234, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000021, ts 1769050394, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000022, ts 1769050554, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000023, ts 1769050714, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000024, ts 1769050874, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000025, ts 1769051034, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000026, ts 1769051194, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000027, ts 1769051354, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000028, ts 1769051514, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000029, ts 1769051674, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000030, ts 1769051834, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000031, ts 1769051994, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000032, ts 1769052154, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000033, ts 1769052314, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000034, ts 1769052474, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000035, ts 1769052634, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000036, ts 1769052794, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000037, ts 1769052954, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000038, ts 1769053114, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000039, ts 1769053274, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000040, ts 1769053434, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000041, ts 1769053594, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000042, ts 1769053754, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000043, ts 1769053914, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000044, ts 1769054074, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000045, ts 1769054234, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000046, ts 1769054394, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000047, ts 1769054554, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000048, ts 1769054714, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000049, ts 1769054874, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000050, ts 1769055034, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000051, ts 1769055194, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000052, ts 1769055354, len 000160)
Got RTP packet from 72.CellphoneIP:13791 (type 00, seq 000053, ts 1769055514, len 000160)
Sent Comfort Noise RTP packet to 72.CellphoneIP:13791 (type 02, seq 004260, ts 000000, len 000001)

Media seems to be being received. I do not know why it is not being sent back.