Reference of IPTTPlugin
Description of IPTTPlugin
Removed at server 9.1.x
IVideoPlugin
ICallback
In plug-in, a developer can use internal API of PTT server.
getDBConnection
| Connection getDBConnection() |
| Return | java.sql.Connection |
| Description | Get DB connection from DB connection pool in server. |
| Common library version | 1.0.x |
writeLog
| void writeLog(String message) |
| message | log message |
| Description | Write log in {ProPTT server dir}/logs/service/PTT.service.log |
| Common library version | 1.0.x |
writeErrorLog
| void writeErrorLog(String message) |
| message | log message |
| Description | Write error log in {ProPTT server dir}/logs/service/PTT.service.log |
| Common library version | 1.0.x |
OnInitialized
| void OnInitialized() |
| Description | Notify initialized to PTT server. |
| Common library version | 1.0.x |
IPTTPlugin
getInterfaceVersion
| int getInterfaceVersion() |
| Return | most be retured INTERFACE_VERSION |
| Description | Notify plug-in's INTERFACE version |
| Common library version | 1.0.x |
getType
| int getType() |
| Return | most be retured TYPE_GENERAL_PLUGIN |
| Description | Notify plug-in's type |
| Common library version | 1.0.x |
initialize
| boolean initialize(String arg) |
| arg | argument for initialization. It is on arg tag in system.xml. |
| Return | result of initialize |
| Description | initialize plug-in |
| Common library version | 1.0.x |
OnConnected
| void OnConnected(String userId, String jsonParams) |
| userId | connected user's id |
| jsonParams | extended parameters |
| Description | User connected event |
| Common library version | 1.0.x |
OnJoined
| void OnJoined(String userId, int channelId) |
| userId | joined user's id |
| channelId | joined channel id |
| Description | Channel joined event |
| Common library version | 1.0.x |
OnLocked
| void OnLocked(String userId, int channelId, int mediaProfileId, String userLocation, String audioCodec, String videoCodec, String encKey, String jsonParams) |
| userId | joined user's id |
| channelId | joined channel id |
| mediaProfileId | audio ptt or video ptt |
| userLocation | locked location |
| audioCodec | audio codec config |
| videoCodec | video codec condig |
| encKey | if an encrypted channel, encKey is required to decrypt |
| jsonParams | extended parameters |
| Description | Channel locked event |
| Common library version | 1.0.x |
OnPTT
| OnPTT(int channelId, byte[] frames) |
| channelId | joined channel id |
| frames | media frame |
| Description | each ptt packet event |
| Common library version | 1.0.x |
< frames format >
| field | type | bytes | Description |
| MediaTrackID | unsigned short | 2 | Media Track |
| FarmID | short | 2 | Farm’s ID |
| ChannelID | int | 4 | Channel’s ID |
| Timestamp | unsigned int | 4 | Timestamp |
| FrameType | byte | 1 | 0: Media, 1: CodecInfo |
| FrameInfo | byte | 1 | Audio(Frame Count) Video(0x1X:R-0, 0x2X:R-90, 0x3X: R-180, 0x4X:R-270 | 0xX0: Mid, 0xX1:End) |
| PadCount | byte | 1 | Padding size |
| Reserved | byte | 1 | Reserved |
| FrameData | byte[] | | Frame's data |
OnUnLocked
| void OnUnLocked(String userId, int channelId) |
| userId | unlocked user's id |
| channelId | unlocked channel id |
| Description | Channel unlocked event |
| Common library version | 1.0.x |
OnVideoShared
| void OnVideoShared(String userId, int channelId, int videoChannelId, String jsonParams) |
| userId | shared user's id |
| channelId | shared channel id |
| videoChannelId | shared video channel id |
| jsonParams | extended parameters |
| Description | In channel, video shared event |
| Common library version | 1.0.x |
OnUnVideoShared
| void OnUnVideoShared(String userId, int channelId, int videoChannelId) |
| userId | unshared user's id |
| channelId | unshared channel id |
| videoChannelId | unshared video channel id |
| Description | In channel, video unshared event |
| Common library version | 1.0.x |
OnText
| void OnText(String userId, int channelId, int messageId, String base64Message) |
| userId | user's id |
| channelId | channel id |
| messageId | message's id. it is not unique |
| base64Message | base64(message) |
| Description | In channel, sent text message |
| Common library version | 1.0.x |
OnCustomMessage
| void OnCustomMessage(String userId, int channelId, int messageId, String base64Message) |
| userId | user's id |
| channelId | channel id |
| messageId | message's id. it is not unique |
| base64Message | base64(message) |
| Description | In channel, sent custom message |
| Common library version | 1.0.x |
OnFunction
| OnFunction(String userId, int channelId, String latitude, String longitude, String functionName, String jsonParams) |
| userId | user's id |
| channelId | channel id |
| messageId | message's id. it is not unique |
| latitude | latitude |
| longitude | longitude |
| functionName | function's name. "sos"|"message:base64(message)"|"call-event"|and so on |
| jsonParams | extended parameters |
| Description | In channel, sent function call |
| Common library version | 1.0.x |
OnLocation
| void OnLocation(String userId, String latitude, String longitude) |
| userId | user's id |
| latitude | latitude |
| longitude | longitude |
| Description | User location is updated. |
| Common library version | 1.0.x |
OnLeaved
| void OnLeaved(String userId, int channelId) |
| userId | user's id |
| channelId | channel id |
| Description | User leaved channel |
| Common library version | 1.0.x |
OnDisconnected
| void OnDisconnected(String userId) |
| userId | user's id |
| Description | User disconnected |
| Common library version | 1.0.x |
OnError
| void OnError(int errCode, String jsonParams) |
| errCode | error code. not defined |
| jsonParams | extended parameters |
| Description | fired error |
| Common library version | 1.0.x |
OnExtenedEvent
| void OnExtenedEvent(String cmdName, String jsonParams) |
| cmdName | commend name. not defined |
| jsonParams | extended parameters |
| Description | Fired an extended event |
| Common library version | 1.0.x |