communication between two channels in asterisk - agi

I am new to asterisk, My task is to establish communication between two applications.I have done it successfully on PRI line both the applications are communicating with each other on different channels. Now I need to control both the applications(i.e communication between two channels), AGI methods are useful to set variables in a channel. as my requirement is to communicate between two channels, per channel variable is no way helpful, Please suggest me any methods in AGI that would be helpful for setting variable per call.
In a call the data should be shared by two variables

please fallow the link this is your answer and try the channels communication in SIP http://www.asteriskguru.com/tutorials/wildcard_tdm400p.html

Related

Django Channels: chan you check the number of sockets inside a room/channel_layer

Same as the question itself. How can you check the number of live sockets inside a room or a channel_layer if you are using django channels?
You can't do this directly from the generic channel layer api, if you'r using Redis you could look into the Redis api and check how many subscriptions are open.
this could be done using this api:
https://redis.io/commands/client-list
(this might be quite slow and costly if you have lots of open connections to your redis cluster)
You will need to convert the group name into the group key in the same way the redis layer is doing this see here:
https://github.com/django/channels_redis/blob/master/channels_redis/core.py#L582

How to target specific workers with shared subscriptions in MQTT 5?

One of the new features of MQTT 5 is the shared subscriptions feature, which allows client-side load balancing between multiple workers, so that multiple workers can be responsible for handling messages, but every message is only ever sent to a single server.
By default, this works with a round-robin approach, but I am in the need of a slightly more advanced scenario:
What I want is some kind of routing, so that one of the messages' properties gets used as some kind of routing key. I.e., I want multiple workers to be responsible for the messages, but all messages with value X in their routing key property should always go to the same worker, and all messages with Y should do as well. The workers for X and Y may be different, but all messages with X should always go to the same one.
Question 1: Is this even possible with MQTT 5? If so, what is the term I need to look for? I tried googling for this, but wasn't really successful (mainly, I guess, because I don't know exactly what to look for).
Now, supposed this is possible: How can I then handle cases where nodes join or leave? Then I still want only a single node to be responsible, so it would be great if the assignment was not statically, but could be adjusted dynamically (or even better, would adjust itself automatically). However, what I strictly need to avoid is that two messages with X ever go to different servers at the same time.
Question 2: Supposed, this is not possible – what alternatives do I have to MQTT 5?
You don't at a protocol level. That is the whole point of a shared subscription to distribute the incoming messages evenly across all the subscribers.
This also goes against the pub/sub paradigm, that messages are published to a topic not an individual subscriber.
If you want to route messages differently publish them to different topics. There is nothing to stop you republishing a message on a separate topic based on it's meta data once it's been received by a client if needed.

Which is a good way to send robot states between different ROS nodes?

I am implementing a robotic system based on ROS. I have different nodes which send data multiple times per second. However, I don't need that. I want to send the robot state only when it is at a new location. What technique of ROS do you suggest to use?
Dependent on your requirements, you can either use the ROS Services or the Parameter Server.
ROS Service: The publish / subscribe model is a very flexible
communication paradigm, but its many-to-many one-way transport is not
appropriate for RPC request / reply interactions, which are often
required in a distributed system. Request / reply is done via a
Service, which is defined by a pair of messages: one for the request
and one for the reply.
Parameter Server: A parameter server is a shared, multi-variate dictionary that is accessible via network APIs. Nodes use this server
to store and retrieve parameters at runtime. As it is not designed for
high-performance, it is best used for static, non-binary data such as
configuration parameters.

Are ActionCable Channels instances shared across clients?

I identify connections by public IP address. My understanding until recently (doubting it) is that in such a case, client's subscribing to a channel would reuse the same Channel instance.
A real world example is as follows:
I'm building up an app that requests information from a certain source that is not owned by me. This is done through an HTTP request and a Job. The external resource changes in periodic intervals of time.
My DataChannel class, which inherits from ApplicationCable::Channel manages a cache of the last request so new clients subscribed from the same IP address won't start a new request, but instead reuse the last one.
Summing up:
If I open two tabs and each one subscribes to a channel, do I get two Channel instances even if the connection identifier is the same?
I'm not seeking for a way to do so, just pointing me in the right direction is enough and actually far more valuable.
No, they aren't.
I needed to add some synchronization between all instances owned by a client with connection identified with IP address.
For this, I used Redis DLM, so I could acquire and release locks and thus perform computations which were intended to be unique.
There might be a better way to do so, but I couldn't imagine one that didn't require patching the ActionCable sources. Any further comment is appreciated as always.

Datasift multiple thread in same connection

We are trying out an option of having multiple parallel thread meaning multiple consuming for different set of keywords by establishing single connection. Is it possible or should we establish new connection if we want to consume another set of data? Can anyone guide on this
Regards,
Balaji D
This is documented on DataSift's Multiple Streaming docs page. Some of the official API Client Libraries also support multi-streaming over WebSockets.

Resources