Injecting video in the call maybe with using a /dev/video v4l2 device

Hi @david551 or @jcolp , can you help me out one more time? :slight_smile:
I have below dialplan configured, its for a doorbell purpose … its a SIP doorbell without a camera… So what i have done, virtual extension 7000 is a console extension (linphoneC) with auto answer enabled and using a /dev/video0 v4ltloopback device for video… (injecting rtsp)

So when doorintercom is ringing, i invite user 6000 and 6001 to the conference bridge…
Also created a while loop to wait for 60 seconds, if no one answers, the call is finished
If 6000 or 6001 answers before the 60 seconds, extension 7000 (video user) is also joining the confbridge as a marked user, only to see the video… (video_mode=first_marked)

Working great!

But i want to improve it, because now i can only see video when i answer… i want to see video before answer (early media), thats indeed possible when i add the progress() app… i have done testing when i call from extension to extension , and i see early video (183 session)

Can i also do it with changing dialplan below? Its also verry important that the doorintercom stays ringing, it may NOT joined a confbridge before someone answers, thats why i have that while loop…
I was thinking like => doorintercom calls => and then the virtual extension 7000 (command line call) makes the call to 6000 / 6001 , if 6000 / 6001 answers, the doorintercom joins the confbridge together with 7000

Or maybe another way, is there a way i can specify a /dev/video device in asterisk itself?? thats maybe easier? Is that possible somehow in the extensions settings?? maybe in the extension itself from the doorintercom user?

exten => s,1,NoOp()
 same => n,Originate(Local/6000@default,exten,default,600,1,,aC(ulaw,alaw,h264)n(Doorbell))
 same => n,Originate(Local/6001@default,exten,default,601,1,,aC(ulaw,alaw,h264)n(Doorbell)) 
 same => n,Set(i=1)
 same => n,While($[${i} < 60])
 same => n,NoOp(Confbridge number of participants : ${CONFBRIDGE_INFO(parties,1)})
 same => n,GotoIf($["${CONFBRIDGE_INFO(parties,1)}" >= "1"]?startconf) 
 same => n,Wait(1) 
 same => n,Set(i=$[${i} + 1]
 same => n,EndWhile()
 same => n,Hangup() 
 same => n(startconf),ConfBridge(1,myconferenceroom,default_user) 
exten => 600,1,NoOp()
 same => n,Originate(PJSIP/7000,exten,default,700,1,,aC(ulaw,alaw,h264))
 same => n,ConfBridge(1,myconferenceroom,admin_user)

exten => 601,1,NoOp()
 same => n,Originate(PJSIP/7000,exten,default,700,1,,aC(ulaw,alaw,h264))
 same => n,ConfBridge(1,myconferenceroom,admin_user) 
exten => 700,1,NoOp()
 same => n,ConfBridge(1,myconferenceroom,marked_user)

This won’t work. Asterisk doesn’t do that kind of video stuff (like mixing streams or distributing to several endpoints). You’d need a suitable Multi Point Control Unit (MCU) to do that.

Personally, I think what you are trying to do is a bit overloaded. It is far easier to set up a separate video surveillance server (like Zoneminder), do some motion detection and trigger some events that are then handled by other programs like Asterisk. I also prefer to see what happens in front of my doors all the time, so doorstations are also part of my general surveillance system. With a little bit of AMI (or even bash), you can even trigger calls that are caused by motions and the result would be an auto answered call, i.e. you’d see a person before the button gets pressed. With a few more seconds you can better think about whom you want to get rid of and how to do it efficiently.

i dont want to trigger events or something :slight_smile: , i have a SIP intercom doorstation, so when someones pressed the doorbutton, i want to have incoming calls to all my sofphones to pickup and speak to the person …

its all working now, i can speak to the person and see the video from the cam with the softphone app…
i was just asking when door intercom calls, i need to have a call from another user, so that user invites me to the confbridge and also joins the call together with the door intercom…

I believe conference bridges can do that, even for video.

I haven’t tried that yet, and all attempts based on function DIALGROUP() didn’t work for me in the past.

yes, indeed i have setup a confbridge… i see video , all is working…

just when the intercom extensions call, i want to change in dialplan, that another user is actually calling and invites me

DIALGROUP is just a text manipulating utility for preparing & separated lists of dialstrngs, you can achieve the same effect separately. Multiple dialstrings, for Dial, are only relevant in the early media stage. Once one answers, that one is bridged and the other ones aborted.

I am aware of this—I just didn’t want to go into the details of calling several devices and I lumped everything together into the term DIALGROUP.

Early media and group calling is indeed not working in Asterisk, it only works in a 1 to 1 call

So that was my question… i have setup a confbridge to inject a video… but i just need to change somewhere in the dialplan, when doorintercom calls, actually another extension is calling me and invites me to the confbridge …
The virtual extensions, i can give him commands with CLI with shell

@david551 , any idea if its possible, because were a bit offtopic in the thread
can i change the dialplan so on incoming call for the confbridge, i let the other virtual extension call , to invite to the confbridge…
the virtual extension is a command line softphone with video , so from dialplan i can executit with a “CURL = call xxx”

i think i only need to change this stuff:

exten => s,1,NoOp()
 same => n,Originate(Local/6000@default,exten,default,600,1,,aC(ulaw,alaw,h264)n(Doorbell))
 same => n,Originate(Local/6001@default,exten,default,601,1,,aC(ulaw,alaw,h264)n(Doorbell))

instead of doing an originate, i need to change those lines to do an SHELL with command line call… that should work, but i also need to enter the confbridge afterwards :slight_smile:

Originate won’t create a video stream.

Indeed, I need to change the originate to an shell command, so the virtual extension is calling… But how to join then the confbridge…

Or another approach… It possible to setup an /dev/video device in the extension config?

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