Skip to content

Commit fc87680

Browse files
authored
add hangup handlers (#500)
1 parent 7719841 commit fc87680

2 files changed

Lines changed: 155 additions & 0 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* Copyright 2004-2006 Stefan Reuter
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
package org.asteriskjava.manager.event;
18+
19+
/**
20+
* A HangupHandlerPushEvent is triggered when a channel pushes a hangup handler.
21+
* <p>
22+
* It is implemented in <code>channel.c</code>
23+
*
24+
* @author srt
25+
* @version $Id$
26+
*/
27+
public class HangupHandlerPushEvent extends AbstractChannelStateEvent {
28+
/**
29+
* Serializable version identifier.
30+
*/
31+
static final long serialVersionUID = 0L;
32+
33+
private String language;
34+
private String linkedId;
35+
36+
private String handler;
37+
38+
public HangupHandlerPushEvent(Object source) {
39+
super(source);
40+
}
41+
42+
public String getLanguage() {
43+
return language;
44+
}
45+
46+
public void setLanguage(String language) {
47+
this.language = language;
48+
}
49+
50+
public String getLinkedId() {
51+
return linkedId;
52+
}
53+
54+
public void setLinkedId(String linkedId) {
55+
this.linkedId = linkedId;
56+
}
57+
58+
public String getHandler() {
59+
return handler;
60+
}
61+
62+
public void setHandler(String handler) {
63+
this.handler = handler;
64+
}
65+
@Override
66+
public String toString() {
67+
StringBuilder builder = new StringBuilder();
68+
builder.append("HangupHandlerPush [language=");
69+
builder.append(language);
70+
builder.append(", linkedId=");
71+
builder.append(linkedId);
72+
builder.append(", accountCode=");
73+
builder.append(accountCode);
74+
builder.append("]");
75+
return builder.toString();
76+
}
77+
78+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright 2004-2006 Stefan Reuter
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
package org.asteriskjava.manager.event;
18+
19+
/**
20+
* A HangupHandlerRunEvent is triggered when a hangup handler is run.
21+
* <p>
22+
* It is implemented in <code>channel.c</code>
23+
*
24+
* @author srt
25+
* @version $Id$
26+
*/
27+
public class HangupHandlerRunEvent extends AbstractChannelStateEvent {
28+
/**
29+
* Serializable version identifier.
30+
*/
31+
static final long serialVersionUID = 0L;
32+
33+
private String language;
34+
private String linkedId;
35+
private String handler;
36+
37+
public HangupHandlerRunEvent(Object source) {
38+
super(source);
39+
}
40+
41+
public String getLanguage() {
42+
return language;
43+
}
44+
45+
public void setLanguage(String language) {
46+
this.language = language;
47+
}
48+
49+
public String getLinkedId() {
50+
return linkedId;
51+
}
52+
53+
public void setLinkedId(String linkedId) {
54+
this.linkedId = linkedId;
55+
}
56+
57+
public String getHandler() {
58+
return handler;
59+
}
60+
61+
public void setHandler(String handler) {
62+
this.handler = handler;
63+
}
64+
@Override
65+
public String toString() {
66+
StringBuilder builder = new StringBuilder();
67+
builder.append("HangupHandlerRun [language=");
68+
builder.append(language);
69+
builder.append(", linkedId=");
70+
builder.append(linkedId);
71+
builder.append(", accountCode=");
72+
builder.append(accountCode);
73+
builder.append("]");
74+
return builder.toString();
75+
}
76+
77+
}

0 commit comments

Comments
 (0)