PortSIP VoIP SDK Manual for Android  16.2
PortSIP features our newest, supported, quality-assured VoIP SDK used by Several hundred companies around the world for easy VoIP application develop and quality-assured code.
Functions
RTP callback events

Functions

void com.portsip.OnPortSIPEvent.onReceivedRTPPacket (long sessionId, boolean isAudio, byte[] RTPPacket, int packetSize)
 
void com.portsip.OnPortSIPEvent.onSendingRTPPacket (long sessionId, boolean isAudio, byte[] RTPPacket, int packetSize)
 
void com.portsip.OnPortSIPEvent.onAudioRawCallback (long sessionId, int enum_audioCallbackMode, byte[] data, int dataLength, int samplingFreqHz)
 
void com.portsip.OnPortSIPEvent.onVideoRawCallback (long sessionId, int enum_videoCallbackMode, int width, int height, byte[] data, int dataLength)
 

Detailed Description

Function Documentation

◆ onReceivedRTPPacket()

void com.portsip.OnPortSIPEvent.onReceivedRTPPacket ( long  sessionId,
boolean  isAudio,
byte []  RTPPacket,
int  packetSize 
)

If setRTPCallback function is called to enable the RTP callback, this event will be triggered once receiving a RTP packet.

Parameters
sessionIdThe session ID of the call.
isAudioIf the received RTP packet is of audio, this parameter returns true; otherwise false.
RTPPacketThe memory of whole RTP packet.
packetSizeThe size of received RTP Packet. Remarks

Don't call any SDK API functions in this event directly. If you want to call the API functions or other code which is time-consuming, you should post a message to another thread and execute SDK API functions or other code in another thread.

◆ onSendingRTPPacket()

void com.portsip.OnPortSIPEvent.onSendingRTPPacket ( long  sessionId,
boolean  isAudio,
byte []  RTPPacket,
int  packetSize 
)

If setRTPCallback function is called to enable the RTP callback, this event will be triggered once sending a RTP packet.

Parameters
sessionIdThe session ID of the call.
isAudioIf the received RTP packet is of audio, this parameter returns true; otherwise false.
RTPPacketThe memory of whole RTP packet.
packetSizeThe size of received RTP Packet. Remarks

Don't call any SDK API functions in this event directly. If you want to call the API functions or other code which is time-consuming, you should post a message to another thread and execute SDK API functions or other code in another thread.

◆ onAudioRawCallback()

void com.portsip.OnPortSIPEvent.onAudioRawCallback ( long  sessionId,
int  enum_audioCallbackMode,
byte []  data,
int  dataLength,
int  samplingFreqHz 
)

This event will be triggered once receiving the audio packets if called enableAudioStreamCallback function.

Parameters
sessionIdThe session ID of the call.
enum_audioCallbackModeThe type passed in enableAudioStreamCallback function. Below types allowed: ENUM_AUDIOSTREAM_NONE, ENUM_AUDIOSTREAM_LOCAL_MIX, ENUM_AUDIOSTREAM_LOCAL_PER_CHANNEL, ENUM_AUDIOSTREAM_REMOTE_MIX, ENUM_AUDIOSTREAM_REMOTE_PER_CHANNEL.
dataThe memory of audio stream. It's in PCM format.
dataLengthThe data size.
samplingFreqHzThe audio stream sample in HZ. For example, 8000 or 16000. Remarks

Don't call any SDK API functions in this event directly. If you want to call the API functions or other code which is time-consuming, you should post a message to another thread and execute SDK API functions or other code in another thread.

See also
PortSipSdk::enableAudioStreamCallback

◆ onVideoRawCallback()

void com.portsip.OnPortSIPEvent.onVideoRawCallback ( long  sessionId,
int  enum_videoCallbackMode,
int  width,
int  height,
byte []  data,
int  dataLength 
)

This event will be triggered once receiving the video packets if enableVideoStreamCallback function is called.

Parameters
sessionIdThe session ID of the call.
enum_videoCallbackModeThe type which is passed in enableVideoStreamCallback function. Below types allowed: ENUM_VIDEOSTREAM_NONE, ENUM_VIDEOSTREAM_LOCAL, ENUM_VIDEOSTREAM_REMOTE, ENUM_VIDEOSTREAM_BOTH.
widthThe width of video image.
heightThe height of video image.
dataThe memory of video stream. It's in YUV420 format, YV12.
dataLengthThe data size.
See also
PortSipSdk::enableVideoStreamCallback