sunlabs.brazil.asterisk
public static class AsteriskHandler.AmiStringMap extends StringMap
AMI responses are either:
--END COMMAND--Unfortunately, the first line of the following response can have a ":" in it, making it indistinguishable from another header [they should'a added a blank line after the last header]. We need to use some heuristics to figure out if it's a header or data. grumph!
XXX to do:
Any time data follows, the "ActionID" key (if present) will always
be the last key before the data starts. We could use that, or if
the data consists of what looks like headers, then just make them
headers, and don't stuff them into "data", which is sort-of what
happens now.
In the second case, all the response data is put in a header called:
data:
This is modelled after MimeHeaders.
Constructor Summary | |
---|---|
AmiStringMap() | |
AmiStringMap(StringMap map) |
Method Summary | |
---|---|
String | commandify(String id)
Turn an AmiMap into an asterisk command.
|
static String | commandify(StringMap map, String id) |
void | read(HttpInputStream in) |
Returns: null if there wasn't a valid command
UNKNOWN: id add the "id" at the end of the actionid