Author Topic: How to Remove a Caller from a Conference without Hanging Up  (Read 223 times)

jamie

  • Newbie
  • *
  • Posts: 36
    • View Profile
How to Remove a Caller from a Conference without Hanging Up
« 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

 




« Last Edit: September 16, 2018, 09:31:21 PM by jamie »

marian

  • Sr. Member
  • ****
  • Posts: 484
    • View Profile
Re: How to Remove a Caller from a Conference without Hanging Up
« Reply #1 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.

jamie

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: How to Remove a Caller from a Conference without Hanging Up
« Reply #2 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?


marian

  • Sr. Member
  • ****
  • Posts: 484
    • View Profile
Re: How to Remove a Caller from a Conference without Hanging Up
« Reply #3 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.

jamie

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: How to Remove a Caller from a Conference without Hanging Up
« Reply #4 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

 




marian

  • Sr. Member
  • ****
  • Posts: 484
    • View Profile
Re: How to Remove a Caller from a Conference without Hanging Up
« Reply #5 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.

jamie

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: How to Remove a Caller from a Conference without Hanging Up
« Reply #6 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.