No Early Video outside lan, video works during call

Hey, i have a verry basic setup using chan_sip, but still need to use it since we need dahua support

Anway, setting up a simple test case like below
When i start a call from 6000 to 6001 , everything works
6000 = client inside lan
6001 = linphone on android

port 5060 opened, also RTP port range

When calling to 6001 when 6001 is connected to local lan (wifi), all works, also early video before pickup
When 6001 is connected to a cellular network, i only see video AFTER i pickup, but not in early stage … what could be wrong? why is early video acting different when connected to cellular/mobile network?

thnx in advance

[general]
udpbindaddr=0.0.0.0:5060
bindaddr=0.0.0.0:5060
protocol=udp
local_net=192.168.0.0/24
srvlookup=yes
nat=force_rport,comedia
externhost=mydomain.com
externrefresh=30
allowguest=no

[sip-phone](!)
type=friend
host=dynamic
context=default
transport=udp
directmedia=no
dtmfmode=rfc2833
videosupport=yes
canreinvite=no
avpf=no
force_avp=no
icesupport=no
rtcp_mux=no
encryption=no
fromdomain=mydomain.com

[my-codecs](!)
disallow=all
allow=ulaw
allow=h264

[6000](sip-phone,my-codecs)
username=6000
secret=xxx
callerid=6000

[6001](sip-phone,my-codecs)
username=6001
secret=xxx
callerid=6001

And easy dialplan:

exten => 6001,1,NoOp() 
 same => n,Progress()
 same => n,Set(CALLERID(num)=Doorbell)
 same => n,Set(CALLERID(name)=Doorbell) 
 same => n,Dial(SIP/6001)

here are also logs
noearly.txt (16.6 KB)
early.txt (14.4 KB)

no one? I 'm using PJSIP now, but seems same issue

thnx!

Here are logs from pjsip, and config, my router external is doing port forwarding from 9051 to 5160
also tried 5160 to 5160 and changing below, also tried media_address as IP instead of DNS, no difference …
Played also with these settings below, no difference

rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
direct_media=no
[transport-udp]
type = transport
protocol = udp
bind=0.0.0.0:5160
local_net=192.168.0.0/24
local_net=10.8.0.0/24
local_net=172.30.32.0/24
external_media_address=domain.com
external_signaling_address=domain.com
external_signaling_port=9051


[6000]
type=endpoint
context=default
disallow=all
allow=ulaw
allow=h264
auth=auth6000
aors=6000
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
direct_media=no
max_audio_streams=10
max_video_streams=10
from_domain=domain.com
;media_address=domain.com

[auth6000]
type=auth
auth_type=userpass
password=XXXXX
username=6000
 
[6000]
type=aor
qualify_frequency=30
max_contacts=1
remove_existing=yes
remove_unavailable=yes

In logs, first working call, 6000 and 6002 ob both lan
second call, 6000 = local, 6002 on cellular, no early video here, only during call

earlypjsip.txt (15.4 KB)
noearlypjsip.txt (17.6 KB)
rtp.txt (400.0 KB)

Why is the media address for the external Linphone different from its signalling address?

Why is that also the case for the internal 6002?

Why did you shuffle both protocol logs.

Why did you also not merge the protocol and “RTP” logs?

1-2 ) All these below i tested , domain.com is the public IP of my asterisk server, ther are always the same configured, i also tested IP instead of hostname

external_media_address=domain.com
external_signaling_address=domain.com
;media_address=domain.com
  1. The Protocol log, the SIP losg you mean? those are captured with sngrep, and just exported the 2 sessions…

  2. thats why they are indeed in seperate files

Do you want me to turn on debug again for RTP and PJSIP and have all in 1 logfile?

The phone’s addresses, not Asterisk: signalling: xx.xx.82.189; media: 100.81.102.232

The B leg INVITE appears after the OK for the A leg’s BYE’s OK. That’s not because they happened in that order, which would have made early medial possible, but because the order is shuffled in the log. I think the BYE appears twice in one of them.

The expectation is that you will make the evidence easy for us to examine.

ah ok, hmm, not sure where that 100.81.102.232 is coming from … hmm

gonna make some new logs later

but, if need to put in the phone addess, how can i know that? since its on cellular, and its always different?

new logs

rtp2.txt (398.4 KB)

xx.xx.75.66 => 6002 IP = IP from my cellular provider (dynamic)
xx.xx.34.18:9051 => public IP asterisk server
xx.xx.102.232 => unknown to me ? ice/stun ? something maybe from linphone client?

so how need i define that those media_addresses

There’s no incoming video from the callee, so Asterisk cannot learn the correct video media address, based, on symmetric media, so has to rely on the SDP. As a result, video from the caller goes to xx.xx.102.232, and, and is, presumably, lost.

Audio probably works because the callee sends RTP first, allowing symmetric media to work.

Symmetric media is a workaround for endpoints behind NAT that do not properly understand they are behind NAT.

It is quite possible that the mobile network is assigning different addresses from its NAT pool to signalling and media, or even to media at different times.

NAT is a kludge.

SIP wasn’t designed for NAT.

Mobile phone networks weren’t designed to allow servers to be run on mobiles, and although people insist on calling them clients, SIP user agents are servers for incoming calls, and are server like, even for outgoing ones, as far as incoming media is concerned.

Once you add NAT and mobiles, you are relying heavily on workarounds getting things right.

You will either have to get the phone app to work out its own address correctly, or get it to send video itself, in order to prime the symmetric media operation. I don’t think either of those can be addressed from the Asterisk end.

hey @david551 , i need to figure out what this IP is : xx.xx.102.232

i now tried a different sofphone app, and early media now works with the same asterisk config, so maybe Linphone is using some service thats killing my early media

gonna make some new logs with the other softphone so i can compare

but anyway, it looks like the asterisk config is correct, just need to figure out the : xx.xx.102.232 and probably i need to configure it somewhere in asterisk when i use Linphone?

You can’t configure that in Asterisk. Asterisk takes that information from the SDP, from the far side, and, if you have rtp symmetric, will override with the source address of media coming to Asterisk on the correct Asterisk side port for that stream. Both of these use information provided by the remote side.

ah ok, well i know did the same test with acrobits sofphone, 6002 on cellular, and i see early video

xx.xx.34.18:9051 => asterisk
xx.xx.108.50 => 6002 on cellular

But again i also see here some unknown IP below? but everything works as expected… So i have no clue why Linphone is not working

Sent RTP packet to 100.76.221.230

rtpacrobits2.txt (594.1 KB)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.