Reference of IPublicGWPlugin

Description of IPublicGWPlugin. IPublicGWPlugin is in Plugin V4 and above.

In plug-in, developers can use internal API of publicgw server.

IPTTPlugin4 IVideoPlugin3 IAdminWebPlugin2

ICallback

In plug-in, a developer can use internal API of Public-GW server.

getDBConnection

Connection getDBConnection()
Returnjava.sql.Connection
DescriptionGet DB connection from DB connection pool in server.
Common library version4.0.x

login

int login(PTTUser user)
usercurrent seesion's user information. id is mandatory.
Descriptionlogin by user
Common library version4.0.x

logout

int logout(PTTUser user)
usercurrent seesion's user information. id is mandatory.
Descriptionlogout by user
Common library version4.0.x

join

int join(PTTUser user, PTTChannel channel)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
Descriptionjoin to a channel
Common library version4.0.x

leave

int leave(PTTUser user, PTTChannel channel)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
Descriptionleave from a channel
Common library version4.0.x

lock

int lock(PTTUser user, PTTChannel channel)
int lock(PTTUser user, PTTChannel channel, float latitude, float longitude)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
Descriptionlock a channel(index is 0)
Common library version4.0.x

unlock

int unlock(PTTUser user, PTTChannel channel)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
Descriptionunlock a channel(index is 0)
Common library version4.0.x

sendAudioPTT

int sendAudioPTT(PTTUser user, PTTChannel channel, byte[] waveFrame, int offset, int length320)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
waveFramedata buffer
offsetoffset
length320data length. it must be 320.
Descriptionsend an audio frame to a channel(index is 0)
Common library version4.0.x

sendMesssage

int sendMesssage(PTTUser user, PTTChannel channel, String message)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
messageutf8 message
Descriptionsend a text message to a channel
Common library version4.0.x

sendCustomMesssage

int sendCustomMesssage(PTTUser user, PTTChannel channel, int messageId, String base64message)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
messageIdmessage's id. a developer can define it.
base64messagebase64 encoded message
Descriptionsend a custom message(like an image) to a channel
Common library version4.0.x

sendSOS

int sendSOS(PTTUser user, PTTChannel channel, float latitude, float longitude)
usercurrent seesion's user information. id is mandatory.
channelcurrent channel's information. id is mandatory.
latitudeuser's location
longitudeuser's location
Descriptionsend a SOS event to a channelg
Common library version4.0.x

updateLocation

int updateLocation(PTTUser user, float latitude, float longitude)
usercurrent seesion's user information. id is mandatory.
latitudeuser's location
longitudeuser's location
Descriptionupdate an user's location
Common library version4.0.x

writeLog

void writeLog(String message)
messagelog message
DescriptionWrite log in {ProPTT server dir}/logs/service/Public.service.log
Common library version4.0.x

writeErrorLog

void writeErrorLog(String message)
messagelog message
DescriptionWrite error log in {ProPTT server dir}/logs/service/Public.service.log
Common library version4.0.x

OnInitialized

void OnInitialized()
DescriptionNotify initialized to Public-GW server.
Common library version4.0.x

IPublicGWPlugin

getInterfaceVersion

int getInterfaceVersion()
Returnmost be retured INTERFACE_VERSION
DescriptionNotify plug-in's INTERFACE version
Common library version4.0.x

getType

int getType()
Returnmost be retured TYPE_GENERAL_PLUGIN
DescriptionNotify plug-in's type
Common library version4.0.x

initialize

boolean initialize(String arg)
Returnresult of initialize
Descriptioninitialize plug-in
Common library version4.0.x

OnLogin

void OnLogin(PTTUser user)
usercurrent seesion's user information
DescriptionAn user loged in
Common library version4.0.x

OnLogout

void OnLogout(PTTUser user, boolean byDuplication)
usercurrent seesion's user information
byDuplicationIt is true. the user loged in on another device.
DescriptionAn user loged out
Common library version4.0.x

OnJoined

void OnJoined(PTTUser user, PTTChannel channel, PTTUser joinedUser)
usercurrent seesion's user information
channelcurrent channel's information
joinedUserjoined user
DescriptionAn user is joined.
Common library version4.0.x

OnLeaved

void OnLeaved(PTTUser user, PTTChannel channel, PTTUser leavedUser)
usercurrent seesion's user information
channelcurrent channel's information
leavedUserleaved user
DescriptionAn user is leaved.
Common library version4.0.x

OnLocked

void OnLocked(PTTUser user, PTTChannel channel, PTTUser lockUser, int lockIndex, int mediaProfileId, String userLocation, String audioCodec, String videoCodec, String jsonParams)
usercurrent seesion's user information
channelcurrent channel's information
lockUserlocker
lockIndex0: normal PTT channel. 1:master's channel
mediaProfileIdmedia information ID
userLocationlocker's location
audioCodecaudio's codec parameter. not used
videoCodecvideo's codec parameter. not used
jsonParamsextended parameters
DescriptionA channel is locked
Common library version4.0.x

OnUnlocked

void OnUnlocked(PTTUser user, PTTChannel channel, PTTUser unlockUser, int lockIndex)
usercurrent seesion's user information
channelcurrent channel's information
unlockUserlocker
lockIndex0: normal PTT channel. 1:master's channel
DescriptionA channel is unlocked
Common library version4.0.x

OnAudioPTTReceived

void OnAudioPTTReceived(PTTUser user, PTTChannel channel, int lockIndex, int timestamp, byte[] waveFrame, int offset, int length)
usercurrent seesion's user information
channelcurrent channel's information
lockIndex0: normal PTT channel. 1:master's channel
timestampframe time
waveFramewave data
offsetoffset
lengthdata length
DescriptionAn audio frame is received
Common library version4.0.x

OnVideoPTTReceived

void OnVideoPTTReceived(PTTUser user, PTTChannel channel, int lockIndex, int timestamp, byte[] jpegFrame, int offset, int length)
usercurrent seesion's user information
channelcurrent channel's information
lockIndex0: normal PTT channel. 1:master's channel
timestampframe time
jpegFramejpeg data
offsetoffset
lengthdata length
DescriptionA video frame is received
Common library version4.0.x

OnMessageReceived

void OnMessageReceived(PTTUser user, PTTChannel channel, PTTUser sentUser, String message)
usercurrent seesion's user information
channelcurrent channel's information
sentUsersent user
messageutf8 message
DescriptionA text message is received.
Common library version4.0.x

OnCustomMessageReceived

void OnCustomMessageReceived(PTTUser user, PTTChannel channel, PTTUser sentUser, int messageId, String base64Message)
usercurrent seesion's user information
channelcurrent channel's information
sentUsersent user
messageIdmessage's Id
base64Messagebase64 encoded message
DescriptionA custom message is received.
Common library version4.0.x

OnSOSReceived

void OnSOSReceived(PTTUser user, PTTChannel channel, PTTUser sentUser, String userLocation)
usercurrent seesion's user information
channelcurrent channel's information
sentUsersent user
userLocationuser's location
DescriptionA SOS event is fired.
Common library version4.0.x

OnVideoShared

void OnVideoShared(PTTUser user, PTTChannel channel, PTTUser sharedUser, int videoChannelId, String serverIP, int serverPort, boolean useSSL, String token, String jsonParams)
usercurrent seesion's user information
channelcurrent channel's information
sharedUsershared user
videoChannelIdvideo channel's id
serverIPvideo server's IP
serverPortvideo server's port
useSSLwhether SSL is used
tokenvideo server's session token
jsonParamsextended parameters
DescriptionA video stream is shared in a channel.
Common library version4.0.x

OnVideoUnshared

void OnVideoUnshared(PTTUser user, PTTChannel channel, PTTUser unsharedUser, int videoChannelId)
usercurrent seesion's user information
channelcurrent channel's information
unsharedUsershared user
videoChannelIdvideo channel's id
DescriptionA video stream is unshared in a channel.
Common library version4.0.x

OnFileShared

void OnFileShared(PTTUser user, PTTChannel channel, PTTUser sharedUser, int fileChannelId, String serverIP, int serverPort, boolean useSSL, String token, String jsonParams)
usercurrent seesion's user information
channelcurrent channel's information
sharedUsershared user
fileChannelIdfile channel's id
serverIPvideo server's IP
serverPortvideo server's port
useSSLwhether SSL is used
tokenvideo server's session token
jsonParamsextended parameters
DescriptionA file is shared in a channel.
Common library version4.0.x

OnFileUnshared

void OnFileUnshared(PTTUser user, PTTChannel channel, PTTUser unsharedUser, int fileChannelId)
usercurrent seesion's user information
channelcurrent channel's information
unsharedUsershared user
fileChannelIdA file is unshared in a channel.
Descriptionfired error
Common library version4.0.x

OnError

void OnError(int errCode, String jsonParams)
errCodeerror code. not defined
jsonParamsextended parameters
Descriptionfired error
Common library version4.0.x

OnExtenedEvent

void OnExtenedEvent(String cmdName, String jsonParams)
cmdNamecommend name. not defined
jsonParamsextended parameters
DescriptionFired an extended event
Common library version4.0.x