Group video calling in asterisk

Hi all,
I have been struggling with asterisk from last few weeks. There are certain features which are supported in 3CX
but looks like asterisk is not supporting it. Previously I was trying to get the video from the monitor before answering the call (3cx support this feature by default), I posted this question here but couldnt get much support. Well I have figured it out by myself using “hit and trial” method and now I am getting pre-video in my SIP monitor.

Now I want to call ring group where 2 monitors will ring simultaneously, and I want pre video feature for it. I am surprised that it works with one SIP video monitor, but when I dial the ring group (with two sip extensions), I dont get the video before answering the call. I only get video once the call is answered.

3CX again support this feature by default, we dont need to configure anything, I believe there must be some options for asterisk as well.

I need this feature for my video door entry system, it is a big project, and I want to solve it for my customers
Is there anyone who has worked on this kind of project before ? Any help would be much appreciated

thanks in advance

How are you supposed to send back the two video streams in the ring group to the original caller at the same time? My guess is that Asterisk is only sending back 1 video stream in the SDP of the 200 OK or 183 Session Progress. I don’t think it’s supported in Asterisk to send back two separate streams from each monitor in the ring group.

Matthew Fredrickson

My door panel sip extension 2000
my monitor A sip extension is 2001
my monitor B sip extension is 2003.

Group extension is exten => 8000,1,Dial(sip/2001&sip/2003)

From my door panel if I dial 2001, then I get the video before answering the call, similarly if I dial 2003, i get video before answering the call.

Even there is a speed dial option (in my door panel) where you can dial two sip extensions at the same time
In this case I get the video on both monitors as well.

But when I dial 8001, which is ring group I dont get video before answering the call (on both monitors).
Once the call is answered I can see the video.

I can post my CLI results as well, if i dial two extensions simultaneously from the door panel using speed dial option:
(it works)

== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5
– Executing [2001@internal:1] Dial(“SIP/2000-0000000d”, “SIP/2001,60”) in new stack
== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5
– Called SIP/2001
== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5
– Executing [2003@internal:1] Dial(“SIP/2000-0000000f”, “SIP/2003,60”) in new stack
== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5
– Called SIP/2003
– SIP/2001-0000000e is ringing
– SIP/2001-0000000e is making progress passing it to SIP/2000-0000000d
– SIP/2003-00000010 is ringing
– SIP/2003-00000010 is making progress passing it to SIP/2000-0000000f
== Spawn extension (internal, 2001, 1) exited non-zero on ‘SIP/2000-0000000d’
== Spawn extension (internal, 2003, 1) exited non-zero on ‘SIP/2000-0000000f’

similarly if i dial ring group(dont work)
== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5
– Executing [8001@internal:1] NoOp(“SIP/2000-0000000a”, “dialing”) in new stack
– Executing [8001@internal:2] Dial(“SIP/2000-0000000a”, “SIP/2001&sip/2003”) in new stack
== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5
== Using SIP VIDEO CoS mark 6
== Using SIP RTP CoS mark 5
– Called SIP/2001
– Called sip/2003
– SIP/2001-0000000b is ringing
– SIP/2001-0000000b is making progress passing it to SIP/2000-0000000a
– SIP/2003-0000000c is ringing
– SIP/2003-0000000c is making progress passing it to SIP/2000-0000000a
== Spawn extension (internal, 8001, 2) exited non-zero on ‘SIP/2000-0000000a’

Please let us know if you think there is a work around for this issue. I am really stuck with it.
It works with 3CX PBX, but I dont know why asterisk is giving me pain

My guess is because Asterisk can’t setup independent video streams for each outbound video leg to map to the caller. This is an Asterisk limitation. Asterisk internally is built around the idea that a device or channel (in Asterisk speak) only has one audio and one video channel. You are trying to map two video channels from the group call back to a single calling channel, which breaks Asterisk’s internal typical use case model.

Matthew Fredrickson

Dial only handles early media when there is a single candidate destination. That is mainly done for the normal telephony case where you wouldn’t generally want callees to hear you before they had answered. However the test is obviously being applied to all early media not just early media in the direction where it would need to be merged.

Basically this code is doing it:

	/* single is set if only one destination is enabled */
	int single = outgoing && !AST_LIST_NEXT(outgoing, node);

which is basically checking if the list of destinations contains only one entry.

This is then followed by code similar to this in various places;

                    /* Setup early media if appropriate */
                    if (single && !caller_entertained
                        && CAN_EARLY_BRIDGE(peerflags, in, c)) {
                        ast_channel_early_bridge(in, c);

Obviously, if you removed the check, you would also need to tell ast_channel_early_bridge how to cope with n-party calls.

1 Like

Thank you david for Guiding me. Can you please tell me in which file i can find this piece of code
thanks in advance


You’ll have to recompile asterisk once you change something in Asterisk source.


You are not talking about an easy change. The early bridge code assumes that there are only two channels involved. I think you are talking at least man weeks. Trying to set up two early bridges may even cause a crash and won’t do what you want.

Well It works with 3CX PBX system, so If we do it in a proper manner I think it should be possible in asterisk as well
As asterisk is open source it should provide more flexibility than 3CX system.

Well we are willing to spend more time on it, as we need to complete this project in Feb 2017. All we need is the proper direction. What source code do we need to change ? can we get training for asterisk coding?
We have been using 3CX from last few years, we are now moving to asterisk, and only group video calling is stopping us.
It would be great if someone gives us the right direction and I believe this forum can guide us which will let us to help our customers


These sorts of questions should be directed at the developer mailing list or IRC channel.

The source file I quoted is apps/app_dial.c You will have to search for the early bridge code.

You may find it easier to work with an earlier version of Asterisk which was less layered. I think the early bridging used to be done by app_dial itself. Looking at the latest unpacked source I have, it looks like you will need to change main/channel.c and channels/chan_sip.c

The app_dial module is still handling early media. That hasn’t changed for the use of Dial(). The wait_for_answer function in app_dial.c would be the place to modify and change things. If it’s a SINGLE video stream from the calling party then you may be able to change the code to forward it on to the called parties. The function reads in frames from channels and does things with them, including passing them back. You would need to add logic which accepts video frames from the calling party and writes them to the called parties.

As for training on internal Asterisk coding, there is none. There’s just documentation and the code itself. If you have specific questions then the asterisk-dev mailing list[1] would have more of a developer audience.


1 Like

thanks just a quick tweek, what is the location of app_dial.c file in linux.
I am trying to find it on /etc/asterisk as all of the configuration files are present on this folder but couldnt find
I am using asterisk 11.7

thanks in advance

It is in the source code of Asterisk. You have to build Asterisk after making source code changes.

It is in the channels directory under where you installed the source tree for Asterisk. If you have used a package, it will be in the source package which isn’t normally installed.