Skip to content

Commit

Permalink
Merge branch 'master' of github.com:srt/asterisk-java
Browse files Browse the repository at this point in the history
  • Loading branch information
srt committed Oct 6, 2011
2 parents d2eafa5 + 0990f81 commit 7cb4f3d
Show file tree
Hide file tree
Showing 5 changed files with 375 additions and 0 deletions.
Expand Up @@ -319,10 +319,16 @@ protected void handleEvent(ZapShowChannelsCompleteEvent event)
{
}

protected void handleEvent(DahdiShowChannelsCompleteEvent event)
{
}
protected void handleEvent(ZapShowChannelsEvent event)
{
}

protected void handleEvent(DahdiShowChannelsEvent event)
{
}
protected void handleEvent(CoreShowChannelEvent event)
{
}
Expand Down Expand Up @@ -598,10 +604,18 @@ else if (event instanceof ZapShowChannelsCompleteEvent)
{
handleEvent((ZapShowChannelsCompleteEvent) event);
}
else if (event instanceof DahdiShowChannelsCompleteEvent)
{
handleEvent((DahdiShowChannelsCompleteEvent) event);
}
else if (event instanceof ZapShowChannelsEvent)
{
handleEvent((ZapShowChannelsEvent) event);
}
else if (event instanceof DahdiShowChannelsEvent)
{
handleEvent((DahdiShowChannelsEvent) event);
}
else if (event instanceof CoreShowChannelEvent)
{
handleEvent((CoreShowChannelEvent) event);
Expand Down
@@ -0,0 +1,62 @@
/*
* Copyright 2004-2006 Stefan Reuter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.asteriskjava.manager.action;

import org.asteriskjava.manager.event.DahdiShowChannelsCompleteEvent;
import org.asteriskjava.manager.event.ResponseEvent;

/**
* The DahdiShowChannelsAction requests the state of all Dahdi channels.<p>
* For each Dahdi channel aDahdiShowChannelsEvent is generated. After all Dahdi
* channels have been listed a DahdiShowChannelsCompleteEvent is generated.
*
* @see org.asteriskjava.manager.event.DahdiShowChannelsEvent
* @see org.asteriskjava.manager.event.DahdiShowChannelsCompleteEvent
* @author srt
* @version $Id$
*/
public class DahdiShowChannelsAction extends AbstractManagerAction
implements
EventGeneratingAction
{
/**
* Serializable version identifier
*/
private static final long serialVersionUID = 8697000330085766825L;

/**
* Creates a new DahdiShowChannelsAction.
*/
public DahdiShowChannelsAction()
{

}

/**
* Returns the name of this action, i.e. "DahdiShowChannels".
*/
@Override
public String getAction()
{
return "DahdiShowChannels";
}

public Class<? extends ResponseEvent> getActionCompleteEventClass()
{
return DahdiShowChannelsCompleteEvent.class;
}
}
@@ -0,0 +1,92 @@
/*
* Copyright 2004-2006 Stefan Reuter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.asteriskjava.manager.event;

/**
* A DahdiShowChannelsCompleteEvent is triggered after the state of all Dahdi channels has been reported
* in response to a DahdiShowChannelsAction.
*
* @see org.asteriskjava.manager.action.DahdiShowChannelsAction
* @see org.asteriskjava.manager.event.DahdiShowChannelsEvent
*
* @author srt
* @version $Id$
*/
public class DahdiShowChannelsCompleteEvent extends ResponseEvent
{
/**
* Serial version identifier
*/
private static final long serialVersionUID = 6323249250335885462L;

private Integer listitems;
private String eventlist;
private Integer items;

public Integer getItems() {
return items;
}

public void setItems(Integer items) {
this.items = items;
}

/**
* @param source
*/
public DahdiShowChannelsCompleteEvent(Object source)
{
super(source);
}

/**
* Returns if the status of the eventlist (should be Complete).<p>
*
* @return the status of the list.
* @since 1.0.0
*/
public String getEventlist()
{
return eventlist;
}

public void setEventlist(String eventlist)
{
this.eventlist = eventlist;
}

/**
* Returns the number of channels reported.<p>
*
* @return the number of channels reported.
*/
public Integer getListitems()
{
return listitems;
}

/**
* Sets the number of channels reported.<p>
*
* @param items the number of channels reported.
*/
public void setListitems(Integer listitems)
{
this.listitems = listitems;
}

}
@@ -0,0 +1,204 @@
/*
* Copyright 2004-2006 Stefan Reuter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.asteriskjava.manager.event;

/**
* A DahdiShowChannelsEvent is triggered in response to a DahdiShowChannelsAction and shows the state of
* a Dahdi channel.
*
* @see org.asteriskjava.manager.action.DahdiShowChannelsAction
*
* @author srt
* @version $Id$
*/
public class DahdiShowChannelsEvent extends ResponseEvent
{
/**
* Serial version identifier
*/
private static final long serialVersionUID = -3613642267527361400L;
private Integer Dahdichannel;
private String signalling;
private String signallingcode;
private String context;
private Boolean dnd;
private String alarm;
private String uniqueid;
private String accountcode;
private String channel;

public String getAccountcode() {
return accountcode;
}

public void setAccountcode(String accountcode) {
this.accountcode = accountcode;
}

public String getChannel() {
return channel;
}

public void setChannel(String channel) {
this.channel = channel;
}

public Integer getDahdichannel() {
return Dahdichannel;
}

public void setDahdichannel(Integer Dahdichannel) {
this.Dahdichannel = Dahdichannel;
}

public String getSignallingcode() {
return signallingcode;
}

public void setSignallingcode(String signallingcode) {
this.signallingcode = signallingcode;
}

public String getUniqueid() {
return uniqueid;
}

public void setUniqueid(String uniqueid) {
this.uniqueid = uniqueid;
}




/**
* @param source
*/
public DahdiShowChannelsEvent(Object source)
{
super(source);
}


/**
* Returns the signalling of this Dahdi channel.<p>
* Possible values are:
* <ul>
* <li>E & M Immediate</li>
* <li>E & M Wink</li>
* <li>E & M E1</li>
* <li>Feature Group D (DTMF)</li>
* <li>Feature Group D (MF)</li>
* <li>Feature Group B (MF)</li>
* <li>E911 (MF)</li>
* <li>FXS Loopstart</li>
* <li>FXS Groundstart</li>
* <li>FXS Kewlstart</li>
* <li>FXO Loopstart</li>
* <li>FXO Groundstart</li>
* <li>FXO Kewlstart</li>
* <li>PRI Signalling</li>
* <li>R2 Signalling</li>
* <li>SF (Tone) Signalling Immediate</li>
* <li>SF (Tone) Signalling Wink</li>
* <li>SF (Tone) Signalling with Feature Group D (DTMF)</li>
* <li>SF (Tone) Signalling with Feature Group D (MF)</li>
* <li>SF (Tone) Signalling with Feature Group B (MF)</li>
* <li>GR-303 Signalling with FXOKS</li>
* <li>GR-303 Signalling with FXSKS</li>
* <li>Pseudo Signalling</li>
* </ul>
*/
public String getSignalling()
{
return signalling;
}

/**
* Sets the signalling of this Dahdi channel.
*/
public void setSignalling(String signalling)
{
this.signalling = signalling;
}



/**
* Returns the context of this Dahdi channel as defined in <code>chan_Dahdi.conf</code>.
*/
public String getContext()
{
return context;
}

/**
* Sets the context of this Dahdi channel.
*/
public void setContext(String context)
{
this.context = context;
}

/**
* Returns whether dnd (do not disturb) is enabled for this Dahdi channel.
*
* @return Boolean.TRUE if dnd is enabled, Boolean.FALSE if it is disabled,
* <code>null</code> if not set.
* @since 0.3
*/
public Boolean getDnd()
{
return dnd;
}

/**
* Sets whether dnd (do not disturb) is enabled for this Dahdi channel.
*
* @param dnd Boolean.TRUE if dnd is enabled, Boolean.FALSE if it is disabled.
* @since 0.3
*/
public void setDnd(Boolean dnd)
{
this.dnd = dnd;
}

/**
* Returns the alarm state of this Dahdi channel.<p>
* This may be one of
* <ul>
* <li>Red Alarm</li>
* <li>Yellow Alarm</li>
* <li>Blue Alarm</li>
* <li>Recovering</li>
* <li>Loopback</li>
* <li>Not Open</li>
* <li>No Alarm</li>
* </ul>
*/
public String getAlarm()
{
return alarm;
}

/**
* Sets the alarm state of this Dahdi channel.
*/
public void setAlarm(String alarm)
{
this.alarm = alarm;
}
}

0 comments on commit 7cb4f3d

Please sign in to comment.