webphone
Class SIPNotification.Media

java.lang.Object
  extended by webphone.SIPNotification
      extended by webphone.SIPNotification.Media
Enclosing class:
SIPNotification

public static class SIPNotification.Media
extends SIPNotification

Media notification.
Triggered by: audio/video media packets.
Event: SIPNotificationListener.onMedia
Fields: MEDIA,line,status,text


Nested Class Summary
 
Nested classes/interfaces inherited from class webphone.SIPNotification
SIPNotification.Account, SIPNotification.AI, SIPNotification.Answer, SIPNotification.APIResult, SIPNotification.BLF, SIPNotification.Block, SIPNotification.CDR, SIPNotification.Chat, SIPNotification.ChatComposing, SIPNotification.ChatReport, SIPNotification.Credit, SIPNotification.DTMF, SIPNotification.Event, SIPNotification.Group, SIPNotification.INFO, SIPNotification.LicKey, SIPNotification.Line, SIPNotification.Log, SIPNotification.Media, SIPNotification.MWI, SIPNotification.NewContact, SIPNotification.PlayReady, SIPNotification.Popup, SIPNotification.Presence, SIPNotification.Rating, SIPNotification.Register, SIPNotification.RTPE, SIPNotification.RTPStat, SIPNotification.RTPT, SIPNotification.ServerContacts, SIPNotification.ShouldReset, SIPNotification.SIP, SIPNotification.SRS, SIPNotification.Start, SIPNotification.Status, SIPNotification.Stop, SIPNotification.USSD, SIPNotification.VAD, SIPNotification.Video, SIPNotification.Vrec
 
Field Summary
static int AFORMAT_PCM
          raw PCM in the original sample-rate (sendmedia_aformat: 0)
static int AFORMAT_PCM_16K
          raw PCM 16kHz (L16 mono, Little Endian; sendmedia_aformat: 3 or 6)
static int AFORMAT_PCM_16KB
          raw PCM 16kHz Big Endian (sendmedia_aformat: 5)
static int AFORMAT_PCM_8K
          raw PCM 8kHz (L8 mono, Little Endian; sendmedia_aformat: 2)
static int AFORMAT_PCM_CUST
          raw PCM in the specified sample rate, Little Endian; (sendmedia_aformat: 8000+)
static int AFORMAT_RTP
          RTP packet (sendmedia_aformat: 1)
static int AFORMAT_RTPPAYLOAD
          RTP data without the RTP header (sendmedia_aformat: 4)
static int AFORMAT_UNKNOWN
          unrecognized
 java.lang.String callid
           
 byte[] data
           
 int direction
           
static int DIRECTION_AI
          audio received from AI
static int DIRECTION_IN
          incoming (RTP media stream received to JVoIP from the remote peer)
static int DIRECTION_OUT
          outgoing (RTP media stream sent by JVoIP to remote peer)
static int DIRECTION_UNKNOWN
          unrecognized
 int format
           
 boolean iseof
           
 int len
           
 int samplerate
           
 int sequencenumber
           
 int stream_index
           
 java.lang.String stream_label
           
 int type
           
static int TYPE_AUDIO
          audio packet
static int TYPE_UNKNOWN
          unknown
static int TYPE_VIDEO
          video packet
 int vad
           
static int VAD_SILENCE
          voice activity detection: no talk detected
static int VAD_SPEAKING
          voice activity detection: talk detected
static int VAD_UNKNOWN
          voice activity detection: not set
 
Fields inherited from class webphone.SIPNotification
NOTIFICATION_ACCOUNT, NOTIFICATION_AI, NOTIFICATION_ALL, NOTIFICATION_ANSWER, NOTIFICATION_APIRESULT, NOTIFICATION_BLF, NOTIFICATION_BLOCK, NOTIFICATION_CDR, NOTIFICATION_CHAT, NOTIFICATION_CHATCOMPOSING, NOTIFICATION_CHATREPORT, NOTIFICATION_CREDIT, NOTIFICATION_DTMF, NOTIFICATION_EVENT, NOTIFICATION_GROUP, NOTIFICATION_INFO, NOTIFICATION_INVALID, NOTIFICATION_LICKEY, NOTIFICATION_LINE, NOTIFICATION_LOG, NOTIFICATION_MEDIA, NOTIFICATION_MWI, NOTIFICATION_NEWUSER, NOTIFICATION_PLAYREADY, NOTIFICATION_POPUP, NOTIFICATION_PRESENCE, NOTIFICATION_RATING, NOTIFICATION_REGISTER, NOTIFICATION_RTPE, NOTIFICATION_RTPSTAT, NOTIFICATION_RTPT, NOTIFICATION_SERVERCONTACTS, NOTIFICATION_SHOULDRESET, NOTIFICATION_SIP, NOTIFICATION_SRS, NOTIFICATION_START, NOTIFICATION_STATUS, NOTIFICATION_STOP, NOTIFICATION_USSD, NOTIFICATION_VAD, NOTIFICATION_VIDEO, NOTIFICATION_VREC
 
Method Summary
 java.lang.String getCallID()
          SIP Call-ID
 byte[] getData()
          the actual audio data
 int getDirection()
          media flow direction: DIRECTION_...
 int getFormat()
          audio format: AFORMAT_...
 int getLength()
          length of the data bufffer (because the internal data buffer might be reused if the resusemediapackets is set to 1, so getData().length() might be higher then the actual data size)
 int getLine()
          endpoint line
 int getRate()
          sample-rate in Hz, such as 8000 or 16000
 int getSeq()
          a global auto-incremented sequence number
 int getStreamIndex()
          the stream index if this is SIPREC
 java.lang.String getStreamLabel()
          the stream name if this is SIPREC
 int getType()
          media type: TYPE_...
 int getVAD()
          voice activity detection: VAD_...
 boolean isEof()
          will return true for the last packet in the stream and the getLength() will be 0
 void SetLine_Internal(int line_in)
          Internal function.
 java.lang.String toString()
          The whole notification as string (one line with the fields separated by comma).
 
Methods inherited from class webphone.SIPNotification
getNotificationType, getNotificationTypeText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
unknown

See Also:
Constant Field Values

TYPE_AUDIO

public static final int TYPE_AUDIO
audio packet

See Also:
Constant Field Values

TYPE_VIDEO

public static final int TYPE_VIDEO
video packet

See Also:
Constant Field Values

AFORMAT_UNKNOWN

public static final int AFORMAT_UNKNOWN
unrecognized

See Also:
Constant Field Values

AFORMAT_RTP

public static final int AFORMAT_RTP
RTP packet (sendmedia_aformat: 1)

See Also:
Constant Field Values

AFORMAT_RTPPAYLOAD

public static final int AFORMAT_RTPPAYLOAD
RTP data without the RTP header (sendmedia_aformat: 4)

See Also:
Constant Field Values

AFORMAT_PCM

public static final int AFORMAT_PCM
raw PCM in the original sample-rate (sendmedia_aformat: 0)

See Also:
Constant Field Values

AFORMAT_PCM_8K

public static final int AFORMAT_PCM_8K
raw PCM 8kHz (L8 mono, Little Endian; sendmedia_aformat: 2)

See Also:
Constant Field Values

AFORMAT_PCM_16K

public static final int AFORMAT_PCM_16K
raw PCM 16kHz (L16 mono, Little Endian; sendmedia_aformat: 3 or 6)

See Also:
Constant Field Values

AFORMAT_PCM_16KB

public static final int AFORMAT_PCM_16KB
raw PCM 16kHz Big Endian (sendmedia_aformat: 5)

See Also:
Constant Field Values

AFORMAT_PCM_CUST

public static final int AFORMAT_PCM_CUST
raw PCM in the specified sample rate, Little Endian; (sendmedia_aformat: 8000+)

See Also:
Constant Field Values

DIRECTION_UNKNOWN

public static final int DIRECTION_UNKNOWN
unrecognized

See Also:
Constant Field Values

DIRECTION_IN

public static final int DIRECTION_IN
incoming (RTP media stream received to JVoIP from the remote peer)

See Also:
Constant Field Values

DIRECTION_OUT

public static final int DIRECTION_OUT
outgoing (RTP media stream sent by JVoIP to remote peer)

See Also:
Constant Field Values

DIRECTION_AI

public static final int DIRECTION_AI
audio received from AI

See Also:
Constant Field Values

VAD_UNKNOWN

public static final int VAD_UNKNOWN
voice activity detection: not set

See Also:
Constant Field Values

VAD_SILENCE

public static final int VAD_SILENCE
voice activity detection: no talk detected

See Also:
Constant Field Values

VAD_SPEAKING

public static final int VAD_SPEAKING
voice activity detection: talk detected

See Also:
Constant Field Values

type

public int type

format

public int format

samplerate

public int samplerate

direction

public int direction

stream_index

public int stream_index

stream_label

public java.lang.String stream_label

callid

public java.lang.String callid

vad

public int vad

sequencenumber

public int sequencenumber

iseof

public boolean iseof

len

public int len

data

public byte[] data
Method Detail

getLine

public int getLine()
endpoint line


getCallID

public java.lang.String getCallID()
SIP Call-ID


getType

public int getType()
media type: TYPE_... constant


getFormat

public int getFormat()
audio format: AFORMAT_... constant


getRate

public int getRate()
sample-rate in Hz, such as 8000 or 16000


getVAD

public int getVAD()
voice activity detection: VAD_... constant


getDirection

public int getDirection()
media flow direction: DIRECTION_... constant


getStreamIndex

public int getStreamIndex()
the stream index if this is SIPREC


getStreamLabel

public java.lang.String getStreamLabel()
the stream name if this is SIPREC


getSeq

public int getSeq()
a global auto-incremented sequence number


getData

public byte[] getData()
the actual audio data


getLength

public int getLength()
length of the data bufffer (because the internal data buffer might be reused if the resusemediapackets is set to 1, so getData().length() might be higher then the actual data size)


isEof

public boolean isEof()
will return true for the last packet in the stream and the getLength() will be 0


toString

public java.lang.String toString()
The whole notification as string (one line with the fields separated by comma). Does not include the data payload.

Overrides:
toString in class SIPNotification

SetLine_Internal

public void SetLine_Internal(int line_in)
Internal function. Do not use.