ARI. add channels to a bridge with video source

Hello,

I am not sure if it is a bug or not, what do you think?

I have an asterisk ARI and one sip client with a camera and two without a camera. Camera client calling (with video params in SDP) to asterisk and call goes to a stasis application. Stasis adds a channel to the existing bridge.

After this stasis application originates a call (INVITE without video params in sdp) to the first client without a camera and adds created channels to the same bridge. Because of there is a video source in the bridge - asterisk makes a reinvite with video params in SDP to the first client. So the first client is able to see video from the camera client.

Next stasis application originates a call (INVITE without video params in sdp) to the second client without a camera and adds created channels to the same bridge. But there is no reinvite from asterisk to the second client. So, the second client is not able to see video from the camera client.

There is the bridge with three channels now. And only one client can see video from the camera client.
The question is why asterisk sends reinvite only to the first client?

PS. When I am adding in ari swagger the first client (who already can see video) to the same bridge again - asterisk immediately send reinvite with video sdp to the second client, and both clients now can see video from camera client.

PPS. All clients are behind kamailio proxy

this is my simple stasis script for testing

#!/usr/bin/env python

import threading
import requests
import logging
import urllib
import uuid
import time
import json
import ari
from channel import *


logging.basicConfig(level=logging.ERROR)
client = ari.connect('http://MY_ASTERISK:8088', 'asterisk', 'asterisk')
main_bridge = client.bridges.create(type='mixing', bridgeId="main")
callees = [ 'ak', 'nl' ]


def stasis_start_cb(channel_obj, ev):
    """Handler for StasisStart"""
    channel = channel_obj.get('channel')
    args = ev.get('args')
    anum = channel.json.get('caller')['number']
    bnum = channel.json.get('dialplan')['exten']


    if not args:
        channel.answer()
        print "Incoming call from {} to {}".format(anum, bnum)
        print "Created an incoming channel {} ({})".format(channel.json.get('name'), channel.id)
        print "Adding a channel to a bridge"
        main_bridge.addChannel(channel=channel.id)
        print
        
        if len(callees) > 0:
            callee = callees.pop(0)
            raw_input("Press Enter to call to " + callee)
            user = client.channels.originate(endpoint="PJSIP/" + callee + "@kamailio", app="ccng", channelId=callee)
            print "Calling to " + callee + ". uniqueid = " + user.id
        
    return


if __name__ == '__main__':
    print("Stasis application starting")
    client.on_channel_event('StasisStart', stasis_start_cb)
    client.run(apps='ccng')

I’m also having problems with the ARI, bridge, and INVITE. My case is a bit different but maybe it’s related.

For me the bridge does not connect the video (only a black screen is shown) until I force an re-INVITE from the videophone (by using the hold or start/stop video button). The initial INVITE does look correct but there is just black video. Only when the re-INVITE is sent does the video work properly which makes me think it’s something on the Asterisk side that needs a bit of a kick to get working.