Reference of PTTChannel

Description of PTTChannel

PTTClient Group VideoChannel

PTTChannel Class

nametypeattributesdescription
channelIDintreadonlyChannel ID
channelNostringreadonlyChannel number
channelNamestringreadonlyChannel name
channelDescriptionstringreadonlyChannel description
channelNotificationstringreadonlyChannel notification
TOTintreadonlyTime Out Timer, second
recordablebooleanreadonlyIs a recordable channel. Client app can save PTTs on device. An administrator can select it on adminWeb.
encryptedbooleanreadonlyIs a encrypted channel. PTT data is encrypted. An administrator can select it on adminWeb.
shareLocationsbooleanreadonlyMember's locations cab be shared in a channel. An administrator can select it on adminWeb. (Android, Windows)
ownerIDstringreadonlyChannel Owner ID
ownerNamestringreadonlyChannel Owner Name
functionstringreadonlyFunction Key names
typestringreadonlyChannel Type
'G'roup,'1':1
statusintreadonlyStatus joined the Channel
10: Invited, 20:request subscribe, 30: subscribed
foregroundbooleanChannel's focus status
useVoxbooleanWhether to use vox for lock. It can work when this channel is on foreground and enableInternalLock is enabled. Please check them.
useBluetoothbooleanWhether to use bluetooth for lock. It can work when this channel is on foreground and enableInternalLock is enabled. Please check them.
enableInternalLockbooleanWhether to use internal lock by bluetooth or VOX. default is true.
lockMediaProfileIDintMedia Profile ID when locked
Belows are defined as constant.

PROFILE_ID_OPUS8_ONLY_VBR : Audio PTT VBR(Low)
PROFILE_ID_OPUS8_ONLY : Audio PTT(Middle)
PROFILE_ID_OPUS16_ONLY : Audio PTT(High)
PROFILE_ID_OPUS8_MJPEG_LOW : Video PTT(Low)
PROFILE_ID_OPUS8_MJPEG_MID : Video PTT(Middle)
PROFILE_ID_OPUS8_MJPEG_HIGH : Video PTT(High)
PROFILE_ID_OPUS16_MJPEG_LOW : Video PTT(Low)
PROFILE_ID_OPUS16_MJPEG_MID : Video PTT(Middle)
PROFILE_ID_OPUS16_MJPEG_HIGH : Video PTT(High)
peerLockMediaProfileIDintMedia Profile ID when locked
Uppers are defined as constant.(Android)
lockStatusintreadonly Status for PTT lock
0 : unlocked
1 : request unlock
2 : request lock
3 : locked by me
4 : locked by someone
joinStatusintreadonly Status for channel join
0 : leaved
1 : joined
playAmplificationint -50~100, default 0
enablePlayAudioboolean Audio play status
enableSendAudioboolean Audio send status
enablePlayVideoboolean Video play status
enableSendVideoboolean Video send status
playVolumeint 0~100 (Windows only)
Methods
Events

Methods

deleteChannel

int deleteChannel()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonChannelDeleted
DescriptionDelete PTT channel.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

updateChannel

int updateChannel(string ChannelAttributesJson)
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonChannelUpdated
DescriptionUpdate PTT channel informations.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

join

int join()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonJoined()
DescriptionStart PTT channel
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

leave

int leave()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonLeaved
DescriptionStop PTT channel
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

acceptSubscribe

int acceptSubscribe(string RequesterID, string RequesterName)
RequesterIDRequester's ID
RequesterNameRequester's Name
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionAccept requester's subscription.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

denySubscribe

int denySubscribe(string RequesterID, string RequesterName)
RequesterIDRequester's ID
RequesterNameRequester's Name
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionDeny requester's subscription.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

unsubscribe

int unsubscribe()
int unsubscribe(string UnsubscribedID)
UnsubscribedIDID to be unsubscribed (Android only)
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionUnsubscribe to channel.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

cancelSubscribe

int cancelSubscribe()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionRequest Cancel of subscribe to channel.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

invite

int invite(string ReceiverID)
ReceiverIDReceiver ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionInvite Receiver.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

acceptInvite

int acceptInvite(string RequesterID)
ReceiverIDRequester's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionResponse of PTTClient's invitation.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

denyInvite

int denyInvite(string RequesterID)
ReceiverIDRequester's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionResponse of PTTClient's invitation.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

cancelInvite

int cancelInvite(string RequesterID)
RequesterIDRequester's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionRequest Cancel of invite.
This method is for only app srvice. You can not use it for server package and cloud service.
Don't use it. System could be broken.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

lockPTT

int lockPTT()
int lockPTT(boolean Emergency)
EmergencyIf other user have a lock, break the lock and make a new lock for user
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonLocked
DescriptionRequest Channel lock to server
SDK version1.1.1, Lock(boolean Emergency) is in 1.2.0

unlockPTT

int unlockPTT()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonUnlocked
DescriptionRequest Channel unlock to server
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

sendPublicMessage

int sendPublicMessage(string Message)
MessageMax 200 characters
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a Message to all in same PTTChannel. Notice: Message's sequence is not guaranteed.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

sendPrivateMessage

int sendPrivateMessage(string ReceiverID, string Message)
ReceiverIDReceiver ID
MessageMax 200 characters
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a Private Message to Receiver. Notice: Message's sequence is not guaranteed.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

sendPublicCustomMessage

int sendPublicCustomMessage(byte[] DataBuffer, int DataLength)
DataBufferBuffer of data
DataLengthData size. Max size is 30KB.
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a CustomMessage to all. Notice: Message's sequence is not guaranteed.
Server version1.2.x~
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

sendPrivateCustomMessage

int sendPrivateCustomMessage(string ReceiverID, byte[] DataBuffer, int DataLength)
ReceiverIDReceiver ID
DataBufferBuffer of data
DataLengthData size. Max size is 30KB.
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a CustomMessage to Receiver. Notice: Message's sequence is not guaranteed.
Server version1.2.x~
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

callFunction

int callFunction(string FunctionName, string Parameter)
FunctionNameFunction's Name
ParameterFunction's Parameter
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonCallFunction
DescriptionCall channel's function
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

shareVideo

int shareVideo(int VideoChannelID)
int shareVideo(int videoChannelID,const char* serverIP, int port, bool useSSL, const char* cmToken, const char* protocol)
VideoChannelIDShared VideoChannel's ID
serverIPShared video source's IP. (Windows only)
portShared video source's port. (Windows only)
useSSLShared video source's ssl usage. (Windows only)
cmTokenShared video source's authentication token. (Windows only)
protocolShared video source's protocol. "IMPTTP", (Windows only)
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonVideoShared
DescriptionShare video with members
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

unshareVideo

int unshareVideo(int VideoChannelID)
VideoChannelIDUnshared VideoChannel's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonVideoUnshared
DescriptionUnshare video with members
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

setCameraPreview

int setCameraPreview(View Preview)
int setCameraPreview(View Preview, View Preview2)
PreviewCamera Preview
ios : UIView*
android : SurfaceView
window : HWND(C++),IntPtr(C#)
Preview2Camera Preview
android : SurfaceView, it is for Video quality
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet
Sample(Android)
In Layout,
<SurfaceView 
  android:id="@+id/surface_preview"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
/>

In Code,
SurfaceView surfacePreview = 
	(SurfaceView) findViewById(R.id.surface_preview); 
channel.setCameraPreview(surfacePreview);
channel.startPreview();
Sample(C#)
var wih = new WindowInteropHelper(window);
IntPtr hWnd = wih.Handle;
channel.SetVideoWindow(hWnd);

setPlayView

int setPlayView(View PlayView)
PlayViewVideo PlayView
ios : UIView*
android : com.imptt.propttsdk.media.view.VideoView
window : HWND(C++),IntPtr(C#)
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet
Sample(Android)
In Layout,
<com.imptt.propttsdk.media.view.VideoView
	android:id="@+id/surface_play_video"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
/>

In Code,
VideoView shareVideoPlayView = 
	(VideoView) findViewById(R.id.surface_play_video); 
channel.setPlayView(shareVideoPlayView); 
Sample(C#)
var wih = new WindowInteropHelper(window);
IntPtr hWnd = wih.Handle;
channel.SetVideoWindow(hWnd);

setAudioManager

void setAudioManager(IAudioManager AudioManager)
AudioManagerAudioManager instance
DescriptionCan use for external audio devices
Please refer to IAudioManager.
Android SDK2.1.1(Capturer only)
iOS SDK2.1.1(But not tested)
Windows SDKNot supported
Linux SDKNot supported yet

getLocations

int getLocations(string LastSearchedDate)
LastSearchedDateLocation will be searched after LastSearchedDate. if it is "", All. "yyyy-MM-dd HH:mm:ss", GMT0
DescriptionSearch member's location.
Expected EventsonLocations
Server version3.2.1~
Android SDK2.1.3
iOS SDKNot supported
Windows SDKNot supported
Linux SDKNot supported yet

Events

onPTTChannelError

void onPTTChannelError(PTTChannel ChannelInstance, int ErrorCode, string ErrorMesssage)
ChannelInstancePTTChannel instance of event
ErrorCodeError code. see Main 6
ErrorMesssageError message
DescriptionErrer event
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onPTTChannelResult

void onPTTChannelResult(PTTChannel ChannelInstance,int Seq, int ResultCode, string ResultMesssage)
ChannelInstancePTTChannel instance of event
SeqRequested Sequence ID
ResultCodeError code. see Main 7
ResultMesssageError message
DescriptionResult event for request
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onJoined

void onJoined(PTTChannel ChannelInstance, string MemberJson,int TotalUserCount)
void onJoined(PTTChannel ChannelInstance, string MemberID, string MemberName, int TotalUserCount)
ChannelInstanceChannel instance of event
MemberJsonJoined Member ID JsonArray
MemberIDJoined Member's ID
MemberNameJoined Member's Name for a guest
TotalUserCountTotal user count in channel
DescriptionUser is joined into a PTT channel.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onLeaved

void onLeaved(PTTChannel ChannelInstance, string MemberID)
ChannelInstanceChannel instance of event
MemeberIDLeaved Member's ID
DescriptionUser is leaved from a PTT channel
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onNotifyReceived

void onNotifyReceived(PTTChannel ChannelInstance, int NotifiedCode, string NotifiedData)
ChannelInstancePTTChannel instance of event
NotifiedCodeNotified code
NotifiedDataNotified data
DescriptionNotified from server.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onPublicMessageReceived

void onPublicMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, string Message)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
MessageMessage
DescriptionA public message is received from sender
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

OnPrivateMessageReceived

void onPrivateMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, string Message)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
MessageMessage
DescriptionA private message is received from sender.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onLocked

void onLocked(PTTChannel ChannelInstance, string Location, unsigned int MediaProfileID, string LockerID, string LockerName)
ChannelInstanceChannel instance of event
LocationLocked user's location. If "", unknown
MediaProfileID
LockerIDLocker's ID
LockerNameLocker's Name for a guest
DescriptionChannel is locked by me or peer.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onUnlocked

void onUnlocked(PTTChannel ChannelInstance, string LockerID)
ChannelInstanceChannel instance of event
LockerIDLocker's ID
DescriptionChannel is unlocked by me or peer.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onTrackDataCaptured

void onTrackDataCaptured(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: no event
Audio: RAW, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is captured from device.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onTrackDataEncoded

void onTrackDataEncoded(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: JPEG, 1 frame
Audio: OPUS, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is encoded by encoder.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onTrackDataReceived

void onTrackDataReceived(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: JPEG, 1 frame
Audio: OPUS, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is received from server. If you save the PTT, you can wite this frame into Opus or your defined file.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onTrackDataRendered

void onTrackDataRendered(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: no event
Audio: RAW, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is rendered to device. If you save the PTT, you can wite this frame into wave file.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onPublicCustomMessageReceived

void onPublicCustomMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, byte[] DataBuffer, int DataLength)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
DataBufferBuffer of data
DataLengthData size
DescriptionPublic custom message is received.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onPrivateCustomMessageReceived

void onPrivateCustomMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, byte[] DataBuffer, int DataLength)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
DataBufferBuffer of data
DataLengthData size
DescriptionPrivate custom message is received.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoShared

void onVideoShared(PTTChannel ChannelInstance, int VideoChannelID, int MediaProfileID, string VideoUploader)
ChannelInstanceChannel instance of event
VideoChannelIDShared VideoChannel's ID
MediaProfileIDVideo Profile ID
VideoUploaderUploader ID
DescriptionVideo channel is shared
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoUnshared

void onVideoUnshared(PTTChannel ChannelInstance, int VideoChannelID, string VideoUploader)
ChannelInstanceChannel instance of event
VideoChannelIDUnshared VideoChannel's ID
VideoUploaderUploader ID
DescriptionVideo channel is unshared
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onCallFunction

void onCallFunction(PTTChannel ChannelInstance,int FunctionID, string Parameter, string SenderID, string SenderName, string Location)
ChannelInstanceChannel instance of event
FunctionID1:SOS
ParameterFunction's Parameter
SenderIDSender's ID
SenderNameSender's Name
Locationuser's location. If "", unknown
DescriptionCall function received
Server version1.4.x~
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onAlert

void onAlert(PTTChannel ChannelInstance,string SenderID, string SenderName, int Type, string Message)
ChannelInstanceChannel instance of event
SenderIDSender's ID
SenderNameSender's Name
Type0:Normal
Messagemessage
DescriptionAlert received
Server version1.4.x~
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onLocations

void onLocations(PTTChannel ChannelInstance,string locationsJson)
ChannelInstanceChannel instance of event
locationsJsonmessage
DescriptionMember's location received
Server version3.2.1~
Android SDK2.1.2
iOS SDKNot supported
Windows SDKNot supported
Linux SDKNot supported yet
< LocationsJson >
fieldtypeDescriptionDefaultR
SearchedDatestringCurrent SearchDate, yyyy-MM-dd HH:mm:ss(GMT 0)M
BuddyO
  UserIDstringUser IDM
  UserNamestringMember NameM
  LatitudestringLatitude M
  LongitudestringLongitude M
  UpdateDatestringUpdated datetime