Class EslEvent
java.lang.Object
com.bytedesk.call.esl.client.transport.event.EslEvent
FreeSWITCH Event Socket events are decoded into this data object.
An ESL event is modelled as a collection of text lines. An event always has several eventHeader
lines, and optionally may have some eventBody lines. In addition the messageHeaders of the
original containing
EslMessage which carried the event are also available.
The eventHeader lines are parsed and cached in a map keyed by the eventHeader name string. An event
is always expected to have an "Event-Name" eventHeader. Commonly used eventHeader names are coded
in EslEventHeaderNames
Any eventBody lines are cached in a list.
The messageHeader lines from the original message are cached in a map keyed by EslHeaders.Name.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEslEvent(EslMessage rawMessage) EslEvent(EslMessage rawMessage, boolean parseCommandReply) -
Method Summary
Modifier and TypeMethodDescriptionAny event body lines that were present in the event.Convenience method.Convenience method.longConvenience method.The event headers of this event.Convenience method.The message headers of the original ESL message from which this event was decoded.booleanConvenience method.private voidparsePlainBody(List<String> rawBodyLines) toString()
-
Field Details
-
messageHeaders
-
eventHeaders
-
eventBody
-
decodeEventHeaders
private boolean decodeEventHeaders
-
-
Constructor Details
-
EslEvent
-
EslEvent
-
-
Method Details
-
getMessageHeaders
The message headers of the original ESL message from which this event was decoded. The message headers are stored in a map keyed byEslHeaders.Name. The string mapped value is the parsed content of the header line (ie, it does not include the header name).- Returns:
- map of header values
-
getEventHeaders
The event headers of this event. The headers are parsed and stored in a map keyed by the string name of the header, and the string mapped value is the parsed content of the event header line (ie, it does not include the header name).- Returns:
- map of event header values
-
getEventBodyLines
Any event body lines that were present in the event.- Returns:
- list of decoded event body lines, may be an empty list.
-
getEventName
Convenience method.- Returns:
- the string value of the event header "Event-Name"
-
getEventDateTimestamp
public long getEventDateTimestamp()Convenience method.- Returns:
- long value of the event header "Event-Date-Timestamp"
-
getEventDateLocal
Convenience method.- Returns:
- long value of the event header "Event-Date-Local"
-
getEventDateGmt
Convenience method.- Returns:
- long value of the event header "Event-Date-GMT"
-
hasEventBody
public boolean hasEventBody()Convenience method.- Returns:
- true if the eventBody list is not empty.
-
parsePlainBody
-
toString
-