SIP Video Call Support
SIP Video Call Support
Asterisk can relay video streams between endpoints. Video support requires enabling the right codecs on each endpointIn PJSIP configuration, the SIP entity Asterisk communicates with: a phone, trunk, or other user agent. Defined by an endpoint section in pjsip.conf. and ensuring both sides negotiate a common video codecA coder-decoder that compresses audio for transmission, such as ulaw, alaw, GSM, or Opus. Endpoints negotiate which codec a call uses.. Asterisk acts as a media relay (pass-through) for video, it does not transcode video.
PJSIP Endpoint Template (pjsip.conf)
; Base template for video-capable endpoints
[endpoint-video](!)
type = endpoint
transport = transport-udp
allow = !all,ulaw,alaw,opus,h264,vp8
max_video_streams = 1
Video Endpoint Examples (pjsip.conf)
; Hardware SIP phone with H.264 support
[1001](endpoint-internal,endpoint-video)
auth = 1001-auth
aors = 1001
callerid = Alice <1001>
; Softphone with multiple video codecs
[1002](endpoint-internal,endpoint-video)
auth = 1002-auth
aors = 1002
callerid = Bob <1002>
allow = !all,ulaw,opus,vp9,vp8,h264
WebRTC Video Endpoint (pjsip.conf)
[2001](endpoint-internal)
transport = transport-wss
auth = 2001-auth
aors = 2001
allow = !all,opus,vp9,vp8,h264
dtls_auto_generate_cert = yes
webrtc = yes
max_video_streams = 1
Video Codec Comparison
| Codec | Typical Use | Notes |
|---|---|---|
| H.264 | Hardware SIPSession Initiation Protocol, the standard signaling protocol used to set up, manage, and tear down VoIP calls between Asterisk and phones or carriers. phones, most softphones | Most widely supported; requires codec_h264 module (pass-through only) |
| VP8 | WebRTC browsers | Open/royalty-free; supported by all modern browsers |
| VP9 | WebRTC browsers | Better compression than VP8; not all endpoints support it |
| H.263 / H.263+ | Legacy video phones | Older codec; low resolution; avoid if possible |
Dialplan for Video Calls
[internal]
; Video calls work with standard Dial() -- no special dialplan needed.
; Both endpoints must share at least one video codec.
exten => _1XXX,1,Dial(PJSIP/${EXTEN},30)
same => n,Hangup()
Verify Video Codec Support
*CLI> core show codecs video
Codec Frames/Pkt Bytes/Frame Codec
h261 (20) - H.261 video
h263 (20) - H.263 video
h263p (20) - H.263+ video
h264 (20) - H.264 video
vp8 (20) - VP8 video
vp9 (20) - VP9 video
*CLI> pjsip show endpoint 1001
...
allow: (ulaw|alaw|opus|h264|vp8)
...
How it works
- Pass-through only: Asterisk does not transcode video. It relays video packets between endpoints as-is. Both sides must negotiate a common video codec during the SDP offer/answer exchange, or the video stream will not be established (audio still works).
allowcodec list: Video codecs are added to the sameallowline as audio codecs. Asterisk uses the order to set codec preference during negotiation. List preferred codecs first.max_video_streams: Controls how many simultaneous video streams an endpoint can have. Set to1for standard point-to-point video calls. Set higher for multiparty video conferencing via ConfBridgeThe Asterisk conference bridge application for multi-party audio conferences, configured with user, bridge, and menu profiles in confbridge.conf..- WebRTC video: The
webrtc = yesshorthand enables DTLS-SRTP, ICE, AVPF, and RTCP multiplexing. VP8 and VP9 are the standard video codecs for browser-based WebRTC clients. H.264 is also supported by most browsers. - Codec negotiation: If endpoint A offers
h264,vp8and endpoint B supports onlyvp8, the call will use VP8 for video. If there is no overlap, the video portion of the call is dropped but audio proceeds normally.
Tips
- Video calls consume significantly more bandwidth than audio-only calls. Expect 500 kbps to 2+ Mbps per video stream depending on resolution and codec.
- Test video between two softphones first. Linphone and MicroSIP both support H.264 and are free.
- For ConfBridge video conferences, set
video_mode = follow_talkerin the bridge profile to automatically switch the video feed to the active speaker. - Some SIP phones only work with one video codec enabled. If video fails, try restricting to a single video codec on that endpoint.
- The
codec_h264module provides H.264 pass-through. It does not require a license since Asterisk is not encoding or decoding the video. - Use
rtp set debug onto verify that video RTPReal-time Transport Protocol. Carries the actual audio (media) of a VoIP call after SIP signaling has set it up. packets are flowing between endpoints during a call.
User Notes
Know a tip or gotcha for this topic? Share it below and help others.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.