Yate Community Forum

General Category => Yate users hangout place => Topic started by: jamie on September 16, 2018, 09:28:58 PM

Title: How to Remove a Caller from a Conference without Hanging Up
Post by: jamie on September 16, 2018, 09:28:58 PM
Hi,

Please could you help me ?

I need to be able to remove a caller from a conference and not hang-up.

I've been using the following to create a conference (PHP):

Code: [Select]
$m = new Yate("chan.masquerade");
 $m->id = "";
 $m->params["message"] = "call.execute";
 $m->params["id"] = $partycallid;
 $m->params["callto"] = "conf/cs-$conference_id";
 $m->params["notify"] = "conf-monitor/cs-$conference_id";
 $m->params["billing"] = "true";
 $m->params["lonely"] = "true";
 $m->params["maxusers"] = $maxusers;
 $m->params["smart"] = "t";

 //$m->params["record"] = "external/nodata/conference.php";
 // set this so that script can play warnings in conference
 //$m->params["recordwarn"] = "-";
 $m->params["speakers"] = $speakers;
 $m->params["interval"] = $interval_notifications;
 $m->params["waitlock"] = -200;  // ( ** Not sure what this does ** )

 $m->Dispatch();


This work fine.

However, after a period of time, I need to be able to remove the caller from the conference (or destroy it) but without dropping the call.

I've checked for capability in the source ( conference.cpp ) and see that it seems to have class methods that might do it, but I can't see how I would do it.

Your help would be very much appreciated.

Thank you, Regards
Jamie

 




Title: Re: How to Remove a Caller from a Conference without Hanging Up
Post by: marian on September 17, 2018, 08:46:45 AM
You may:
- Drop the channel (use call.drop message with 'id' parameter)
- Re-execute it to another destination (masquerade a call.execute message): the channel will be removed from conference and connected to new destination

You need to remember its channel id for both actions.
Title: Re: How to Remove a Caller from a Conference without Hanging Up
Post by: jamie on September 18, 2018, 10:44:31 PM
Hi Marian,

Thanks very much for your help, much apprecited.

I think I've managed to implement this !

One quick questions .... is it best to issue the masquerade call.execute immediately after the call.drop channel, or
to listen for the disconnected message and do it then?

Title: Re: How to Remove a Caller from a Conference without Hanging Up
Post by: marian on September 18, 2018, 11:37:37 PM
Hi,
There no need to drop the channel: when it is re-executed it will be connected to a new channel (call leg) and disconnected from the old one.
You only need to make sure the call execute target module is loaded.
Title: Re: How to Remove a Caller from a Conference without Hanging Up
Post by: jamie on September 24, 2018, 04:23:02 PM

Hi Marian

Thank you, For others to view, I'll update the post shortly with what I've done.

Occasionally I get the following message:

"Overflow reading in buffer of length 8192"

Is this because I'm passing too much 'data' into the listening external module ?

Thanks

 



Title: Re: How to Remove a Caller from a Conference without Hanging Up
Post by: marian on September 24, 2018, 11:53:18 PM
You are passing a very long line.
This can be a yate message or a very long debug message.
Title: Re: How to Remove a Caller from a Conference without Hanging Up
Post by: jamie on November 06, 2018, 09:42:44 PM


To remove a channel from a conference it is a simple as issuing the following:

$chan_id = sip/123456

$m = new Yate('chan.masquerade');
$m->SetParam('message','call.execute');
$m->SetParam('callto', 'wave/play/-');
$m->SetParam('id', $chan_id   );
$m->Dispatch();


This is a PHP implementation, but the theory is the same as the important parts are the messages.