All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.asteriskjava.pbx.asterisk.wrap.userEvents.UserEvent Maven / Gradle / Ivy

There is a newer version: 3.41.0
Show newest version
package org.asteriskjava.pbx.asterisk.wrap.userEvents;

import org.asteriskjava.pbx.Channel;
import org.asteriskjava.pbx.InvalidChannelName;
import org.asteriskjava.pbx.PBXFactory;
import org.asteriskjava.pbx.asterisk.wrap.events.ManagerEvent;
import org.asteriskjava.pbx.internal.core.AsteriskPBX;

public class UserEvent extends ManagerEvent
{
    private static final long serialVersionUID = 1L;

    private Channel channel;

    public UserEvent(org.asteriskjava.manager.event.UserEvent source, Channel channel)
    {
        super(source);
        this.channel = channel;
    }

    public UserEvent(org.asteriskjava.manager.event.UserEvent event) throws InvalidChannelName
    {
        super(event);

        AsteriskPBX pbx = (AsteriskPBX) PBXFactory.getActivePBX();
        this.channel = pbx.internalRegisterChannel(event.getChannel(), event.getUniqueId());
    }

    public Channel getChannel()
    {
        return this.channel;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy