Video doorbell (H264) to mobile app - call connects but no video, only when doorbell initiates

Hello Asterisk Community,

I’m experiencing an issue with video calls between a SIP doorbell device and mobile apps through Asterisk 20.5.2. The strange part is that video works perfectly when the mobile app calls the doorbell, but fails when the doorbell calls the mobile app.

Environment:

- Asterisk 20.5.2 on Linux
- Doorbell: DnakeVoip v2.0 (local network, UDP, supports H264)
- Mobile apps: Using TLS/SRTP over public internet with NAT
- PBX has public IP configured

Problem Description:

  1. Mobile app (ext 100) → Doorbell (ext 165): :white_check_mark: Audio + Video works perfectly (99% of the time after enabling ICE/STUN)
  2. Doorbell (ext 165) → Extension 605 → Mobile app (ext 100): :cross_mark: Audio works, but NO video

Important call flow detail:
The doorbell doesn’t call extension 100 directly. Instead:

  • Doorbell dials extension 605 (ring group)
  • Extension 605 executes several actions including dialing Local/mobilephones@default
  • The mobilephones extension waits 7 seconds for push notifications to wake up mobile apps
  • After the wait, it dials all registered contacts for extension 100
  • This indirect call path through Local channels is where video fails

When examining the logs, I notice:

  • Different call flows use different ICE/STUN behavior
  • Working calls show proper ICE negotiation
  • Failed calls show “ICE no RTCP candidates; skipping checklist”
  • The Local channel bridge might be affecting media negotiation
  • RTP packets are flowing in both directions

Working: Mobile App (100) ----INVITE----> Doorbell (165) [Direct SIP call with proper ICE/STUN]

Failing: Doorbell (165) ----INVITE----> Extension 605 | v Dial(…&Local/mobilephones@default) | v Wait(7) for push notifications | v Dial(${PJSIP_DIAL_CONTACTS(100)}) [ICE negotiation fails here]

Relevant Configurations:

Relevant extension 605 configuration:

; Doorbell ring group that fails video
exten => 605,1,NoOp(EXECUTING 605 call)
same => n,System(/usr/some_one_at_door.sh&)
same => n,Dial(&Local/mobilephones@default) ; there are some other sip extension being called that are in local n/w and they work ok 
same => n,Hangup()

; Mobile phones handler with push notification wait
exten => mobilephones,1,Ringing()       
same => n,Wait(7)                       ; Wait for devices to register via push
same => n,NoOp(First attempt to dial)   
same => n,Dial(${PJSIP_DIAL_CONTACTS(100)})
same => n,Hangup()


**/etc/asterisk/pjsip_wizard.conf** (excerpt):
```ini
[default-template]
type = wizard
accepts_auth = yes
transport = transport-udp
aor/qualify_frequency = 90
endpoint/disallow = all
endpoint/allow = ulaw,alaw,gsm,g726,h264,mpeg4,vp8
endpoint/direct_media = yes

[nat-template](default-template)
transport = transport-tls
endpoint/direct_media = no
endpoint/rtp_symmetric = yes
endpoint/ice_support = yes

; Mobile endpoint
[100](nat-template)
inbound_auth/username = 100
inbound_auth/password = xxxxx
aor/max_contacts = 10

; Doorbell endpoint
[165](default-template)
inbound_auth/username = 165
inbound_auth/password = xxxxx
endpoint/callerid = 165 <DOORBELL>

/etc/asterisk/pjsip.conf (excerpt):

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5060

[transport-tls]
type = transport
protocol = tls
bind = 0.0.0.0:5061
cert_file = /etc/asterisk/keys/asterisk.crt
local_net = 192.168.1.0/24
external_media_address = X.X.X.X
external_signaling_address = X.X.X.X

/etc/asterisk/rtp.conf:

[general]
rtpstart=30000
rtpend=30048
stunaddr=stun.l.google.com:19302
icesupport=yes
strictrtp=yes

Log excerpts showing the issue:

Working call (mobile → doorbell):

-- PJSIP/100-0000003b is making progress passing it to PJSIP/165-0000003c
> 0xb4556770 -- Strict RTP learning after remote address set to: X.X.X.X:44930
> 0xb678c060 -- Strict RTP learning after remote address set to: X.X.X.X:41694
-- PJSIP/165-0000003c answered PJSIP/100-0000003b
[ICE negotiation successful]

Failed call (doorbell → mobile):

-- PJSIP/100-00000014 is ringing
> 0xb6656340 -- Strict RTP learning after remote address set to: X.X.X.X:38581
[WARNING] res_rtp_asterisk.c:1186 ast_rtp_ice_start: ICE no RTCP candidates; skipping checklist
> 0xb65f93e0 -- Strict RTP learning after remote address set to: X.X.X.X:48613
[No ICE negotiation occurs]

RTP debug shows packets flowing:

Got  RTP packet from    192.168.1.165:6200 (type 102, seq 000510, ts 910080, len 001300)
Sent RTP packet to      192.168.1.169:42748 (type 99, seq 012481, ts 910080, len 001300)

What I’ve tried:

  1. Disabled ICE on doorbell endpoint
  2. Set direct_media = no
  3. Added rtp_symmetric = yes
  4. Configured STUN servers

Questions & Observations :

1.After enabling ICE/STUN on endpoint 100 and in rtp.conf, mobile→doorbell calls work reliably (99%)
2.Why does ICE/STUN behavior differ based on call direction?
3. Is there a way to force consistent media negotiation?
4. Could the H264→VP8 transcoding be related to the video issue?
5. The wait time for push notifications might affect ICE negotiation
6. Could the Local channel used in the ring group be affecting media negotiation?

I can provide full debug logs and packet captures if needed. Any insights would be greatly appreciated!

Thank you!

logs.txt (459.0 KB)

Have you read the many postings on video door phone issues? There is one that is active, today.

You have an extremely limited RTP port range. If you have both video and audio on every leg, you are limited to about a maximum of six current and recently completed calls. I’m not certain, but you may also get an excessive number failing because your port range doesn’t end on an odd number. You will be contending with other services for the available range, so sometimes the full range will not be available.

Thanks for the heads up about the RTP port range.
That limited range (30000-30048) was just for debugging. Originally had 30000-31000 and same issue. Currently testing with single calls only, no real traffic.

I’m not a NAT/SIP expert. Been struggling with this for 2+ weeks, tried many solutions including various ICE/STUN configs, codec settings, and AI recommendations - nothing worked.

That’s precisely why I posted the detailed logs and configurations - I need expert eyes like yours to spot what I’m missing or mis configuring

It seems your symptoms are opposite of mine. In my case calls from doorbell to mobile app works with video. But calls from mobile app to doorbell are audio only.

I wonder if both of us are getting hit with Asterisk interpreting the dorbell marking video as ‘sendonly’ as a hold for the video channel? I suspect that is the issue I am facing, but still trying to figure out how to confirm it.

@josh4trunks
Can you share your pjsip and rtp conf files or some chunks from that ?

I think my configuration wont help your issue, but here’s what I have for pjsip.conf. Mind you my current setup now has a SIP proxy (Kamailio) on my firewall (OPNsense). You may need to have some changes related to NAT.

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5060

[endpoint-softphone](!)
type = endpoint
;force_rport = yes
;rtp_symmetric = yes
direct_media = yes
media_encryption = no
allow = ulaw, alaw, opus, h264, h265, vp8
dtmf_mode = info
message_context = message
outbound_proxy = sip:10.0.1.1:5060\;lr

[auth-userpass](!)
type = auth
auth_type = userpass

[aor-single-reg](!)
type = aor
max_contacts = 1
remove_unavailable = true
remove_existing = true

;;;;

[USER](endpoint-softphone)
callerid = "FIRST LAST" <USER>
auth = USER
aors = USER

[USER](auth-userpass)
username = USER
password = USER_PASSWORD

[USER](aor-single-reg)

;;;;

[doorbell]
type = endpoint
direct_media = no
media_encryption = no
allow = ulaw, alaw, h264
dtmf_mode = info
callerid = "Doorbell" <doorbell>
identify_by = ip
aors = doorbell

[doorbell]
type = identify
endpoint = doorbell
match = 192.168.10.100

[doorbell]
type = aor
contact = sip:doorbell@192.168.10.100:5060

I am using stock rtp.conf (same as on github).

You havent configured anything regarding NAT. could that be the issue?

In my case no, it has nothing to do with NAT. Even with video-doorbell, Asterisk, and SIP client on the same LAN, all configured with internal IPs, I experience the issue.

I’m going to try removing the below line, recompiling Asterisk and see if I still lose video.

Modern versions do include an endpoint option to disable such behavior[1].

[1] res_pjsip - Asterisk Documentation

@jcolp can you please have a look at my issue explained in the first post?

If I have anything to add to posts or wish to participate, then I will. I don’t have anything else to add to this.

Are you referring to suppress_moh_on_sendonly? I don’t think that actually stops the hold of the video channel, it just stops the MoH (which I believe is irrelevant for video?). I tried in my configuration and it didn’t change anything.

Actually, I forgot that code isn’t executed at all for video streams.

Are you referring to the suppress_moh_on_sendonly code, or the specific line I quoted?

I wonder if a=sendonly causing a hold is relevant for video streams at all? Especially if it is part of multiple streams. My understanding is this logic is part of SIP specification that is relevant to audio streams. But maybe if this is a common problem for video doorbells, having it configurable would make sense. It makes sense for these cameras to send ‘sendonly’ because they literally do not have a screen to receive and play video.

It doesn’t cause a hold within the Asterisk core or itself. Within SDP it sets the state of the media stream, and you can’t directly override that within the SDP specification. You would have to re-INVITE and it probably wouldn’t allow it to change.

I can’t speak for anything else. This is not usage I’ve explored, experimented with, etc, and is not something I’m working on.

Sounds good. I’ll try to recompile later today and see if this fixes video-calling from a SIP phone to the doorbell.

Your change won’t, because that logic is only invoked if the media stream is audio - and the first audio one at that. Otherwise none of that is invoked, no remotely_held changes, nada.

Ok, I’ll just confirm then. Guess I still have to figure out the cause of my RTP not flowing then, lol.

As for @dmsherazi I realize you do have RTP video packets flowing, so yours is probably a different issue then mine.