Closed haeferer closed 5 years ago
conference and endpoint are two different things. Do you want to remove (ie disassociate) an endpoint from a conference? Or remove (ie destroy) a conference?
I want to remove a conference created before with an defined name. I can remove the name, so a unique-id is created, but i want to remove the conference by name after us.
Or i could get a conference by name, if a conference with this name already exists
you can use any of the conference AP commands here:
https://freeswitch.org/confluence/display/FREESWITCH/mod_conference#mod_conference-APIReference
For example, to see if a conference exists you would list the conferences (api) and then filter by name
Assuming you had a mediaserver object (e.g. 'ms'):
ms.api('conference list summary').then((results) => ..filter
Jup i've already done this. But if the conference name exists (after a first run of the program) how can i create a conference object for an existing conference or destroy a conference with a name first.
Right now i have to choose a different name for every start of the program (2 outbound call connected into 1 conference). Or Restart the FreeSwitch
Maybe there is another problem. Booth conferences had still 1 Member (maybe the DrachtIO-Server).
Conference my_conf (1 member rate: 8000 flags: running|answered|enforce_min|dynamic|exit_sound|enter_sound|json_status)1;sofia/drachtio_mrf/nobody@172.22.17.11:5060;07b1ec8a-f180-11e8-a48e-c707eedabce9;unknown;;hear|floor;0;0;0;100
Conference my_conf2 (1 member rate: 8000 flags: running|answered|enforce_min|dynamic|exit_sound|enter_sound|json_status)2;sofia/drachtio_mrf/nobody@172.22.17.11:5060;203d7490-f180-11e8-a498-c707eedabce9;unknown;;hear|floor;0;0;0;100
when you create a conference thru drachtio-fsmrf (ms.createConference), it will create a 'control leg' which is an endpoint connected to the conference, so that we can perform some actions thru that leg. Then as you add participants these will be additional legs. If all participants drop, we still have that control leg (and thus the conference still exists on the freeswitch), until you issue Conference#destroy()
.
The control leg is created muted, so perhaps those two legs are control legs (since they have 'hear' property but not talk.
The general pattern (that I had in mind, anyways) was that you create Conferences in your app and have some way of storing them, and associating name to Conference object. Then when you want to add a new participant to a conference by name, you call Endpoint#join(confObject,..
.
What I don't have in the library at the moment, is a way to create a new Conference object and associate it to an existing conference on the Freeswitch, rather than create a new conference on the Freeswitch. Is that what you are looking for? If I understand your use case better I may have more to say.
Finally, not sure how deep you want to get into this, but I would love to have collaborators on this module. I don't really get as much time as I would like to put into it, as I mostly have to focus on the more widely-used drachtio-server and drachtio-srf.
We (me an my college) would definitly like to collaborate on this (also on DrachtIO-SRF). We will need some time to "deep dive" into this, but it's worth to do it.
The general pattern (that I had in mind, anyways) was that you create Conferences in your app and have some way of storing them, and associating name to Conference object. Then when you want to add a new participant to a conference by name, you call Endpoint#join(confObject,...
Correct. But sometimes there could be no chance to destroy the conference. So the conference has to be killed next time (to created a new one with the same name)
Out current state is to understand fundamental ideas and concepts. Out primary goal is to make outbound-calls (technical) and work with them (join together, etc.).
Thx a lot for your support.
PS: A first idea for drachtio-srf would be a @types/drachtio-srf type libary to speed up development. We are working on this (by testing all the different possiblities, and sometimes we dont know how to make it right)
If the application reaches
conference.destroy()
evertything works as excpected.
If this code is never reached (Bug, Exception etc.) the conference still exists, next time the app runs.
So this is not a Issue but a problem if my application does not clean up correctly.
It's probably not a totally great solution to your problem, but as a workaround if you want to just kill a named conference that exists you can can use (I think) the conference api hup
command, ie.
ms.api('conference hup all')
This should hang up all legs in the conference, and as a result clear the conference itself from the freeswitch.
try that and see if it works.
It will be great if you want to help out with the code. I guess the best way to start would be if we find some feature or bug fix you want to do, and you can fork the repo and send me a PR. Later on I can add you as a collaborator. No rush on this, just if you want to.
The first step, by the way, would be to make sure you can run the test suite (npm test), which requires docker to be installed on your laptop.
As far as Typescript, I have not been using that and am not familiar with what an @types library would look like. Can you point me to a similar example (I presume what you are referring to is some way of using a plain javascript module in Typescript, with some type assisting or so forth?)
sorry, got the command wrong above:
ms.api(
conference ${name} hup all)
We will try this...
About TypeScript:
@types/
Here is the same for "express"
Works perfect
let existing = (await mediaserver.api('conference list summary')).split(/[\r\n]+/)
.map(l => (l.match(/Conference\s*([^\s]+)\s/) || [])[1])
.filter (conf => conf !== undefined);
console.log(existing);
for (let co of existing) {
console.log(await mediaserver.api(`conference ${co} hup all`));
}
console.log('Done Killing');
Is there a defined way to remove a conference (an endpoint?) Using mrf.api i can manipulate an existing conference