Experimenting a bit this morning with AMI.
Right now, we’re listening to events and occasionally opening up another socket to AMI to perform an action.
It dawned on me that I could use the same connection to send commands as I am using to receive events.
This seems to work for the very first event and command, and then AMI becomes unresponsive.
Is what I’m attempting possible? Can you re-use the same socket to listen to events and send commands?
January 10, 2023, 12:49pm
People do it - but some commands are not asynchronous and will block the socket until they complete. It depends on what exactly you’re doing.
Interesting, so here’s what I’m testing after opening the socket:
And then subsequently on the same socket:
I’m listening for BridgeEnter/BridgeLeave to trigger sending MixMonitor/StopMixMonitor.
Seems to work great for the very first BridgeEnter, MixMonitor starts the recording, but then nothing on the socket and no errors, verified the socket remains open.
I’ve tried with and without Login/Logoff on the actions.
Note this is a known-working daemon that I built, the only thing I’m doing different is using the same socket vs opening a new socket for the actions.
Any insight appreciated
January 10, 2023, 1:14pm
I don’t really have any further insight, I rarely use AMI and issues regarding it seldom come up. Someone else may have thoughts.
I don’t think you should be using Login on a logged in connection.
You definitely shouldn’t expect to continue to receive events after the Logoff.
January 11, 2023, 2:16am
I provide a number of different example listener scripts — sync versus async, AMI versus ARI — in my
examples repo for Seaskirt. Feel free to use that as a reference. And let me know if they don’t work for you.
February 10, 2023, 2:16am
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.