Asterisk15 and video conferencing

Hi, I am following below link for testing Asterisk video conferencing,
http://blogs.asterisk.org/2017/09/20/asterisk-15-multi-stream-media-sfu/

I can register pjsip endpoint into cyber mega phone, but when click on call button nothing happens.
It stuck on line number 78 in cyber_mega_phone.js file
Call not coming into dial plan.

Anyone faced this issue, please help me on this.

Post the relevant configuration sections from your pjsip.conf, http.conf, extensions.conf files. Also make sure SIP logging is enabled in Asterisk for pjsip. Either by setting the following in your pjsip.conf file:

[global]
type=global
debug=yes

Or via the Asterisk CLI:

pjsip set logger on

Then post the SIP trace too.

1 Like

Hi,
Please find below details as you asked, I can connect pjsip endpoint to asterisk but when click on call button no log coming on asterisk cli

pjsip.conf

[global]
type=global
debug=yes

[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0

[100]
type=aor
max_contacts=1
remove_existing=yes

[100]
type=auth
auth_type=userpass
username=100
password=100

[100]
type=endpoint
aors=100
auth=100
use_avpf=yes
media_encryption=dtls
dtls_ca_file=/etc/asterisk/keys/ca.crt
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
media_use_received_transport=yes
rtcp_mux=yes
context=default
disallow=all
allow=opus
allow=ulaw

[101]
type=aor
max_contacts=1
remove_existing=yes

[101]
type=auth
auth_type=userpass
username=101
password=101

[101]
type=endpoint
aors=101
auth=101
use_avpf=yes
media_encryption=dtls
dtls_ca_file=/etc/asterisk/keys/ca.crt
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
media_use_received_transport=yes
rtcp_mux=yes
context=default
disallow=all
allow=opus
allow=ulaw


http.conf

[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/asterisk/keys/asterisk.pem


extensions.conf

[internal]
exten => echo,1,Answer()
same => n,StreamEcho(3)
same => n,Hangup()

exten => video-conference,1,Answer()
same => n,ConfBridge(guest)
same => n,Hangup()

exten => 100,1,Dial(PJSIP/100)
exten => 101,1,Dial(PJSIP/101)


pjsip endpoint connect disconnect logs:

asterisk15-VirtualBox*CLI>
<— Received SIP request (513 bytes) from WSS:192.168.0.46:53063 —>
REGISTER sip:192.168.0.187 SIP/2.0
Via: SIP/2.0/WSS 192.168.0.187;branch=z9hG4bK617849
Max-Forwards: 69
To: sip:100@192.168.0.187
From: sip:100@192.168.0.187;tag=nq5o807dne
Call-ID: 9d09al9nj4a7eimvhl6998
CSeq: 3 REGISTER
Contact: sip:100@192.168.0.187;+sip.ice;reg-id=1;+sip.instance=“urn:uuid:8727177f-9e92-4f1b-aad8-baa6373b9f03”;expires=0
Expires: 0
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.0.13
Content-Length: 0

<— Transmitting SIP response (455 bytes) to WSS:192.168.0.46:53063 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS 192.168.0.187;rport=53063;received=192.168.0.46;branch=z9hG4bK617849
Call-ID: 9d09al9nj4a7eimvhl6998
From: sip:100@192.168.0.187;tag=nq5o807dne
To: sip:100@192.168.0.187;tag=z9hG4bK617849
CSeq: 3 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1509426656/e5dbc38c468f96d227218ee6f1e42b1e”,opaque=“40426fa31b7377a7”,algorithm=md5,qop="auth"
Server: Asterisk PBX 15.0.0
Content-Length: 0

<— Received SIP request (781 bytes) from WSS:192.168.0.46:53063 —>
REGISTER sip:192.168.0.187 SIP/2.0
Via: SIP/2.0/WSS 192.168.0.187;branch=z9hG4bK7488576
Max-Forwards: 69
To: sip:100@192.168.0.187
From: sip:100@192.168.0.187;tag=nq5o807dne
Call-ID: 9d09al9nj4a7eimvhl6998
CSeq: 4 REGISTER
Authorization: Digest algorithm=MD5, username=“100”, realm=“asterisk”, nonce=“1509426656/e5dbc38c468f96d227218ee6f1e42b1e”, uri=“sip:192.168.0.187”, response=“4dc3051c64370739eed41e46af716ac2”, opaque=“40426fa31b7377a7”, qop=auth, cnonce=“g5grhde0qqs4”, nc=00000001
Contact: sip:100@192.168.0.187;+sip.ice;reg-id=1;+sip.instance=“urn:uuid:8727177f-9e92-4f1b-aad8-baa6373b9f03”;expires=0
Expires: 0
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.0.13
Content-Length: 0

== Contact 100/sip:100@192.168.0.46:53063;transport=ws has been deleted
– Removed contact ‘sip:100@192.168.0.46:53063;transport=ws’ from AOR ‘100’ due to request
<— Transmitting SIP response (349 bytes) to WSS:192.168.0.46:53063 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS 192.168.0.187;rport=53063;received=192.168.0.46;branch=z9hG4bK7488576
Call-ID: 9d09al9nj4a7eimvhl6998
From: sip:100@192.168.0.187;tag=nq5o807dne
To: sip:100@192.168.0.187;tag=z9hG4bK7488576
CSeq: 4 REGISTER
Date: Tue, 31 Oct 2017 05:10:56 GMT
Expires: 0
Server: Asterisk PBX 15.0.0
Content-Length: 0

== Endpoint 100 is now Unreachable
== WebSocket connection from ‘192.168.0.46:53063’ closed
== WebSocket connection from ‘192.168.0.46:53106’ for protocol ‘sip’ accepted using version ‘13’
<— Received SIP request (518 bytes) from WSS:192.168.0.46:53106 —>
REGISTER sip:192.168.0.187 SIP/2.0
Via: SIP/2.0/WSS 192.168.0.187;branch=z9hG4bK2115142
Max-Forwards: 69
To: sip:100@192.168.0.187
From: sip:100@192.168.0.187;tag=7a2hdjqs77
Call-ID: ri3qbuga2qur2v9ot4cc84
CSeq: 1 REGISTER
Contact: sip:100@192.168.0.187;+sip.ice;reg-id=1;+sip.instance=“urn:uuid:46d11244-e6d3-44de-9f92-3a2b8c9bc768”;expires=300
Expires: 300
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.0.13
Content-Length: 0

<— Transmitting SIP response (457 bytes) to WSS:192.168.0.46:53106 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS 192.168.0.187;rport=53106;received=192.168.0.46;branch=z9hG4bK2115142
Call-ID: ri3qbuga2qur2v9ot4cc84
From: sip:100@192.168.0.187;tag=7a2hdjqs77
To: sip:100@192.168.0.187;tag=z9hG4bK2115142
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1509426666/c0cd012030d4f6b5885243299622a9b2”,opaque=“0977a36460b77e8f”,algorithm=md5,qop="auth"
Server: Asterisk PBX 15.0.0
Content-Length: 0

<— Received SIP request (785 bytes) from WSS:192.168.0.46:53106 —>
REGISTER sip:192.168.0.187 SIP/2.0
Via: SIP/2.0/WSS 192.168.0.187;branch=z9hG4bK2894217
Max-Forwards: 69
To: sip:100@192.168.0.187
From: sip:100@192.168.0.187;tag=7a2hdjqs77
Call-ID: ri3qbuga2qur2v9ot4cc84
CSeq: 2 REGISTER
Authorization: Digest algorithm=MD5, username=“100”, realm=“asterisk”, nonce=“1509426666/c0cd012030d4f6b5885243299622a9b2”, uri=“sip:192.168.0.187”, response=“8e3629e06485fbb44f8b0f0420a67bab”, opaque=“0977a36460b77e8f”, qop=auth, cnonce=“r3n0ko99ral5”, nc=00000001
Contact: sip:100@192.168.0.187;+sip.ice;reg-id=1;+sip.instance=“urn:uuid:46d11244-e6d3-44de-9f92-3a2b8c9bc768”;expires=300
Expires: 300
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.0.13
Content-Length: 0

== Contact 100/sip:100@192.168.0.46:53106;transport=ws has been created
– Added contact ‘sip:100@192.168.0.46:53106;transport=ws’ to AOR ‘100’ with expiration of 300 seconds
<— Transmitting SIP response (415 bytes) to WSS:192.168.0.46:53106 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS 192.168.0.187;rport=53106;received=192.168.0.46;branch=z9hG4bK2894217
Call-ID: ri3qbuga2qur2v9ot4cc84
From: sip:100@192.168.0.187;tag=7a2hdjqs77
To: sip:100@192.168.0.187;tag=z9hG4bK2894217
CSeq: 2 REGISTER
Date: Tue, 31 Oct 2017 05:11:06 GMT
Contact: sip:100@192.168.0.46:53106;transport=ws;expires=299
Expires: 300
Server: Asterisk PBX 15.0.0
Content-Length: 0

== Endpoint 100 is now Reachable
– Contact 100/sip:100@192.168.0.46:53106;transport=ws is now Unknown. RTT: 0.000 msec

sorry, my context was mismatching, now i can call but myself streaming only coming, from other side i mean remote video not coming

Your endpoint configuration does not allow more than 1 video stream to be present. You need to increase this by configuring it in each endpoint like is documented in the blog:

To enable multi-stream support in the PSJIP channel driver you’ll need to set max_audio_streams and max_video_streams options for a given endpoint to something greater than “1”, which is the default.

For example:

max_video_streams=5
1 Like

Yes, I did that change but now remote video coming blank, just black screen only,

[100]
type=aor
max_contacts=1
remove_existing=yes

[100]
type=auth
auth_type=userpass
username=100
password=100

[100]
type=endpoint
aors=100
auth=100
use_avpf=yes
media_encryption=dtls
max_audio_streams=10
max_video_streams=10
webrtc=yes
dtls_ca_file=/etc/asterisk/keys/ca.crt
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
media_use_received_transport=yes
rtcp_mux=yes
context=internal
disallow=all
allow=ulaw
allow=h264
allow=vp8

Try specifying only vp8. As well - what browser and environment are you trying under?

I am checking in Chrome browser, and when only specifying vp8, asterisk cli says:

– Executing [123@internal:1] Answer(“PJSIP/100-00000040”, “”) in new stack
> 0x7f81b016a540 – Strict RTP learning after remote address set to: 110.227.255.126:33064
> 0x7f81b016a540 – Strict RTP learning after ICE completion
> 0x7f81b016a540 – Strict RTP switching to RTP target address 192.168.0.42:33064 as source
Got RTP packet from 192.168.0.42:33064 (type 96, seq 003671, ts 3377069611, len 000944)
– Executing [123@internal:2] ConfBridge(“PJSIP/100-00000040”, “guest”) in new stack
[Oct 31 16:13:25] WARNING[21553][C-00000033]: channel.c:5495 set_format: Unable to find a codec translation path: (gsm) -> (vp8)
[Oct 31 16:13:25] WARNING[21553][C-00000033]: file.c:1245 ast_streamfile: Unable to open conf-onlyperson (format (vp8)): Function not implemented
– Started music on hold, class ‘default’, on channel ‘PJSIP/100-00000040’
– Channel PJSIP/100-00000040 joined ‘softmix’ base-bridge <628c0d74-5c31-4f43-a8b4-e3eff6966167>
[Oct 31 16:13:25] WARNING[21553][C-00000033]: translate.c:485 ast_translator_build_path: No translator path: (starting codec is not valid)
[Oct 31 16:13:25] WARNING[21553][C-00000033]: channel.c:5495 set_format: Unable to find a codec translation path: (slin) -> (vp8)
– Channel PJSIP/100-00000040 left ‘softmix’ base-bridge <628c0d74-5c31-4f43-a8b4-e3eff6966167>
– Stopped music on hold on PJSIP/100-00000040
– Executing [123@internal:3] Hangup(“PJSIP/100-00000040”, “”) in new stack

asterisk15-VirtualBox*CLI> module show like vp8
Module Description Use Count Status Support Level
res_format_attr_vp8.so VP8 Format Attribute Module 1 Running core
1 modules loaded

You need to specify an audio codec and a video codec. I meant to remove h264 from the list of video codecs.

ok, I removed h264 and then checked, but same black screen output from remote video.
RTP packets are flowing,

Got RTP packet from 192.168.0.46:56197 (type 126, seq 014079, ts 3418611573, len 001073)
Got RTP packet from 192.168.0.46:56197 (type 00, seq 035020, ts 533962765, len 000160)
Sent RTP packet to 192.168.0.45:63380 (via ICE) (type 00, seq 008048, ts 552960, len 000170)
Sent RTP packet to 192.168.0.46:56197 (via ICE) (type 00, seq 007291, ts 502720, len 000170)
Got RTP packet from 192.168.0.46:56197 (type 00, seq 035021, ts 533962925, len 000160)
Sent RTP packet to 192.168.0.45:63380 (via ICE) (type 00, seq 008049, ts 553120, len 000170)

And the browser asked you to grant permission for use of the webcam?

yes, when popup I allowed permission

It appears as though the browser is not sending the video to Asterisk. Why that is, I’m not sure. Do you see yourself on the screen? Otherwise you’d need to dig into why the browser is not doing so.

yes i can see myself in screen

So, What else I can do now, any suggestions ?

Provide the output of “rtp set debug on” and “pjsip set logger on” for a call attempt. If that shows that video is negotiated but is not arriving to Asterisk then you need to look into why that is from the browser.

Click on below link for logs
call log for asterisk video conference

According to your log you are using “SIPml5” which is not something we have tested or used with the video conferencing support. If you don’t use what we know works then you are on your own I’m afraid. As it is though, no video is being received from the client. Why that is - you’d have to investigate yourself.

Ok, thanks in cyber mega phone its working now.
But before it was not working, i did not make any change though, whatever some strange.
I just changed, video_mode=follow_talker in confbridge.conf and
same => n,ConfBridge(guest,default_bridge,default_user) in extensions.conf
it’s working now

This has solved my problem by only adding video_mode=follow_talker in linphone for android