How can i mute/unmute/kick joined to conference call

626 views
Skip to first unread message

Alex Bondarenko

unread,
May 25, 2011, 8:48:14 PM5/25/11
to Adhearsion
Hello all,

Please help with subject. My installation quite simple, rails
application with adhearsion app in it. Have enabled_rails and drb in
config so rails and ad can talk. Flow is client call asterisk,
asterisk talk to adhearsion and adhearsion join client to one of the
conferences by simple @call.join(pin).

Question is how i can mute/unmute/kick already joined user from my
rails app? How i can get access to joined client in adhearsion? I
tried call = Adhearsion.active_calls.find(unique_ident) but seems like
just bunch of data,
can't call much methods on it. What is the solution here?

Thank you for help!
-Alex

Ben Klang

unread,
May 25, 2011, 10:35:01 PM5/25/11
to adhea...@googlegroups.com
You are right.  At the moment Adhearsion does not have awareness in Adhearsion::Call objects that recognize the state of the call (ie. "on a conference"), much less helper methods to directly manipulate them.  However, what you are trying to do is still possible.  It will depend on which Asterisk conferencing module you are using.  For the sake of argument, I will assume you are using MeetMe.

You will need to construct a new AMI message to perform an action on the channel in question.  The Adhearsion::Call objects do give you a handle on the channel unique ID, but keep in mind that this list is limited to those calls which actively have a connection to Adhearsion AGI (which may or may not be the case, depending on how your calls got into the conference).  To get what you want, you would do something like:

@manager = Adhearsion::VoIP::Asterisk.manager_interface
@manager.send_action 'MeetmeMute', :Meetme => room_number, :Usernum => ???

To be honest, I'm not exactly sure how to get the Usernum since I don't use Meetme.  But you can read more about the AMI commands that are available here:

Don't forget to rescue exceptions from send_action, in case of a ManagerInterfaceError.

/BAK/


Thank you for help!
-Alex

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to adhea...@googlegroups.com.
To unsubscribe from this group, send email to adhearsion+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en.


Alex Bondarenko

unread,
May 30, 2011, 3:56:33 PM5/30/11
to Adhearsion
Hey BAK!

Thank you for your response! You was right, AMI is what i was need to
look into.

Problem solved by config.asterisk.enable_ami in startup.rb and using
it from rails app via drb, like:
AdhearsionRemote.send_action 'MeetmeMute', :Meetme => "8081", :Usernum
=> "2"

where AdhearsionRemote defined as:

AdhearsionRemote = DRbObject.new_with_uri "druby://localhost:9050"

in initializers/.

I also check standalone.rb file in adhearsion's examples.
But basically it was your post who point me in correct direction, so i
really appreciate that!

-Alex

Alex Bondarenko

unread,
May 30, 2011, 4:59:38 PM5/30/11
to Adhearsion
One more question though, can't find action in AMI for kick user from
conference?
Is there any? or what is correct way to do that if not AMI?

-Alex

On May 26, 5:35 am, Ben Klang <bkl...@mojolingo.com> wrote:

Ben Langfeld

unread,
May 31, 2011, 7:16:16 AM5/31/11
to adhea...@googlegroups.com
There is an AMI command 'meetme kick', though documentation is (as ever) sparse. It takes an ID that you can find from 'meetme list'.

Regards,
Ben Langfeld

Alex Bondarenko

unread,
May 31, 2011, 7:24:06 AM5/31/11
to Adhearsion
Hey Ben,

Can you please point me to doc where it described?
meetme kick it's meetmeadmin command which don't available in ami
afaik.

At least i don't see it in ami commands list
http://www.voip-info.org/wiki/view/Asterisk+manager+API.

And i just tried meetme kick like this:
AdhearsionRemote.send_action 'meetme kick 8081 1'

which return error for me.

Am i doing something wrong?

-Alex

Ben Langfeld

unread,
May 31, 2011, 7:43:16 AM5/31/11
to adhea...@googlegroups.com
As I say, the documentation is virtually non-existant. The best I could find was Web-MeetMe (http://sourceforge.net/projects/web-meetme/), conf_actions.php#28 which reads:

if (($action=="mute") || ($action=="unmute") || ($action=="kick") ){
$res = $as->Command("meetme $action $confno $user_id");
sleep(1);
}

I don't use MeetMe, so I'm afraid I can't expand on that.

Regards,
Ben Langfeld

Ben Klang

unread,
May 31, 2011, 9:18:49 AM5/31/11
to adhea...@googlegroups.com
On May 31, 2011, at 7:24 AM, Alex Bondarenko wrote:

Hey Ben,

Can you please point me to doc where it described?
meetme kick it's meetmeadmin command which don't available in ami
afaik.


There are a couple of good resources:


I do not see a direct AMI action to kick a user, but using AMI you can also execute any CLI command.  Here's some documentation on a "kick" CLI command:

Or, on the Asterisk console, type:
"meetme help"

Worst case, go to the Asterisk sources directly (yeah, bad answer, I know).


/BAK/
-- 
Ben Klang

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Alex Bondarenko

unread,
May 31, 2011, 10:45:31 AM5/31/11
to Adhearsion
Ben, BAK,

Thank you for your responses. You both were right.
I wasn't aware about possibility to run CLI commands via AMI.
But then i saw this http://www.voip-info.org/wiki/index.php?page=Asterisk+Manager+API+Action+Command

and then figured out correct way to do that:

AdhearsionRemote.send_action "Command", :command => 'meetme kick 6 1'

Thank you guys!

-Alex

On May 31, 4:18 pm, Ben Klang <bkl...@mojolingo.com> wrote:
> On May 31, 2011, at 7:24 AM, Alex Bondarenko wrote:
>
> > Hey Ben,
>
> > Can you please point me to doc where it described?
> > meetme kick it's meetmeadmin command which don't available in ami
> > afaik.
>
> There are a couple of good resources:
>
> https://wiki.asterisk.org/wiki/display/AST/AMI+Actions
>
> I do not see a direct AMI action to kick a user, but using AMI you can also execute any CLI command.  Here's some documentation on a "kick" CLI command:http://www.voip-info.org/wiki/view/Asterisk+cmd+MeetMe
>
> Or, on the Asterisk console, type:
> "meetme help"
>
> Worst case, go to the Asterisk sources directly (yeah, bad answer, I know).
>
> /BAK/
> --
> Ben Klang
> bkl...@mojolingo.com
> 404.475.4841
>
> Mojo Lingo -- Voice applications that work like magichttp://mojolingo.com
Reply all
Reply to author
Forward
0 new messages