|
3 | 3 | /**
|
4 | 4 | * AgiExecEvents are triggered when an AGI command is executed. For each command two events are triggered:
|
5 | 5 | * one before excution ("Start") and one after execution ("End").
|
6 |
| - * <p> |
| 6 | + * <p/> |
7 | 7 | * The following sub events are reported:
|
8 | 8 | * <ul>
|
9 | 9 | * <li>Start: Execution of an AGI command has started.</li>
|
@@ -39,6 +39,7 @@ public class AgiExecEvent extends ManagerEvent
|
39 | 39 | private String commandId;
|
40 | 40 | private String command;
|
41 | 41 | private Integer resultCode;
|
| 42 | + private String result; |
42 | 43 |
|
43 | 44 | /**
|
44 | 45 | * Creates a new AgiExecEvent.
|
@@ -74,6 +75,8 @@ public void setChannel(String channel)
|
74 | 75 | * Returns the sub event type. This is either "Start" or "End".
|
75 | 76 | *
|
76 | 77 | * @return the sub event type.
|
| 78 | + * @see #SUB_EVENT_START |
| 79 | + * @see #SUB_EVENT_END |
77 | 80 | */
|
78 | 81 | public String getSubEvent()
|
79 | 82 | {
|
@@ -131,16 +134,55 @@ public void setCommand(String command)
|
131 | 134 | this.command = command;
|
132 | 135 | }
|
133 | 136 |
|
| 137 | + /** |
| 138 | + * Returns the result code. |
| 139 | + * |
| 140 | + * @return the result code. |
| 141 | + */ |
134 | 142 | public Integer getResultCode()
|
135 | 143 | {
|
136 | 144 | return resultCode;
|
137 | 145 | }
|
138 | 146 |
|
| 147 | + /** |
| 148 | + * Sets the result code. |
| 149 | + * |
| 150 | + * @param resultCode the result code. |
| 151 | + */ |
139 | 152 | public void setResultCode(Integer resultCode)
|
140 | 153 | {
|
141 | 154 | this.resultCode = resultCode;
|
142 | 155 | }
|
143 | 156 |
|
| 157 | + /** |
| 158 | + * Returns the result as a string.<p> |
| 159 | + * They correspond to the numeric values returned by {@link #getResultCode()}. Usually you will want to |
| 160 | + * stick with the numeric values.<p> |
| 161 | + * Possible values are: |
| 162 | + * <ul> |
| 163 | + * <li>Failure (corresponds to result code -1)</li> |
| 164 | + * <li>Success (corresponds to result code 200)</li> |
| 165 | + * <li>KeepAlive (corresponds to result code 210)</li> |
| 166 | + * <li>Command not permitted on a dead channel (corresponds to result code 511)</li> |
| 167 | + * <li>Usage (corresponds to result code 520)</li> |
| 168 | + * </ul> |
| 169 | + * |
| 170 | + * @return a string respresentation of the result. |
| 171 | + */ |
| 172 | + public String getResult() |
| 173 | + { |
| 174 | + return result; |
| 175 | + } |
| 176 | + |
| 177 | + /** |
| 178 | + * Sets the string respresentation of the result. |
| 179 | + * |
| 180 | + * @param result a string respresentation of the result. |
| 181 | + */ |
| 182 | + public void setResult(String result) |
| 183 | + { |
| 184 | + this.result = result; |
| 185 | + } |
144 | 186 |
|
145 | 187 | /**
|
146 | 188 | * Checks is this a start sub event.
|
|
0 commit comments