repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.bind
public void bind(boolean isLocal, boolean rtcpMux) throws IOException, IllegalStateException { this.rtpChannel.bind(isLocal, rtcpMux); if(!rtcpMux) { this.rtcpChannel.bind(isLocal, this.rtpChannel.getLocalPort() + 1); } this.rtcpMux = rtcpMux; if(logger.isDebugEnabled()) { logger.debug(this.mediaType...
java
public void bind(boolean isLocal, boolean rtcpMux) throws IOException, IllegalStateException { this.rtpChannel.bind(isLocal, rtcpMux); if(!rtcpMux) { this.rtcpChannel.bind(isLocal, this.rtpChannel.getLocalPort() + 1); } this.rtcpMux = rtcpMux; if(logger.isDebugEnabled()) { logger.debug(this.mediaType...
[ "public", "void", "bind", "(", "boolean", "isLocal", ",", "boolean", "rtcpMux", ")", "throws", "IOException", ",", "IllegalStateException", "{", "this", ".", "rtpChannel", ".", "bind", "(", "isLocal", ",", "rtcpMux", ")", ";", "if", "(", "!", "rtcpMux", ")...
Binds the RTP and RTCP components to a suitable address and port. @param isLocal Whether the binding address is in local range. @param rtcpMux Whether RTCP multiplexing is supported.<br> If so, both RTP and RTCP components will be merged into one channel only. Otherwise, the RTCP component will be bound to the odd por...
[ "Binds", "the", "RTP", "and", "RTCP", "components", "to", "a", "suitable", "address", "and", "port", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L448-L463
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.connectRtp
public void connectRtp(SocketAddress address) { this.rtpChannel.setRemotePeer(address); if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " RTP channel " + this.ssrc + " connected to remote peer " + address.toString()); } }
java
public void connectRtp(SocketAddress address) { this.rtpChannel.setRemotePeer(address); if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " RTP channel " + this.ssrc + " connected to remote peer " + address.toString()); } }
[ "public", "void", "connectRtp", "(", "SocketAddress", "address", ")", "{", "this", ".", "rtpChannel", ".", "setRemotePeer", "(", "address", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "this", "."...
Connected the RTP component to the remote peer. <p> Once connected, the RTP component can only send/received traffic to/from the remote peer. </p> @param address The address of the remote peer
[ "Connected", "the", "RTP", "component", "to", "the", "remote", "peer", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L485-L491
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.bindRtcp
public void bindRtcp(boolean isLocal, int port) throws IOException, IllegalStateException { if(this.ice) { throw new IllegalStateException("Cannot bind when ICE is enabled"); } this.rtcpChannel.bind(isLocal, port); this.rtcpMux = (port == this.rtpChannel.getLocalPort()); }
java
public void bindRtcp(boolean isLocal, int port) throws IOException, IllegalStateException { if(this.ice) { throw new IllegalStateException("Cannot bind when ICE is enabled"); } this.rtcpChannel.bind(isLocal, port); this.rtcpMux = (port == this.rtpChannel.getLocalPort()); }
[ "public", "void", "bindRtcp", "(", "boolean", "isLocal", ",", "int", "port", ")", "throws", "IOException", ",", "IllegalStateException", "{", "if", "(", "this", ".", "ice", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot bind when ICE is enabled\...
Binds the RTCP component to a suitable address and port. @param isLocal Whether the binding address must be in local range. @param port A specific port to bind to @throws IOException When the RTCP component cannot be bound to an address. @throws IllegalStateException The binding operation is not allowed if ICE is acti...
[ "Binds", "the", "RTCP", "component", "to", "a", "suitable", "address", "and", "port", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L522-L528
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.connectRtcp
public void connectRtcp(SocketAddress remoteAddress) { this.rtcpChannel.setRemotePeer(remoteAddress); if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " RTCP channel " + this.ssrc + " has connected to remote peer " + remoteAddress.toString()); } }
java
public void connectRtcp(SocketAddress remoteAddress) { this.rtcpChannel.setRemotePeer(remoteAddress); if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " RTCP channel " + this.ssrc + " has connected to remote peer " + remoteAddress.toString()); } }
[ "public", "void", "connectRtcp", "(", "SocketAddress", "remoteAddress", ")", "{", "this", ".", "rtcpChannel", ".", "setRemotePeer", "(", "remoteAddress", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", ...
Connects the RTCP component to the remote peer. <p> Once connected, the RTCP component can only send/received traffic to/from the remote peer. </p> @param remoteAddress The address of the remote peer
[ "Connects", "the", "RTCP", "component", "to", "the", "remote", "peer", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L541-L547
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.buildRTPMap
protected RTPFormats buildRTPMap(RTPFormats profile) { RTPFormats list = new RTPFormats(); Formats fmts = new Formats(); if (this.rtpChannel.getOutputDsp() != null) { Codec[] currCodecs = this.rtpChannel.getOutputDsp().getCodecs(); for (int i = 0; i < currCodecs.length; i++) { if (currCodecs[i].getSu...
java
protected RTPFormats buildRTPMap(RTPFormats profile) { RTPFormats list = new RTPFormats(); Formats fmts = new Formats(); if (this.rtpChannel.getOutputDsp() != null) { Codec[] currCodecs = this.rtpChannel.getOutputDsp().getCodecs(); for (int i = 0; i < currCodecs.length; i++) { if (currCodecs[i].getSu...
[ "protected", "RTPFormats", "buildRTPMap", "(", "RTPFormats", "profile", ")", "{", "RTPFormats", "list", "=", "new", "RTPFormats", "(", ")", ";", "Formats", "fmts", "=", "new", "Formats", "(", ")", ";", "if", "(", "this", ".", "rtpChannel", ".", "getOutputD...
Constructs RTP payloads for given channel. @param profile AVProfile part for media type of given channel @return collection of RTP formats.
[ "Constructs", "RTP", "payloads", "for", "given", "channel", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L576-L601
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.negotiateFormats
public void negotiateFormats(MediaDescriptionField media) { // Clean currently offered formats this.offeredFormats.clean(); // Map payload types to RTP Format for (String payloadType : media.getPayloadTypes()) { RTPFormat format; try { int payloadTypeInt = Integer.parseInt(payload...
java
public void negotiateFormats(MediaDescriptionField media) { // Clean currently offered formats this.offeredFormats.clean(); // Map payload types to RTP Format for (String payloadType : media.getPayloadTypes()) { RTPFormat format; try { int payloadTypeInt = Integer.parseInt(payload...
[ "public", "void", "negotiateFormats", "(", "MediaDescriptionField", "media", ")", "{", "// Clean currently offered formats", "this", ".", "offeredFormats", ".", "clean", "(", ")", ";", "// Map payload types to RTP Format", "for", "(", "String", "payloadType", ":", "medi...
Negotiates the list of supported codecs with the remote peer over SDP. @param media The corresponding media description of the remote peer which contains the payload types.
[ "Negotiates", "the", "list", "of", "supported", "codecs", "with", "the", "remote", "peer", "over", "SDP", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L641-L688
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.enableICE
public void enableICE(String externalAddress, boolean rtcpMux) { if (!this.ice) { this.ice = true; this.rtcpMux = rtcpMux; this.iceAuthenticator.generateIceCredentials(); // Enable ICE on RTP channels this.rtpChannel.enableIce(this.iceAuth...
java
public void enableICE(String externalAddress, boolean rtcpMux) { if (!this.ice) { this.ice = true; this.rtcpMux = rtcpMux; this.iceAuthenticator.generateIceCredentials(); // Enable ICE on RTP channels this.rtpChannel.enableIce(this.iceAuth...
[ "public", "void", "enableICE", "(", "String", "externalAddress", ",", "boolean", "rtcpMux", ")", "{", "if", "(", "!", "this", ".", "ice", ")", "{", "this", ".", "ice", "=", "true", ";", "this", ".", "rtcpMux", "=", "rtcpMux", ";", "this", ".", "iceAu...
Enables ICE on the channel. <p> An ICE-enabled channel will start an ICE Agent which gathers local candidates and listens to incoming STUN requests as a mean to select the proper address to be used during the call. </p> @param externalAddress The public address of the Media Server. Used for SRFLX candidates. @param r...
[ "Enables", "ICE", "on", "the", "channel", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L720-L736
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.disableICE
public void disableICE() { if (this.ice) { this.ice = false; this.iceAuthenticator.reset(); // Disable ICE on RTP channels this.rtpChannel.disableIce(); if(!rtcpMux) { this.rtcpChannel.disableIce(); } ...
java
public void disableICE() { if (this.ice) { this.ice = false; this.iceAuthenticator.reset(); // Disable ICE on RTP channels this.rtpChannel.disableIce(); if(!rtcpMux) { this.rtcpChannel.disableIce(); } ...
[ "public", "void", "disableICE", "(", ")", "{", "if", "(", "this", ".", "ice", ")", "{", "this", ".", "ice", "=", "false", ";", "this", ".", "iceAuthenticator", ".", "reset", "(", ")", ";", "// Disable ICE on RTP channels", "this", ".", "rtpChannel", ".",...
Disables ICE and closes ICE-related resources
[ "Disables", "ICE", "and", "closes", "ICE", "-", "related", "resources" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L741-L756
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.disableDTLS
public void disableDTLS() { if (this.dtls) { this.rtpChannel.disableSRTP(); if (!this.rtcpMux) { this.rtcpChannel.disableSRTCP(); } this.dtls = false; if (logger.isDebugEnabled()) { logger.debug(this.mediaType + " chann...
java
public void disableDTLS() { if (this.dtls) { this.rtpChannel.disableSRTP(); if (!this.rtcpMux) { this.rtcpChannel.disableSRTCP(); } this.dtls = false; if (logger.isDebugEnabled()) { logger.debug(this.mediaType + " chann...
[ "public", "void", "disableDTLS", "(", ")", "{", "if", "(", "this", ".", "dtls", ")", "{", "this", ".", "rtpChannel", ".", "disableSRTP", "(", ")", ";", "if", "(", "!", "this", ".", "rtcpMux", ")", "{", "this", ".", "rtcpChannel", ".", "disableSRTCP",...
Disables DTLS and closes related resources.
[ "Disables", "DTLS", "and", "closes", "related", "resources", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L851-L863
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/ntp/NtpUtils.java
NtpUtils.calculateLastSrTimestamp
public static long calculateLastSrTimestamp(long ntp1, long ntp2) { byte[] high = uIntLongToByteWord(ntp1); byte[] low = uIntLongToByteWord(ntp2); low[3] = low[1]; low[2] = low[0]; low[1] = high[3]; low[0] = high[2]; return bytesToUIntLong(low, 0); }
java
public static long calculateLastSrTimestamp(long ntp1, long ntp2) { byte[] high = uIntLongToByteWord(ntp1); byte[] low = uIntLongToByteWord(ntp2); low[3] = low[1]; low[2] = low[0]; low[1] = high[3]; low[0] = high[2]; return bytesToUIntLong(low, 0); }
[ "public", "static", "long", "calculateLastSrTimestamp", "(", "long", "ntp1", ",", "long", "ntp2", ")", "{", "byte", "[", "]", "high", "=", "uIntLongToByteWord", "(", "ntp1", ")", ";", "byte", "[", "]", "low", "=", "uIntLongToByteWord", "(", "ntp2", ")", ...
Calculates the time stamp of the last received SR. @param ntp The most significant word of the NTP time stamp @return The middle 32 bits out of 64 in the NTP timestamp received as part of the most recent RTCP sender report (SR).
[ "Calculates", "the", "time", "stamp", "of", "the", "last", "received", "SR", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/ntp/NtpUtils.java#L40-L48
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/ntp/NtpUtils.java
NtpUtils.uIntLongToByteWord
private static byte[] uIntLongToByteWord(long j) { int i = (int) j; byte[] byteWord = new byte[4]; byteWord[0] = (byte) ((i >>> 24) & 0x000000FF); byteWord[1] = (byte) ((i >> 16) & 0x000000FF); byteWord[2] = (byte) ((i >> 8) & 0x000000FF); byteWord[3] = (byte) (i & 0x00FF); return byteWord; }
java
private static byte[] uIntLongToByteWord(long j) { int i = (int) j; byte[] byteWord = new byte[4]; byteWord[0] = (byte) ((i >>> 24) & 0x000000FF); byteWord[1] = (byte) ((i >> 16) & 0x000000FF); byteWord[2] = (byte) ((i >> 8) & 0x000000FF); byteWord[3] = (byte) (i & 0x00FF); return byteWord; }
[ "private", "static", "byte", "[", "]", "uIntLongToByteWord", "(", "long", "j", ")", "{", "int", "i", "=", "(", "int", ")", "j", ";", "byte", "[", "]", "byteWord", "=", "new", "byte", "[", "4", "]", ";", "byteWord", "[", "0", "]", "=", "(", "byt...
Converts an unsigned 32 bit integer, stored in a long, into an array of bytes. @param j a long @return byte[4] representing the unsigned integer, most significant bit first.
[ "Converts", "an", "unsigned", "32", "bit", "integer", "stored", "in", "a", "long", "into", "an", "array", "of", "bytes", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/ntp/NtpUtils.java#L56-L64
train
RestComm/media-core
resource/media-recorder/src/main/java/org/restcomm/media/core/resource/recorder/audio/RecorderFileSink.java
RecorderFileSink.commit
public void commit() throws IOException { // assures we perform the close operation only once. if (open.compareAndSet(true, false)) { // flush & close fout.force(true); fout.close(); // if the current file exists, and append is true, then append samples a...
java
public void commit() throws IOException { // assures we perform the close operation only once. if (open.compareAndSet(true, false)) { // flush & close fout.force(true); fout.close(); // if the current file exists, and append is true, then append samples a...
[ "public", "void", "commit", "(", ")", "throws", "IOException", "{", "// assures we perform the close operation only once.", "if", "(", "open", ".", "compareAndSet", "(", "true", ",", "false", ")", ")", "{", "// flush & close", "fout", ".", "force", "(", "true", ...
Commit this sink. Causes to prevent any further write operations, and commits temporary file to target. When this returns, Sink is done and cannot be used again.
[ "Commit", "this", "sink", ".", "Causes", "to", "prevent", "any", "further", "write", "operations", "and", "commits", "temporary", "file", "to", "target", ".", "When", "this", "returns", "Sink", "is", "done", "and", "cannot", "be", "used", "again", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/media-recorder/src/main/java/org/restcomm/media/core/resource/recorder/audio/RecorderFileSink.java#L93-L115
train
RestComm/media-core
client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java
TransactionHandler.release
protected void release() { stack.getLocalTransactions().remove(Integer.valueOf(localTID)); stack.getRemoteTxToLocalTxMap().remove(Integer.valueOf(remoteTID)); cancelTHISTTimerTask(); cancelLongtranTimer(); cancelReTransmissionTimer(); if(originalPacket!=null) stack.releasePacket(originalPacket); ...
java
protected void release() { stack.getLocalTransactions().remove(Integer.valueOf(localTID)); stack.getRemoteTxToLocalTxMap().remove(Integer.valueOf(remoteTID)); cancelTHISTTimerTask(); cancelLongtranTimer(); cancelReTransmissionTimer(); if(originalPacket!=null) stack.releasePacket(originalPacket); ...
[ "protected", "void", "release", "(", ")", "{", "stack", ".", "getLocalTransactions", "(", ")", ".", "remove", "(", "Integer", ".", "valueOf", "(", "localTID", ")", ")", ";", "stack", ".", "getRemoteTxToLocalTxMap", "(", ")", ".", "remove", "(", "Integer", ...
Release this transaction and frees all allocated resources.
[ "Release", "this", "transaction", "and", "frees", "all", "allocated", "resources", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java#L290-L301
train
RestComm/media-core
client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java
TransactionHandler.send
private void send(JainMgcpCommandEvent event) { sent = true; String host = ""; int port = 0; switch (event.getObjectIdentifier()) { case Constants.CMD_NOTIFY: Notify notifyCommand = (Notify) event; NotifiedEntity notifiedEntity = notifyCommand.getNotifiedEntity(); if (notifiedEntity == null) { ...
java
private void send(JainMgcpCommandEvent event) { sent = true; String host = ""; int port = 0; switch (event.getObjectIdentifier()) { case Constants.CMD_NOTIFY: Notify notifyCommand = (Notify) event; NotifiedEntity notifiedEntity = notifyCommand.getNotifiedEntity(); if (notifiedEntity == null) { ...
[ "private", "void", "send", "(", "JainMgcpCommandEvent", "event", ")", "{", "sent", "=", "true", ";", "String", "host", "=", "\"\"", ";", "int", "port", "=", "0", ";", "switch", "(", "event", ".", "getObjectIdentifier", "(", ")", ")", "{", "case", "Cons...
Sends MGCP command from the application to the endpoint specified in the message. @param event the jain mgcp command event object.
[ "Sends", "MGCP", "command", "from", "the", "application", "to", "the", "endpoint", "specified", "in", "the", "message", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java#L386-L465
train
RestComm/media-core
client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java
TransactionHandler.send
private void send(JainMgcpResponseEvent event) { cancelLongtranTimer(); // to send response we already should know the address and port // number from which the original request was received if (remoteAddress == null) { throw new IllegalArgumentException("Unknown orinator address"); } // restore the o...
java
private void send(JainMgcpResponseEvent event) { cancelLongtranTimer(); // to send response we already should know the address and port // number from which the original request was received if (remoteAddress == null) { throw new IllegalArgumentException("Unknown orinator address"); } // restore the o...
[ "private", "void", "send", "(", "JainMgcpResponseEvent", "event", ")", "{", "cancelLongtranTimer", "(", ")", ";", "// to send response we already should know the address and port", "// number from which the original request was received", "if", "(", "remoteAddress", "==", "null",...
Sends MGCP response message from the application to the host from wich origination command was received. @param event the jain mgcp response event object.
[ "Sends", "MGCP", "response", "message", "from", "the", "application", "to", "the", "host", "from", "wich", "origination", "command", "was", "received", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java#L473-L513
train
RestComm/media-core
client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java
TransactionHandler.receiveResponse
public void receiveResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) { cancelReTransmissionTimer(); cancelLongtranTimer(); JainMgcpResponseEvent event = null; try { event = decodeResponse(data,msg,txID,returnCode); } catch (Exception e) { logger.error("Could not dec...
java
public void receiveResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) { cancelReTransmissionTimer(); cancelLongtranTimer(); JainMgcpResponseEvent event = null; try { event = decodeResponse(data,msg,txID,returnCode); } catch (Exception e) { logger.error("Could not dec...
[ "public", "void", "receiveResponse", "(", "byte", "[", "]", "data", ",", "SplitDetails", "[", "]", "msg", ",", "Integer", "txID", ",", "ReturnCode", "returnCode", ")", "{", "cancelReTransmissionTimer", "(", ")", ";", "cancelLongtranTimer", "(", ")", ";", "Ja...
Used by stack for relaying received MGCP response messages to the application. @param message receive MGCP response message.
[ "Used", "by", "stack", "for", "relaying", "received", "MGCP", "response", "messages", "to", "the", "application", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/handlers/TransactionHandler.java#L636-L659
train
RestComm/media-core
resource/media-recorder/src/main/java/org/restcomm/media/core/resource/recorder/audio/AudioRecorderImpl.java
AudioRecorderImpl.fireEvent
private void fireEvent(RecorderEventImpl event) { eventSender.event = event; scheduler.submit(eventSender, PriorityQueueScheduler.INPUT_QUEUE); }
java
private void fireEvent(RecorderEventImpl event) { eventSender.event = event; scheduler.submit(eventSender, PriorityQueueScheduler.INPUT_QUEUE); }
[ "private", "void", "fireEvent", "(", "RecorderEventImpl", "event", ")", "{", "eventSender", ".", "event", "=", "event", ";", "scheduler", ".", "submit", "(", "eventSender", ",", "PriorityQueueScheduler", ".", "INPUT_QUEUE", ")", ";", "}" ]
Fires specified event @param event the event to fire.
[ "Fires", "specified", "event" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/media-recorder/src/main/java/org/restcomm/media/core/resource/recorder/audio/AudioRecorderImpl.java#L210-L213
train
RestComm/media-core
scheduler/src/main/java/org/restcomm/media/core/scheduler/OrderedTaskQueue.java
OrderedTaskQueue.accept
public void accept(Task task) { if((activeIndex+1)%2==0) { if(!task.isInQueue0()) { taskList[0].offer(task); task.storedInQueue0(); } } else { if(!task.isInQueue1()) { taskList[1].offer(task); task.storedInQueue1(); } } ...
java
public void accept(Task task) { if((activeIndex+1)%2==0) { if(!task.isInQueue0()) { taskList[0].offer(task); task.storedInQueue0(); } } else { if(!task.isInQueue1()) { taskList[1].offer(task); task.storedInQueue1(); } } ...
[ "public", "void", "accept", "(", "Task", "task", ")", "{", "if", "(", "(", "activeIndex", "+", "1", ")", "%", "2", "==", "0", ")", "{", "if", "(", "!", "task", ".", "isInQueue0", "(", ")", ")", "{", "taskList", "[", "0", "]", ".", "offer", "(...
Queues specified task using tasks dead line time. @param task the task to be queued. @return TaskExecutor for the scheduled task.
[ "Queues", "specified", "task", "using", "tasks", "dead", "line", "time", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/scheduler/src/main/java/org/restcomm/media/core/scheduler/OrderedTaskQueue.java#L51-L68
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTCPCryptoContext.java
SRTCPCryptoContext.reverseTransformPacket
public boolean reverseTransformPacket(RawPacket pkt) { boolean decrypt = false; int tagLength = policy.getAuthTagLength(); int indexEflag = pkt.getSRTCPIndex(tagLength); if ((indexEflag & 0x80000000) == 0x80000000) { decrypt = true; } int index = in...
java
public boolean reverseTransformPacket(RawPacket pkt) { boolean decrypt = false; int tagLength = policy.getAuthTagLength(); int indexEflag = pkt.getSRTCPIndex(tagLength); if ((indexEflag & 0x80000000) == 0x80000000) { decrypt = true; } int index = in...
[ "public", "boolean", "reverseTransformPacket", "(", "RawPacket", "pkt", ")", "{", "boolean", "decrypt", "=", "false", ";", "int", "tagLength", "=", "policy", ".", "getAuthTagLength", "(", ")", ";", "int", "indexEflag", "=", "pkt", ".", "getSRTCPIndex", "(", ...
Transform a SRTCP packet into a RTCP packet. This method is called when a SRTCP packet was received. Operations done by the this operation include: Authentication check, Packet replay check and decryption. Both encryption and authentication functionality can be turned off as long as the SRTPPolicy used in this SRTPCr...
[ "Transform", "a", "SRTCP", "packet", "into", "a", "RTCP", "packet", ".", "This", "method", "is", "called", "when", "a", "SRTCP", "packet", "was", "received", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTCPCryptoContext.java#L316-L366
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTCPCryptoContext.java
SRTCPCryptoContext.computeIv
private void computeIv(byte label) { for (int i = 0; i < 14; i++) { ivStore[i] = masterSalt[i]; } ivStore[7] ^= label; ivStore[14] = ivStore[15] = 0; }
java
private void computeIv(byte label) { for (int i = 0; i < 14; i++) { ivStore[i] = masterSalt[i]; } ivStore[7] ^= label; ivStore[14] = ivStore[15] = 0; }
[ "private", "void", "computeIv", "(", "byte", "label", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "14", ";", "i", "++", ")", "{", "ivStore", "[", "i", "]", "=", "masterSalt", "[", "i", "]", ";", "}", "ivStore", "[", "7", "]", ...
Compute the initialization vector, used later by encryption algorithms, based on the label. @param label label specified for each type of iv
[ "Compute", "the", "initialization", "vector", "used", "later", "by", "encryption", "algorithms", "based", "on", "the", "label", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTCPCryptoContext.java#L513-L519
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTCPCryptoContext.java
SRTCPCryptoContext.deriveSrtcpKeys
public void deriveSrtcpKeys() { // compute the session encryption key byte label = 3; computeIv(label); KeyParameter encryptionKey = new KeyParameter(masterKey); cipher.init(true, encryptionKey); Arrays.fill(masterKey, (byte)0); cipherCtr.getCipherStrea...
java
public void deriveSrtcpKeys() { // compute the session encryption key byte label = 3; computeIv(label); KeyParameter encryptionKey = new KeyParameter(masterKey); cipher.init(true, encryptionKey); Arrays.fill(masterKey, (byte)0); cipherCtr.getCipherStrea...
[ "public", "void", "deriveSrtcpKeys", "(", ")", "{", "// compute the session encryption key\r", "byte", "label", "=", "3", ";", "computeIv", "(", "label", ")", ";", "KeyParameter", "encryptionKey", "=", "new", "KeyParameter", "(", "masterKey", ")", ";", "cipher", ...
Derives the srtcp session keys from the master key.
[ "Derives", "the", "srtcp", "session", "keys", "from", "the", "master", "key", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTCPCryptoContext.java#L525-L566
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/XorMappedAddressAttribute.java
XorMappedAddressAttribute.applyXor
public static TransportAddress applyXor(TransportAddress address, byte[] transactionID) { byte[] addressBytes = address.getAddressBytes(); char port = (char) address.getPort(); char portModifier = (char) ((transactionID[0] << 8 & 0x0000FF00) | (transactionID[1] & 0x000000FF)); port ^= portModifier; for (...
java
public static TransportAddress applyXor(TransportAddress address, byte[] transactionID) { byte[] addressBytes = address.getAddressBytes(); char port = (char) address.getPort(); char portModifier = (char) ((transactionID[0] << 8 & 0x0000FF00) | (transactionID[1] & 0x000000FF)); port ^= portModifier; for (...
[ "public", "static", "TransportAddress", "applyXor", "(", "TransportAddress", "address", ",", "byte", "[", "]", "transactionID", ")", "{", "byte", "[", "]", "addressBytes", "=", "address", ".", "getAddressBytes", "(", ")", ";", "char", "port", "=", "(", "char...
Returns the result of applying XOR on the specified attribute's address. The method may be used for both encoding and decoding XorMappedAddresses. @param address the address on which XOR should be applied @param transactionID the transaction id to use for the XOR @return the XOR-ed address.
[ "Returns", "the", "result", "of", "applying", "XOR", "on", "the", "specified", "attribute", "s", "address", ".", "The", "method", "may", "be", "used", "for", "both", "encoding", "and", "decoding", "XorMappedAddresses", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/XorMappedAddressAttribute.java#L75-L96
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/XorMappedAddressAttribute.java
XorMappedAddressAttribute.getAddress
public TransportAddress getAddress(byte[] transactionID) { byte[] xorMask = new byte[16]; System.arraycopy(StunMessage.MAGIC_COOKIE, 0, xorMask, 0, 4); System.arraycopy(transactionID, 0, xorMask, 4, 12); return applyXor(xorMask); }
java
public TransportAddress getAddress(byte[] transactionID) { byte[] xorMask = new byte[16]; System.arraycopy(StunMessage.MAGIC_COOKIE, 0, xorMask, 0, 4); System.arraycopy(transactionID, 0, xorMask, 4, 12); return applyXor(xorMask); }
[ "public", "TransportAddress", "getAddress", "(", "byte", "[", "]", "transactionID", ")", "{", "byte", "[", "]", "xorMask", "=", "new", "byte", "[", "16", "]", ";", "System", ".", "arraycopy", "(", "StunMessage", ".", "MAGIC_COOKIE", ",", "0", ",", "xorMa...
Returns the result of applying XOR on this attribute's address, using the specified transaction ID when converting IPv6 addresses. @param transactionID the transaction ID to use in case this attribute is encapsulating an IPv6 address. @return the XOR-ed address.
[ "Returns", "the", "result", "of", "applying", "XOR", "on", "this", "attribute", "s", "address", "using", "the", "specified", "transaction", "ID", "when", "converting", "IPv6", "addresses", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/XorMappedAddressAttribute.java#L108-L115
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/XorMappedAddressAttribute.java
XorMappedAddressAttribute.setAddress
public void setAddress(TransportAddress address, byte[] transactionID) { byte[] xorMask = new byte[16]; System.arraycopy(StunMessage.MAGIC_COOKIE, 0, xorMask, 0, 4); System.arraycopy(transactionID, 0, xorMask, 4, 12); TransportAddress xorAddress = applyXor(address, xorMask); super.setAddress(xorAddress); ...
java
public void setAddress(TransportAddress address, byte[] transactionID) { byte[] xorMask = new byte[16]; System.arraycopy(StunMessage.MAGIC_COOKIE, 0, xorMask, 0, 4); System.arraycopy(transactionID, 0, xorMask, 4, 12); TransportAddress xorAddress = applyXor(address, xorMask); super.setAddress(xorAddress); ...
[ "public", "void", "setAddress", "(", "TransportAddress", "address", ",", "byte", "[", "]", "transactionID", ")", "{", "byte", "[", "]", "xorMask", "=", "new", "byte", "[", "16", "]", ";", "System", ".", "arraycopy", "(", "StunMessage", ".", "MAGIC_COOKIE",...
Applies a XOR mask to the specified address and then sets it as the value transported by this attribute. @param address the address that we should xor and then record in this attribute. @param transactionID the transaction identifier that we should use when creating the XOR mask.
[ "Applies", "a", "XOR", "mask", "to", "the", "specified", "address", "and", "then", "sets", "it", "as", "the", "value", "transported", "by", "this", "attribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/address/XorMappedAddressAttribute.java#L142-L151
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/general/ErrorCodeAttribute.java
ErrorCodeAttribute.setErrorClass
public void setErrorClass(byte errorClass) throws IllegalArgumentException { if (errorClass < 0 || errorClass > 99) { throw new IllegalArgumentException( errorClass + "Only error classes between 0 and 99 are valid. Current class: " + errorClass); } this.errorClass = errorClass; }
java
public void setErrorClass(byte errorClass) throws IllegalArgumentException { if (errorClass < 0 || errorClass > 99) { throw new IllegalArgumentException( errorClass + "Only error classes between 0 and 99 are valid. Current class: " + errorClass); } this.errorClass = errorClass; }
[ "public", "void", "setErrorClass", "(", "byte", "errorClass", ")", "throws", "IllegalArgumentException", "{", "if", "(", "errorClass", "<", "0", "||", "errorClass", ">", "99", ")", "{", "throw", "new", "IllegalArgumentException", "(", "errorClass", "+", "\"Only ...
Sets the class of the error. @param errorClass The error class. @throws IllegalArgumentException Only error classes between 0 and 99 are valid.
[ "Sets", "the", "class", "of", "the", "error", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/general/ErrorCodeAttribute.java#L118-L126
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/general/ErrorCodeAttribute.java
ErrorCodeAttribute.getDefaultReasonPhrase
public static String getDefaultReasonPhrase(char errorCode) { switch (errorCode) { case BAD_REQUEST: return "(Bad Request): The request was malformed. The client should not " + "retry the request without modification from the previous attempt."; case UNAUTHORIZED: return "(Unauthorized): The Binding R...
java
public static String getDefaultReasonPhrase(char errorCode) { switch (errorCode) { case BAD_REQUEST: return "(Bad Request): The request was malformed. The client should not " + "retry the request without modification from the previous attempt."; case UNAUTHORIZED: return "(Unauthorized): The Binding R...
[ "public", "static", "String", "getDefaultReasonPhrase", "(", "char", "errorCode", ")", "{", "switch", "(", "errorCode", ")", "{", "case", "BAD_REQUEST", ":", "return", "\"(Bad Request): The request was malformed. The client should not \"", "+", "\"retry the request without m...
Returns a default reason phrase corresponding to the specified error code, as described by rfc 3489. @param errorCode the code of the error that the reason phrase must describe. @return a default reason phrase corresponding to the specified error code, as described by rfc 3489.
[ "Returns", "a", "default", "reason", "phrase", "corresponding", "to", "the", "specified", "error", "code", "as", "described", "by", "rfc", "3489", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/general/ErrorCodeAttribute.java#L173-L210
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/jitter/FixedJitterBuffer.java
FixedJitterBuffer.write
@Override public void write(RtpPacket packet, RTPFormat format) { // checking format if (format == null) { if (logger.isTraceEnabled()) { logger.trace("No format specified. Packet dropped!"); } return; } boolean locked = false; ...
java
@Override public void write(RtpPacket packet, RTPFormat format) { // checking format if (format == null) { if (logger.isTraceEnabled()) { logger.trace("No format specified. Packet dropped!"); } return; } boolean locked = false; ...
[ "@", "Override", "public", "void", "write", "(", "RtpPacket", "packet", ",", "RTPFormat", "format", ")", "{", "// checking format", "if", "(", "format", "==", "null", ")", "{", "if", "(", "logger", ".", "isTraceEnabled", "(", ")", ")", "{", "logger", "."...
Accepts specified packet @param packet the packet to accept
[ "Accepts", "specified", "packet" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/jitter/FixedJitterBuffer.java#L326-L351
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/jitter/FixedJitterBuffer.java
FixedJitterBuffer.read
public Frame read(long timestamp) { Frame frame = null; boolean locked = false; try { locked = this.lock.tryLock() || this.lock.tryLock(5, TimeUnit.MILLISECONDS); if (locked) { frame = safeRead(); } else { this.ready.set(false);...
java
public Frame read(long timestamp) { Frame frame = null; boolean locked = false; try { locked = this.lock.tryLock() || this.lock.tryLock(5, TimeUnit.MILLISECONDS); if (locked) { frame = safeRead(); } else { this.ready.set(false);...
[ "public", "Frame", "read", "(", "long", "timestamp", ")", "{", "Frame", "frame", "=", "null", ";", "boolean", "locked", "=", "false", ";", "try", "{", "locked", "=", "this", ".", "lock", ".", "tryLock", "(", ")", "||", "this", ".", "lock", ".", "tr...
Polls packet from buffer's head. @param timestamp the media time measured by reader @return the media frame.
[ "Polls", "packet", "from", "buffer", "s", "head", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/jitter/FixedJitterBuffer.java#L359-L380
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/jitter/FixedJitterBuffer.java
FixedJitterBuffer.reset
public void reset() { boolean locked = false; try { locked = lock.tryLock() || lock.tryLock(5, TimeUnit.MILLISECONDS); if (locked) { while (queue.size() > 0) { queue.remove(0).recycle(); } } } catch (Interrup...
java
public void reset() { boolean locked = false; try { locked = lock.tryLock() || lock.tryLock(5, TimeUnit.MILLISECONDS); if (locked) { while (queue.size() > 0) { queue.remove(0).recycle(); } } } catch (Interrup...
[ "public", "void", "reset", "(", ")", "{", "boolean", "locked", "=", "false", ";", "try", "{", "locked", "=", "lock", ".", "tryLock", "(", ")", "||", "lock", ".", "tryLock", "(", "5", ",", "TimeUnit", ".", "MILLISECONDS", ")", ";", "if", "(", "locke...
Resets buffer.
[ "Resets", "buffer", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/jitter/FixedJitterBuffer.java#L417-L435
train
RestComm/media-core
sdp/src/main/java/org/restcomm/media/core/sdp/SdpParserPipeline.java
SdpParserPipeline.addFieldParser
public void addFieldParser(char type, SdpParser<? extends SdpField> parser) { synchronized (this.fieldParsers) { this.fieldParsers.put(type, parser); } }
java
public void addFieldParser(char type, SdpParser<? extends SdpField> parser) { synchronized (this.fieldParsers) { this.fieldParsers.put(type, parser); } }
[ "public", "void", "addFieldParser", "(", "char", "type", ",", "SdpParser", "<", "?", "extends", "SdpField", ">", "parser", ")", "{", "synchronized", "(", "this", ".", "fieldParsers", ")", "{", "this", ".", "fieldParsers", ".", "put", "(", "type", ",", "p...
Adds a parser to the pipeline. @param parser The parser to be registered
[ "Adds", "a", "parser", "to", "the", "pipeline", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/sdp/src/main/java/org/restcomm/media/core/sdp/SdpParserPipeline.java#L123-L127
train
RestComm/media-core
sdp/src/main/java/org/restcomm/media/core/sdp/SdpParserPipeline.java
SdpParserPipeline.addAttributeParser
public void addAttributeParser(String type, SdpParser<? extends AttributeField> parser) { synchronized (this.attributeParsers) { this.attributeParsers.put(type, parser); } }
java
public void addAttributeParser(String type, SdpParser<? extends AttributeField> parser) { synchronized (this.attributeParsers) { this.attributeParsers.put(type, parser); } }
[ "public", "void", "addAttributeParser", "(", "String", "type", ",", "SdpParser", "<", "?", "extends", "AttributeField", ">", "parser", ")", "{", "synchronized", "(", "this", ".", "attributeParsers", ")", "{", "this", ".", "attributeParsers", ".", "put", "(", ...
Adds an attribute parser to the pipeline. @param parser The parser to be registered
[ "Adds", "an", "attribute", "parser", "to", "the", "pipeline", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/sdp/src/main/java/org/restcomm/media/core/sdp/SdpParserPipeline.java#L168-L172
train
RestComm/media-core
client/jsr-309/driver/src/main/java/org/restcomm/fsm/State.java
State.find
private Transition find(String name) { for (Transition t : transitions) { if (t.getName().matches(name)) { return t; } } return null; }
java
private Transition find(String name) { for (Transition t : transitions) { if (t.getName().matches(name)) { return t; } } return null; }
[ "private", "Transition", "find", "(", "String", "name", ")", "{", "for", "(", "Transition", "t", ":", "transitions", ")", "{", "if", "(", "t", ".", "getName", "(", ")", ".", "matches", "(", "name", ")", ")", "{", "return", "t", ";", "}", "}", "re...
Searches transition with specified name. @param name the name of the transition. @return the transition or null if not found.
[ "Searches", "transition", "with", "specified", "name", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/jsr-309/driver/src/main/java/org/restcomm/fsm/State.java#L123-L130
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java
RtcpHandler.joinRtpSession
public void joinRtpSession() { if (!this.joined.get()) { // Schedule first RTCP packet long t = this.statistics.rtcpInterval(this.initial.get()); this.tn = this.statistics.getCurrentTime() + t; scheduleRtcp(this.tn, RtcpPacketType.RTCP_REPORT); // Sta...
java
public void joinRtpSession() { if (!this.joined.get()) { // Schedule first RTCP packet long t = this.statistics.rtcpInterval(this.initial.get()); this.tn = this.statistics.getCurrentTime() + t; scheduleRtcp(this.tn, RtcpPacketType.RTCP_REPORT); // Sta...
[ "public", "void", "joinRtpSession", "(", ")", "{", "if", "(", "!", "this", ".", "joined", ".", "get", "(", ")", ")", "{", "// Schedule first RTCP packet", "long", "t", "=", "this", ".", "statistics", ".", "rtcpInterval", "(", "this", ".", "initial", ".",...
Upon joining the session, the participant initializes tp to 0, tc to 0, senders to 0, pmembers to 1, members to 1, we_sent to false, rtcp_bw to the specified fraction of the session bandwidth, initial to true, and avg_rtcp_size to the probable size of the first RTCP packet that the application will later construct. Th...
[ "Upon", "joining", "the", "session", "the", "participant", "initializes", "tp", "to", "0", "tc", "to", "0", "senders", "to", "0", "pmembers", "to", "1", "members", "to", "1", "we_sent", "to", "false", "rtcp_bw", "to", "the", "specified", "fraction", "of", ...
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java#L161-L172
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java
RtcpHandler.scheduleRtcp
private void scheduleRtcp(long timestamp, RtcpPacketType packetType) { // Create the task and schedule it long interval = resolveInterval(timestamp); this.scheduledTask = new TxTask(packetType); try { this.reportTaskFuture = this.scheduler.schedule(this.scheduledTask, interv...
java
private void scheduleRtcp(long timestamp, RtcpPacketType packetType) { // Create the task and schedule it long interval = resolveInterval(timestamp); this.scheduledTask = new TxTask(packetType); try { this.reportTaskFuture = this.scheduler.schedule(this.scheduledTask, interv...
[ "private", "void", "scheduleRtcp", "(", "long", "timestamp", ",", "RtcpPacketType", "packetType", ")", "{", "// Create the task and schedule it", "long", "interval", "=", "resolveInterval", "(", "timestamp", ")", ";", "this", ".", "scheduledTask", "=", "new", "TxTas...
Schedules an event to occur at a certain time. @param timestamp The time (in milliseconds) when the event should be fired @param packet The RTCP packet to be sent when the timer expires
[ "Schedules", "an", "event", "to", "occur", "at", "a", "certain", "time", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java#L225-L237
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java
RtcpHandler.rescheduleRtcp
private void rescheduleRtcp(TxTask task, long timestamp) { // Cancel current execution of the task this.reportTaskFuture.cancel(true); // Re-schedule task execution long interval = resolveInterval(timestamp); try { this.reportTaskFuture = this.scheduler.sched...
java
private void rescheduleRtcp(TxTask task, long timestamp) { // Cancel current execution of the task this.reportTaskFuture.cancel(true); // Re-schedule task execution long interval = resolveInterval(timestamp); try { this.reportTaskFuture = this.scheduler.sched...
[ "private", "void", "rescheduleRtcp", "(", "TxTask", "task", ",", "long", "timestamp", ")", "{", "// Cancel current execution of the task", "this", ".", "reportTaskFuture", ".", "cancel", "(", "true", ")", ";", "// Re-schedule task execution", "long", "interval", "=", ...
Re-schedules a previously scheduled event. @param timestamp The time stamp (in milliseconds) of the rescheduled event
[ "Re", "-", "schedules", "a", "previously", "scheduled", "event", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java#L255-L266
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java
RtcpHandler.closeChannel
private void closeChannel() { if (this.channel != null) { if (this.channel.isConnected()) { try { this.channel.disconnect(); } catch (IOException e) { logger.warn(e.getMessage(), e); } } ...
java
private void closeChannel() { if (this.channel != null) { if (this.channel.isConnected()) { try { this.channel.disconnect(); } catch (IOException e) { logger.warn(e.getMessage(), e); } } ...
[ "private", "void", "closeChannel", "(", ")", "{", "if", "(", "this", ".", "channel", "!=", "null", ")", "{", "if", "(", "this", ".", "channel", ".", "isConnected", "(", ")", ")", "{", "try", "{", "this", ".", "channel", ".", "disconnect", "(", ")",...
Disconnects and closes the datagram channel used to send and receive RTCP traffic.
[ "Disconnects", "and", "closes", "the", "datagram", "channel", "used", "to", "send", "and", "receive", "RTCP", "traffic", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java#L483-L501
train
RestComm/media-core
client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/jain/pkg/AUUtils.java
AUUtils.decode_WSP
private boolean decode_WSP() { boolean decoded = false; if (index < totalChars && (chars[index] == 0x20 || chars[index] == 0x09)) { index++; decoded = true; } return decoded; }
java
private boolean decode_WSP() { boolean decoded = false; if (index < totalChars && (chars[index] == 0x20 || chars[index] == 0x09)) { index++; decoded = true; } return decoded; }
[ "private", "boolean", "decode_WSP", "(", ")", "{", "boolean", "decoded", "=", "false", ";", "if", "(", "index", "<", "totalChars", "&&", "(", "chars", "[", "index", "]", "==", "0x20", "||", "chars", "[", "index", "]", "==", "0x09", ")", ")", "{", "...
Decode Space or HTAB
[ "Decode", "Space", "or", "HTAB" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/jain/pkg/AUUtils.java#L145-L152
train
RestComm/media-core
component/src/main/java/org/restcomm/media/core/component/audio/Resampler.java
Resampler.perform
public double[] perform(double[] buffer, int len) { int size = (int)((double)F/f * len); double signal[] = new double[size]; double dx = 1./(double)f; double dX = 1./(double)F; signal[0] = buffer[0]; double k = 0; for (int i = 1; i < size - 1; i++) { ...
java
public double[] perform(double[] buffer, int len) { int size = (int)((double)F/f * len); double signal[] = new double[size]; double dx = 1./(double)f; double dX = 1./(double)F; signal[0] = buffer[0]; double k = 0; for (int i = 1; i < size - 1; i++) { ...
[ "public", "double", "[", "]", "perform", "(", "double", "[", "]", "buffer", ",", "int", "len", ")", "{", "int", "size", "=", "(", "int", ")", "(", "(", "double", ")", "F", "/", "f", "*", "len", ")", ";", "double", "signal", "[", "]", "=", "ne...
Performs resampling of the given signal. @param buffer the buffer containing the signal. @param len the length of the signal in bytes. @return resampled signal
[ "Performs", "resampling", "of", "the", "given", "signal", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/component/src/main/java/org/restcomm/media/core/component/audio/Resampler.java#L52-L76
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.strain
public void strain(byte[] data, int pos, int len) { this.chars = data; this.pos = pos; this.len = len; this.linePointer = 0; }
java
public void strain(byte[] data, int pos, int len) { this.chars = data; this.pos = pos; this.len = len; this.linePointer = 0; }
[ "public", "void", "strain", "(", "byte", "[", "]", "data", ",", "int", "pos", ",", "int", "len", ")", "{", "this", ".", "chars", "=", "data", ";", "this", ".", "pos", "=", "pos", ";", "this", ".", "len", "=", "len", ";", "this", ".", "linePoint...
Strains this object into the memory area. @param data the memory area @param pos the initial position @param len the length of area to use
[ "Strains", "this", "object", "into", "the", "memory", "area", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L140-L145
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.duplicate
public void duplicate(Text destination) { System.arraycopy(chars, pos, destination.chars, destination.pos, len); destination.len = len; }
java
public void duplicate(Text destination) { System.arraycopy(chars, pos, destination.chars, destination.pos, len); destination.len = len; }
[ "public", "void", "duplicate", "(", "Text", "destination", ")", "{", "System", ".", "arraycopy", "(", "chars", ",", "pos", ",", "destination", ".", "chars", ",", "destination", ".", "pos", ",", "len", ")", ";", "destination", ".", "len", "=", "len", ";...
Copies data from this buffer to another buffer. @param destination the pointer to another buffer.
[ "Copies", "data", "from", "this", "buffer", "to", "another", "buffer", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L177-L180
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.divide
public int divide(char separator, Text[] parts) { int pointer = pos; int limit = pos + len; int mark = pointer; int count = 0; while (pointer < limit) { if (chars[pointer] == separator) { parts[count].strain(chars, mark, pointer - mark); ...
java
public int divide(char separator, Text[] parts) { int pointer = pos; int limit = pos + len; int mark = pointer; int count = 0; while (pointer < limit) { if (chars[pointer] == separator) { parts[count].strain(chars, mark, pointer - mark); ...
[ "public", "int", "divide", "(", "char", "separator", ",", "Text", "[", "]", "parts", ")", "{", "int", "pointer", "=", "pos", ";", "int", "limit", "=", "pos", "+", "len", ";", "int", "mark", "=", "pointer", ";", "int", "count", "=", "0", ";", "whi...
Divides text into parts using given separator and writes results into the parts array. @param separator the character used for splitting @param parts the array used to hold parts of the text @return the number of parts.
[ "Divides", "text", "into", "parts", "using", "given", "separator", "and", "writes", "results", "into", "the", "parts", "array", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L190-L216
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.trim
public void trim() { try { //cut white spaces from the head while (len>0 && chars[pos] == ' ') { pos++; len--; } //cut from the end while (len>0 && (chars[pos + len - 1] == ' ' || chars[pos + len - 1] == '\n' || chars[pos + len - 1] == '\r')) { len--; }...
java
public void trim() { try { //cut white spaces from the head while (len>0 && chars[pos] == ' ') { pos++; len--; } //cut from the end while (len>0 && (chars[pos + len - 1] == ' ' || chars[pos + len - 1] == '\n' || chars[pos + len - 1] == '\r')) { len--; }...
[ "public", "void", "trim", "(", ")", "{", "try", "{", "//cut white spaces from the head", "while", "(", "len", ">", "0", "&&", "chars", "[", "pos", "]", "==", "'", "'", ")", "{", "pos", "++", ";", "len", "--", ";", "}", "//cut from the end", "while", ...
Removes whitespace from the head and tail of the string.
[ "Removes", "whitespace", "from", "the", "head", "and", "tail", "of", "the", "string", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L368-L386
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.nextLine
public Text nextLine() { if (linePointer == 0) { linePointer = pos; } else { linePointer++; } int mark = linePointer; int limit = pos + len; while (linePointer < limit && chars[linePointer] != '\n') { linePointer++; } ...
java
public Text nextLine() { if (linePointer == 0) { linePointer = pos; } else { linePointer++; } int mark = linePointer; int limit = pos + len; while (linePointer < limit && chars[linePointer] != '\n') { linePointer++; } ...
[ "public", "Text", "nextLine", "(", ")", "{", "if", "(", "linePointer", "==", "0", ")", "{", "linePointer", "=", "pos", ";", "}", "else", "{", "linePointer", "++", ";", "}", "int", "mark", "=", "linePointer", ";", "int", "limit", "=", "pos", "+", "l...
Extracts next line from this text. @return
[ "Extracts", "next", "line", "from", "this", "text", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L393-L408
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.compareChars
private boolean compareChars(byte[] chars, int pos) { for (int i = 0; i < len; i++) { if (differentChars((char) this.chars[i + this.pos], (char) chars[i + pos])) return false; } return true; }
java
private boolean compareChars(byte[] chars, int pos) { for (int i = 0; i < len; i++) { if (differentChars((char) this.chars[i + this.pos], (char) chars[i + pos])) return false; } return true; }
[ "private", "boolean", "compareChars", "(", "byte", "[", "]", "chars", ",", "int", "pos", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "differentChars", "(", "(", "char", ")", "this", "."...
Compares specified character string with current string. The upper and lower case characters are considered as equals. @param chars the string to be compared @return true if specified string equals to current
[ "Compares", "specified", "character", "string", "with", "current", "string", ".", "The", "upper", "and", "lower", "case", "characters", "are", "considered", "as", "equals", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L453-L458
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.startsWith
public boolean startsWith(Text pattern) { if (pattern == null) { return false; } return this.subSequence(0, pattern.len).equals(pattern); }
java
public boolean startsWith(Text pattern) { if (pattern == null) { return false; } return this.subSequence(0, pattern.len).equals(pattern); }
[ "public", "boolean", "startsWith", "(", "Text", "pattern", ")", "{", "if", "(", "pattern", "==", "null", ")", "{", "return", "false", ";", "}", "return", "this", ".", "subSequence", "(", "0", ",", "pattern", ".", "len", ")", ".", "equals", "(", "patt...
Indicates whether the text starts with a certain pattern. @param pattern The pattern to match @return <code>true</code> if this text starts with the pattern. Otherwise, or if the pattern is null, returns <code>false</code>. @author hrosa
[ "Indicates", "whether", "the", "text", "starts", "with", "a", "certain", "pattern", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L469-L474
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.differentChars
private boolean differentChars(char c1, char c2) { if (65 <= c1 && c1 < 97) { c1 +=32; } if (65 <= c2 && c2 < 97) { c2 +=32; } return c1 != c2; }
java
private boolean differentChars(char c1, char c2) { if (65 <= c1 && c1 < 97) { c1 +=32; } if (65 <= c2 && c2 < 97) { c2 +=32; } return c1 != c2; }
[ "private", "boolean", "differentChars", "(", "char", "c1", ",", "char", "c2", ")", "{", "if", "(", "65", "<=", "c1", "&&", "c1", "<", "97", ")", "{", "c1", "+=", "32", ";", "}", "if", "(", "65", "<=", "c2", "&&", "c2", "<", "97", ")", "{", ...
Compares two chars. @param c1 the first char @param c2 the second char @return true if first and second chars are different.
[ "Compares", "two", "chars", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L483-L492
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.toInteger
public int toInteger() throws NumberFormatException { int res = 0; byte currChar; int i=1; currChar=chars[pos]; boolean isMinus=false; if(currChar==minus_byte) isMinus=true; else if(currChar>=zero_byte && currChar<=nine_byte) res+=currChar-...
java
public int toInteger() throws NumberFormatException { int res = 0; byte currChar; int i=1; currChar=chars[pos]; boolean isMinus=false; if(currChar==minus_byte) isMinus=true; else if(currChar>=zero_byte && currChar<=nine_byte) res+=currChar-...
[ "public", "int", "toInteger", "(", ")", "throws", "NumberFormatException", "{", "int", "res", "=", "0", ";", "byte", "currChar", ";", "int", "i", "=", "1", ";", "currChar", "=", "chars", "[", "pos", "]", ";", "boolean", "isMinus", "=", "false", ";", ...
Converts string value to integer @return integer value
[ "Converts", "string", "value", "to", "integer" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L503-L532
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.copyRemainder
public void copyRemainder(Text other) { other.chars = this.chars; other.pos = this.linePointer + 1; other.len = this.len - this.linePointer - 1; }
java
public void copyRemainder(Text other) { other.chars = this.chars; other.pos = this.linePointer + 1; other.len = this.len - this.linePointer - 1; }
[ "public", "void", "copyRemainder", "(", "Text", "other", ")", "{", "other", ".", "chars", "=", "this", ".", "chars", ";", "other", ".", "pos", "=", "this", ".", "linePointer", "+", "1", ";", "other", ".", "len", "=", "this", ".", "len", "-", "this"...
Copies substring from the current line upto the end to the specified destination. @param other the destination object
[ "Copies", "substring", "from", "the", "current", "line", "upto", "the", "end", "to", "the", "specified", "destination", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L629-L633
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java
Text.contains
public boolean contains(char c) { for (int k = pos; k < len; k++) { if (chars[k] == c) return true; } return false; }
java
public boolean contains(char c) { for (int k = pos; k < len; k++) { if (chars[k] == c) return true; } return false; }
[ "public", "boolean", "contains", "(", "char", "c", ")", "{", "for", "(", "int", "k", "=", "pos", ";", "k", "<", "len", ";", "k", "++", ")", "{", "if", "(", "chars", "[", "k", "]", "==", "c", ")", "return", "true", ";", "}", "return", "false",...
Checks does specified symbol is present in this text. @param c the character to verify. @return true if character c is presented in this text and false otherwise.
[ "Checks", "does", "specified", "symbol", "is", "present", "in", "this", "text", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/utils/Text.java#L641-L646
train
RestComm/media-core
client/jsr-309/driver/src/main/java/org/restcomm/javax/media/mscontrol/spi/DriverImpl.java
DriverImpl.attach
public void attach(RequestIdentifier reqID, JainMgcpListener listener) { this.requestListeners.put(reqID.toString().trim(), listener); }
java
public void attach(RequestIdentifier reqID, JainMgcpListener listener) { this.requestListeners.put(reqID.toString().trim(), listener); }
[ "public", "void", "attach", "(", "RequestIdentifier", "reqID", ",", "JainMgcpListener", "listener", ")", "{", "this", ".", "requestListeners", ".", "put", "(", "reqID", ".", "toString", "(", ")", ".", "trim", "(", ")", ",", "listener", ")", ";", "}" ]
Attaches listener to the specific request. @param reqID the request identifier. @param listener listener to be attached.
[ "Attaches", "listener", "to", "the", "specific", "request", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/jsr-309/driver/src/main/java/org/restcomm/javax/media/mscontrol/spi/DriverImpl.java#L171-L173
train
RestComm/media-core
client/jsr-309/driver/src/main/java/org/restcomm/javax/media/mscontrol/spi/DriverImpl.java
DriverImpl.deattach
public void deattach(JainMgcpListener listener) { int identifier = -1; //search identifier of the specified listener Set<Integer> IDs = txListeners.keySet(); for (Integer id : IDs) { if (txListeners.get(id) == listener) { identifier = id; ...
java
public void deattach(JainMgcpListener listener) { int identifier = -1; //search identifier of the specified listener Set<Integer> IDs = txListeners.keySet(); for (Integer id : IDs) { if (txListeners.get(id) == listener) { identifier = id; ...
[ "public", "void", "deattach", "(", "JainMgcpListener", "listener", ")", "{", "int", "identifier", "=", "-", "1", ";", "//search identifier of the specified listener ", "Set", "<", "Integer", ">", "IDs", "=", "txListeners", ".", "keySet", "(", ")", ";", "for", ...
Deattaches transaction listener upon user request. @param listener the listener to deattach.
[ "Deattaches", "transaction", "listener", "upon", "user", "request", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/jsr-309/driver/src/main/java/org/restcomm/javax/media/mscontrol/spi/DriverImpl.java#L201-L217
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/statistics/RtpStatistics.java
RtpStatistics.isSenderTimeout
public boolean isSenderTimeout() { long t = rtcpReceiverInterval(false); long minTime = getCurrentTime() - (2 * t); if (this.rtpSentOn < minTime) { removeSender(this.ssrc); } return this.weSent; }
java
public boolean isSenderTimeout() { long t = rtcpReceiverInterval(false); long minTime = getCurrentTime() - (2 * t); if (this.rtpSentOn < minTime) { removeSender(this.ssrc); } return this.weSent; }
[ "public", "boolean", "isSenderTimeout", "(", ")", "{", "long", "t", "=", "rtcpReceiverInterval", "(", "false", ")", ";", "long", "minTime", "=", "getCurrentTime", "(", ")", "-", "(", "2", "*", "t", ")", ";", "if", "(", "this", ".", "rtpSentOn", "<", ...
Checks whether this SSRC is still a sender. If an RTP packet has not been transmitted since time tc - 2T, the participant removes itself from the sender table, decrements the sender count, and sets we_sent to false. @return whether this SSRC is still considered a sender
[ "Checks", "whether", "this", "SSRC", "is", "still", "a", "sender", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/statistics/RtpStatistics.java#L522-L530
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/OriginField.java
OriginField.strain
public void strain(Text line) throws ParseException { try { Iterator<Text> it = line.split('=').iterator(); it.next(); Text token = it.next(); it = token.split(' ').iterator(); name = it.next(); name.trim(); sessionID = it.ne...
java
public void strain(Text line) throws ParseException { try { Iterator<Text> it = line.split('=').iterator(); it.next(); Text token = it.next(); it = token.split(' ').iterator(); name = it.next(); name.trim(); sessionID = it.ne...
[ "public", "void", "strain", "(", "Text", "line", ")", "throws", "ParseException", "{", "try", "{", "Iterator", "<", "Text", ">", "it", "=", "line", ".", "split", "(", "'", "'", ")", ".", "iterator", "(", ")", ";", "it", ".", "next", "(", ")", ";"...
Reads attribute from text. @param line the text.
[ "Reads", "attribute", "from", "text", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/OriginField.java#L59-L87
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/connection/MgcpRemoteConnection.java
MgcpRemoteConnection.setupAudioChannelInbound
private void setupAudioChannelInbound(MediaDescriptionField remoteAudio) throws IOException { // Negotiate audio codecs this.audioChannel.negotiateFormats(remoteAudio); if (!this.audioChannel.containsNegotiatedFormats()) { throw new IOException("Audio codecs were not supported"); ...
java
private void setupAudioChannelInbound(MediaDescriptionField remoteAudio) throws IOException { // Negotiate audio codecs this.audioChannel.negotiateFormats(remoteAudio); if (!this.audioChannel.containsNegotiatedFormats()) { throw new IOException("Audio codecs were not supported"); ...
[ "private", "void", "setupAudioChannelInbound", "(", "MediaDescriptionField", "remoteAudio", ")", "throws", "IOException", "{", "// Negotiate audio codecs", "this", ".", "audioChannel", ".", "negotiateFormats", "(", "remoteAudio", ")", ";", "if", "(", "!", "this", ".",...
Reads the remote SDP offer and sets up the available resources according to the call type. @param remoteAudio The description of the remote audio channel. @throws IOException When binding the audio data channel or when failing to negotiate codecs.
[ "Reads", "the", "remote", "SDP", "offer", "and", "sets", "up", "the", "available", "resources", "according", "to", "the", "call", "type", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/connection/MgcpRemoteConnection.java#L328-L354
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/connection/MgcpRemoteConnection.java
MgcpRemoteConnection.setupAudioChannelOutbound
private void setupAudioChannelOutbound(MediaDescriptionField remoteAudio) throws IOException { // Negotiate audio codecs this.audioChannel.negotiateFormats(remoteAudio); if (!this.audioChannel.containsNegotiatedFormats()) { throw new IOException("Audio codecs were not supported"); ...
java
private void setupAudioChannelOutbound(MediaDescriptionField remoteAudio) throws IOException { // Negotiate audio codecs this.audioChannel.negotiateFormats(remoteAudio); if (!this.audioChannel.containsNegotiatedFormats()) { throw new IOException("Audio codecs were not supported"); ...
[ "private", "void", "setupAudioChannelOutbound", "(", "MediaDescriptionField", "remoteAudio", ")", "throws", "IOException", "{", "// Negotiate audio codecs", "this", ".", "audioChannel", ".", "negotiateFormats", "(", "remoteAudio", ")", ";", "if", "(", "!", "this", "."...
Reads the remote SDP answer and sets up the proper media channels. @param remoteAudio The description of the remote audio channel. @throws IOException When binding the audio data channel or when failing to negotiate codecs.
[ "Reads", "the", "remote", "SDP", "answer", "and", "sets", "up", "the", "proper", "media", "channels", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/connection/MgcpRemoteConnection.java#L385-L423
train
RestComm/media-core
network/src/main/java/org/restcomm/media/core/network/deprecated/channel/PacketHandlerPipeline.java
PacketHandlerPipeline.removeHandler
public boolean removeHandler(PacketHandler handler) { synchronized (this.handlers) { boolean removed = this.handlers.remove(handler); if (removed) { this.count.decrementAndGet(); } return removed; } }
java
public boolean removeHandler(PacketHandler handler) { synchronized (this.handlers) { boolean removed = this.handlers.remove(handler); if (removed) { this.count.decrementAndGet(); } return removed; } }
[ "public", "boolean", "removeHandler", "(", "PacketHandler", "handler", ")", "{", "synchronized", "(", "this", ".", "handlers", ")", "{", "boolean", "removed", "=", "this", ".", "handlers", ".", "remove", "(", "handler", ")", ";", "if", "(", "removed", ")",...
Removes an existing packet handler from the pipeline. @param handler The handler to be removed @return Returns true if the handler is removed successfully. Returns false, if the handler is not registered in the pipeline.
[ "Removes", "an", "existing", "packet", "handler", "from", "the", "pipeline", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/channel/PacketHandlerPipeline.java#L79-L87
train
RestComm/media-core
network/src/main/java/org/restcomm/media/core/network/deprecated/channel/PacketHandlerPipeline.java
PacketHandlerPipeline.getHandler
public PacketHandler getHandler(byte[] packet) { synchronized (this.handlers) { // Search for the first handler capable of processing the packet for (PacketHandler protocolHandler : this.handlers) { if (protocolHandler.canHandle(packet)) { return proto...
java
public PacketHandler getHandler(byte[] packet) { synchronized (this.handlers) { // Search for the first handler capable of processing the packet for (PacketHandler protocolHandler : this.handlers) { if (protocolHandler.canHandle(packet)) { return proto...
[ "public", "PacketHandler", "getHandler", "(", "byte", "[", "]", "packet", ")", "{", "synchronized", "(", "this", ".", "handlers", ")", "{", "// Search for the first handler capable of processing the packet", "for", "(", "PacketHandler", "protocolHandler", ":", "this", ...
Gets the protocol handler capable of processing the packet. @param packet The packet to be processed @return The protocol handler capable of processing the packet.<br> Returns null in case no capable handler exists.
[ "Gets", "the", "protocol", "handler", "capable", "of", "processing", "the", "packet", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/channel/PacketHandlerPipeline.java#L117-L129
train
RestComm/media-core
client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/stack/JainMgcpStackImpl.java
JainMgcpStackImpl.close
public void close() { stopped = true; try { if (logger.isDebugEnabled()) { logger.debug("Closing socket"); } // selector.close(); socket.close(); if (this.channel != null) { this.channel.close(); } for(int i=0;i<decodingThreads.length;i++) { decodingThreads[i].shutdown(); } ...
java
public void close() { stopped = true; try { if (logger.isDebugEnabled()) { logger.debug("Closing socket"); } // selector.close(); socket.close(); if (this.channel != null) { this.channel.close(); } for(int i=0;i<decodingThreads.length;i++) { decodingThreads[i].shutdown(); } ...
[ "public", "void", "close", "(", ")", "{", "stopped", "=", "true", ";", "try", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"Closing socket\"", ")", ";", "}", "// selector.close();", "socket", ".", ...
Closes the stack and it's underlying resources.
[ "Closes", "the", "stack", "and", "it", "s", "underlying", "resources", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/mgcp/driver/src/main/java/org/restcomm/media/client/mgcp/stack/JainMgcpStackImpl.java#L216-L239
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java
SRTPCryptoContext.reverseTransformPacket
public boolean reverseTransformPacket(RawPacket pkt) { int seqNo = pkt.getSequenceNumber(); if (!seqNumSet) { seqNumSet = true; seqNum = seqNo; } // Guess the SRTP index (48 bit), see rFC 3711, 3.3.1 // Stores the guessed roc in this.guessedROC long guessedIndex = guessIndex(seqNo); // Replay c...
java
public boolean reverseTransformPacket(RawPacket pkt) { int seqNo = pkt.getSequenceNumber(); if (!seqNumSet) { seqNumSet = true; seqNum = seqNo; } // Guess the SRTP index (48 bit), see rFC 3711, 3.3.1 // Stores the guessed roc in this.guessedROC long guessedIndex = guessIndex(seqNo); // Replay c...
[ "public", "boolean", "reverseTransformPacket", "(", "RawPacket", "pkt", ")", "{", "int", "seqNo", "=", "pkt", ".", "getSequenceNumber", "(", ")", ";", "if", "(", "!", "seqNumSet", ")", "{", "seqNumSet", "=", "true", ";", "seqNum", "=", "seqNo", ";", "}",...
Transform a SRTP packet into a RTP packet. This method is called when a SRTP packet is received. Operations done by the this operation include: Authentication check, Packet replay check and Decryption. Both encryption and authentication functionality can be turned off as long as the SRTPPolicy used in this SRTPCrypto...
[ "Transform", "a", "SRTP", "packet", "into", "a", "RTP", "packet", ".", "This", "method", "is", "called", "when", "a", "SRTP", "packet", "is", "received", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L397-L451
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java
SRTPCryptoContext.authenticatePacketHMCSHA1
private void authenticatePacketHMCSHA1(RawPacket pkt, int rocIn) { ByteBuffer buf = pkt.getBuffer(); buf.rewind(); int len = buf.remaining(); buf.get(tempBuffer, 0, len); mac.update(tempBuffer, 0, len); rbStore[0] = (byte) (rocIn >> 24); rbStore[1] = (byte) (rocIn >> 16); rbStore[2] = (byte) (rocIn >> 8...
java
private void authenticatePacketHMCSHA1(RawPacket pkt, int rocIn) { ByteBuffer buf = pkt.getBuffer(); buf.rewind(); int len = buf.remaining(); buf.get(tempBuffer, 0, len); mac.update(tempBuffer, 0, len); rbStore[0] = (byte) (rocIn >> 24); rbStore[1] = (byte) (rocIn >> 16); rbStore[2] = (byte) (rocIn >> 8...
[ "private", "void", "authenticatePacketHMCSHA1", "(", "RawPacket", "pkt", ",", "int", "rocIn", ")", "{", "ByteBuffer", "buf", "=", "pkt", ".", "getBuffer", "(", ")", ";", "buf", ".", "rewind", "(", ")", ";", "int", "len", "=", "buf", ".", "remaining", "...
Authenticate a packet. Calculated authentication tag is returned. @param pkt the RTP packet to be authenticated @param rocIn Roll-Over-Counter
[ "Authenticate", "a", "packet", ".", "Calculated", "authentication", "tag", "is", "returned", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L522-L534
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java
SRTPCryptoContext.computeIv
private void computeIv(long label, long index) { long key_id; if (keyDerivationRate == 0) { key_id = label << 48; } else { key_id = ((label << 48) | (index / keyDerivationRate)); } for (int i = 0; i < 7; i++) { ivStore[i] = masterSalt[i]; } for (int i = 7; i < 14; i++) { ivStore[i] = (byte) (...
java
private void computeIv(long label, long index) { long key_id; if (keyDerivationRate == 0) { key_id = label << 48; } else { key_id = ((label << 48) | (index / keyDerivationRate)); } for (int i = 0; i < 7; i++) { ivStore[i] = masterSalt[i]; } for (int i = 7; i < 14; i++) { ivStore[i] = (byte) (...
[ "private", "void", "computeIv", "(", "long", "label", ",", "long", "index", ")", "{", "long", "key_id", ";", "if", "(", "keyDerivationRate", "==", "0", ")", "{", "key_id", "=", "label", "<<", "48", ";", "}", "else", "{", "key_id", "=", "(", "(", "l...
Compute the initialization vector, used later by encryption algorithms, based on the lable, the packet index, key derivation rate and master salt key. @param label label specified for each type of iv @param index 48bit RTP packet index
[ "Compute", "the", "initialization", "vector", "used", "later", "by", "encryption", "algorithms", "based", "on", "the", "lable", "the", "packet", "index", "key", "derivation", "rate", "and", "master", "salt", "key", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L587-L602
train
RestComm/media-core
component/src/main/java/org/restcomm/media/core/component/dsp/DspFactoryImpl.java
DspFactoryImpl.newProcessor
@Override public Dsp newProcessor() throws InstantiationException, ClassNotFoundException, IllegalAccessException { int numClasses = this.classes.size(); Codec[] codecs = new Codec[numClasses]; for(int i = 0; i < numClasses; i++) { String fqn = this.classes.get(i); Cl...
java
@Override public Dsp newProcessor() throws InstantiationException, ClassNotFoundException, IllegalAccessException { int numClasses = this.classes.size(); Codec[] codecs = new Codec[numClasses]; for(int i = 0; i < numClasses; i++) { String fqn = this.classes.get(i); Cl...
[ "@", "Override", "public", "Dsp", "newProcessor", "(", ")", "throws", "InstantiationException", ",", "ClassNotFoundException", ",", "IllegalAccessException", "{", "int", "numClasses", "=", "this", ".", "classes", ".", "size", "(", ")", ";", "Codec", "[", "]", ...
Creates new DSP. @return DSP instance. @throws InstantiationException @throws ClassNotFoundException @throws IllegalAccessException
[ "Creates", "new", "DSP", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/component/src/main/java/org/restcomm/media/core/component/dsp/DspFactoryImpl.java#L71-L82
train
RestComm/media-core
concurrent/src/main/java/org/restcomm/media/core/concurrent/ConcurrentCyclicFIFO.java
ConcurrentCyclicFIFO.extract
private Node<E> extract() { Node<E> current = head; head = head.next; current.item = head.item; head.item = null; return current; }
java
private Node<E> extract() { Node<E> current = head; head = head.next; current.item = head.item; head.item = null; return current; }
[ "private", "Node", "<", "E", ">", "extract", "(", ")", "{", "Node", "<", "E", ">", "current", "=", "head", ";", "head", "=", "head", ".", "next", ";", "current", ".", "item", "=", "head", ".", "item", ";", "head", ".", "item", "=", "null", ";",...
Removes a node from head of queue, @return the node
[ "Removes", "a", "node", "from", "head", "of", "queue" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/concurrent/src/main/java/org/restcomm/media/core/concurrent/ConcurrentCyclicFIFO.java#L94-L102
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/statistics/RtpMember.java
RtpMember.estimateJitter
private void estimateJitter(RtpPacket packet) { long transit = rtpClock.getLocalRtpTime() - packet.getTimestamp(); long d = transit - this.currentTransit; this.currentTransit = transit; if(d < 0) { d = -d; } this.jitter += d - ((this.jitter + 8) >> 4); }
java
private void estimateJitter(RtpPacket packet) { long transit = rtpClock.getLocalRtpTime() - packet.getTimestamp(); long d = transit - this.currentTransit; this.currentTransit = transit; if(d < 0) { d = -d; } this.jitter += d - ((this.jitter + 8) >> 4); }
[ "private", "void", "estimateJitter", "(", "RtpPacket", "packet", ")", "{", "long", "transit", "=", "rtpClock", ".", "getLocalRtpTime", "(", ")", "-", "packet", ".", "getTimestamp", "(", ")", ";", "long", "d", "=", "transit", "-", "this", ".", "currentTrans...
Calculates interarrival jitter interval. <p> <code> int transit = arrival - r->ts;<br> int d = transit - s->transit;<br> s->transit = transit;<br> if (d < 0) d = -d;<br> s->jitter += (1./16.) * ((double)d - s->jitter);<br> </code> </p> @param packet @return @see <a href="http://tools.ietf.org/html/rfc3550#appendix-A....
[ "Calculates", "interarrival", "jitter", "interval", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/statistics/RtpMember.java#L342-L352
train
RestComm/media-core
spi/src/main/java/org/restcomm/media/core/spi/format/FormatFactory.java
FormatFactory.createAudioFormat
public static AudioFormat createAudioFormat(EncodingName name) { //check name and create specific if (name.equals(DTMF)) { return new DTMFFormat(); } //default format return new AudioFormat(name); }
java
public static AudioFormat createAudioFormat(EncodingName name) { //check name and create specific if (name.equals(DTMF)) { return new DTMFFormat(); } //default format return new AudioFormat(name); }
[ "public", "static", "AudioFormat", "createAudioFormat", "(", "EncodingName", "name", ")", "{", "//check name and create specific", "if", "(", "name", ".", "equals", "(", "DTMF", ")", ")", "{", "return", "new", "DTMFFormat", "(", ")", ";", "}", "//default format"...
Creates new audio format descriptor. @param name the encoding name.
[ "Creates", "new", "audio", "format", "descriptor", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/spi/src/main/java/org/restcomm/media/core/spi/format/FormatFactory.java#L41-L49
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createChangeRequestAttribute
public static ChangeRequestAttribute createChangeRequestAttribute( boolean changeIP, boolean changePort) { ChangeRequestAttribute attribute = new ChangeRequestAttribute(); attribute.setAddressChanging(changeIP); attribute.setPortChanging(changePort); return attribute; }
java
public static ChangeRequestAttribute createChangeRequestAttribute( boolean changeIP, boolean changePort) { ChangeRequestAttribute attribute = new ChangeRequestAttribute(); attribute.setAddressChanging(changeIP); attribute.setPortChanging(changePort); return attribute; }
[ "public", "static", "ChangeRequestAttribute", "createChangeRequestAttribute", "(", "boolean", "changeIP", ",", "boolean", "changePort", ")", "{", "ChangeRequestAttribute", "attribute", "=", "new", "ChangeRequestAttribute", "(", ")", ";", "attribute", ".", "setAddressChang...
Creates a ChangeRequestAttribute with the specified flag values. @param changeIP the value of the changeIP flag. @param changePort the value of the changePort flag. @return the newly created ChangeRequestAttribute.
[ "Creates", "a", "ChangeRequestAttribute", "with", "the", "specified", "flag", "values", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L70-L78
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createChangedAddressAttribute
public static ChangedAddressAttribute createChangedAddressAttribute( TransportAddress address) { ChangedAddressAttribute attribute = new ChangedAddressAttribute(); attribute.setAddress(address); return attribute; }
java
public static ChangedAddressAttribute createChangedAddressAttribute( TransportAddress address) { ChangedAddressAttribute attribute = new ChangedAddressAttribute(); attribute.setAddress(address); return attribute; }
[ "public", "static", "ChangedAddressAttribute", "createChangedAddressAttribute", "(", "TransportAddress", "address", ")", "{", "ChangedAddressAttribute", "attribute", "=", "new", "ChangedAddressAttribute", "(", ")", ";", "attribute", ".", "setAddress", "(", "address", ")",...
Creates a changedAddressAttribute of the specified type and with the specified address and port @param address the address value of the address attribute @return the newly created address attribute.
[ "Creates", "a", "changedAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L88-L95
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createErrorCodeAttribute
public static ErrorCodeAttribute createErrorCodeAttribute(byte errorClass, byte errorNumber, String reasonPhrase) throws StunException { ErrorCodeAttribute attribute = new ErrorCodeAttribute(); attribute.setErrorClass(errorClass); attribute.setErrorNumber(errorNumber); attribute.setReasonPhrase(reasonPhras...
java
public static ErrorCodeAttribute createErrorCodeAttribute(byte errorClass, byte errorNumber, String reasonPhrase) throws StunException { ErrorCodeAttribute attribute = new ErrorCodeAttribute(); attribute.setErrorClass(errorClass); attribute.setErrorNumber(errorNumber); attribute.setReasonPhrase(reasonPhras...
[ "public", "static", "ErrorCodeAttribute", "createErrorCodeAttribute", "(", "byte", "errorClass", ",", "byte", "errorNumber", ",", "String", "reasonPhrase", ")", "throws", "StunException", "{", "ErrorCodeAttribute", "attribute", "=", "new", "ErrorCodeAttribute", "(", ")"...
Creates an ErrorCodeAttribute with the specified error class, number and reason phrase. @param errorClass a valid error class. @param errorNumber a valid error number. @param reasonPhrase a human readable reason phrase. A null reason phrase would be replaced (if possible) by a default one as defined byte the rfc3489. ...
[ "Creates", "an", "ErrorCodeAttribute", "with", "the", "specified", "error", "class", "number", "and", "reason", "phrase", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L132-L144
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createErrorCodeAttribute
public static ErrorCodeAttribute createErrorCodeAttribute(char errorCode, String reasonPhrase) throws IllegalArgumentException { ErrorCodeAttribute attribute = new ErrorCodeAttribute(); attribute.setErrorCode(errorCode); attribute.setReasonPhrase(reasonPhrase == null ? ErrorCodeAttribute .getDefaultReason...
java
public static ErrorCodeAttribute createErrorCodeAttribute(char errorCode, String reasonPhrase) throws IllegalArgumentException { ErrorCodeAttribute attribute = new ErrorCodeAttribute(); attribute.setErrorCode(errorCode); attribute.setReasonPhrase(reasonPhrase == null ? ErrorCodeAttribute .getDefaultReason...
[ "public", "static", "ErrorCodeAttribute", "createErrorCodeAttribute", "(", "char", "errorCode", ",", "String", "reasonPhrase", ")", "throws", "IllegalArgumentException", "{", "ErrorCodeAttribute", "attribute", "=", "new", "ErrorCodeAttribute", "(", ")", ";", "attribute", ...
Creates an ErrorCodeAttribute with the specified error code and reason phrase. @param errorCode a valid error code. @param reasonPhrase a human readable reason phrase. A null reason phrase would be replaced (if possible) by a default one as defined byte the rfc3489. @return the newly created attribute. @throws Illega...
[ "Creates", "an", "ErrorCodeAttribute", "with", "the", "specified", "error", "code", "and", "reason", "phrase", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L176-L186
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createMappedAddressAttribute
public static MappedAddressAttribute createMappedAddressAttribute( TransportAddress address) { MappedAddressAttribute attribute = new MappedAddressAttribute(); attribute.setAddress(address); return attribute; }
java
public static MappedAddressAttribute createMappedAddressAttribute( TransportAddress address) { MappedAddressAttribute attribute = new MappedAddressAttribute(); attribute.setAddress(address); return attribute; }
[ "public", "static", "MappedAddressAttribute", "createMappedAddressAttribute", "(", "TransportAddress", "address", ")", "{", "MappedAddressAttribute", "attribute", "=", "new", "MappedAddressAttribute", "(", ")", ";", "attribute", ".", "setAddress", "(", "address", ")", "...
Creates a MappedAddressAttribute of the specified type and with the specified address and port @param address the address value of the address attribute @return the newly created address attribute.
[ "Creates", "a", "MappedAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L196-L203
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createReflectedFromAttribute
public static ReflectedFromAttribute createReflectedFromAttribute( TransportAddress address) { ReflectedFromAttribute attribute = new ReflectedFromAttribute(); attribute.setAddress(address); return attribute; }
java
public static ReflectedFromAttribute createReflectedFromAttribute( TransportAddress address) { ReflectedFromAttribute attribute = new ReflectedFromAttribute(); attribute.setAddress(address); return attribute; }
[ "public", "static", "ReflectedFromAttribute", "createReflectedFromAttribute", "(", "TransportAddress", "address", ")", "{", "ReflectedFromAttribute", "attribute", "=", "new", "ReflectedFromAttribute", "(", ")", ";", "attribute", ".", "setAddress", "(", "address", ")", "...
Creates a ReflectedFromAddressAttribute of the specified type and with the specified address and port @param address the address value of the address attribute @return the newly created address attribute.
[ "Creates", "a", "ReflectedFromAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L213-L220
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createResponseAddressAttribute
public static ResponseAddressAttribute createResponseAddressAttribute( TransportAddress address) { ResponseAddressAttribute attribute = new ResponseAddressAttribute(); attribute.setAddress(address); return attribute; }
java
public static ResponseAddressAttribute createResponseAddressAttribute( TransportAddress address) { ResponseAddressAttribute attribute = new ResponseAddressAttribute(); attribute.setAddress(address); return attribute; }
[ "public", "static", "ResponseAddressAttribute", "createResponseAddressAttribute", "(", "TransportAddress", "address", ")", "{", "ResponseAddressAttribute", "attribute", "=", "new", "ResponseAddressAttribute", "(", ")", ";", "attribute", ".", "setAddress", "(", "address", ...
Creates a ResponseFromAddressAttribute of the specified type and with the specified address and port @param address the address value of the address attribute @return the newly created address attribute.
[ "Creates", "a", "ResponseFromAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L230-L237
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createSourceAddressAttribute
public static SourceAddressAttribute createSourceAddressAttribute( TransportAddress address) { SourceAddressAttribute attribute = new SourceAddressAttribute(); attribute.setAddress(address); return attribute; }
java
public static SourceAddressAttribute createSourceAddressAttribute( TransportAddress address) { SourceAddressAttribute attribute = new SourceAddressAttribute(); attribute.setAddress(address); return attribute; }
[ "public", "static", "SourceAddressAttribute", "createSourceAddressAttribute", "(", "TransportAddress", "address", ")", "{", "SourceAddressAttribute", "attribute", "=", "new", "SourceAddressAttribute", "(", ")", ";", "attribute", ".", "setAddress", "(", "address", ")", "...
Creates a SourceFromAddressAttribute of the specified type and with the specified address and port @param address the address value of the address attribute @return the newly created address attribute.
[ "Creates", "a", "SourceFromAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L247-L254
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createXorRelayedAddressAttribute
public static XorRelayedAddressAttribute createXorRelayedAddressAttribute( TransportAddress address, byte[] tranID) { XorRelayedAddressAttribute attribute = new XorRelayedAddressAttribute(); // TODO shouldn't we be XORing the address before setting it? attribute.setAddress(address, tranID); return attribute...
java
public static XorRelayedAddressAttribute createXorRelayedAddressAttribute( TransportAddress address, byte[] tranID) { XorRelayedAddressAttribute attribute = new XorRelayedAddressAttribute(); // TODO shouldn't we be XORing the address before setting it? attribute.setAddress(address, tranID); return attribute...
[ "public", "static", "XorRelayedAddressAttribute", "createXorRelayedAddressAttribute", "(", "TransportAddress", "address", ",", "byte", "[", "]", "tranID", ")", "{", "XorRelayedAddressAttribute", "attribute", "=", "new", "XorRelayedAddressAttribute", "(", ")", ";", "// TOD...
Creates a XorRelayedAddressAttribute of the specified type and with the specified address and port. @param address the address value of the address attribute @param tranID the ID of the transaction that we will be using for the XOR mask. @return the newly created address attribute.
[ "Creates", "a", "XorRelayedAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L279-L286
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createXorPeerAddressAttribute
public static XorPeerAddressAttribute createXorPeerAddressAttribute( TransportAddress address, byte[] tranID) { XorPeerAddressAttribute attribute = new XorPeerAddressAttribute(); // TODO shouldn't we be XORing the address before setting it? attribute.setAddress(address, tranID); return attribute; }
java
public static XorPeerAddressAttribute createXorPeerAddressAttribute( TransportAddress address, byte[] tranID) { XorPeerAddressAttribute attribute = new XorPeerAddressAttribute(); // TODO shouldn't we be XORing the address before setting it? attribute.setAddress(address, tranID); return attribute; }
[ "public", "static", "XorPeerAddressAttribute", "createXorPeerAddressAttribute", "(", "TransportAddress", "address", ",", "byte", "[", "]", "tranID", ")", "{", "XorPeerAddressAttribute", "attribute", "=", "new", "XorPeerAddressAttribute", "(", ")", ";", "// TODO shouldn't ...
Creates a XorPeerAddressAttribute of the specified type and with the specified address and port @param address the address value of the address attribute @param tranID the ID of the transaction that we will be using for the XOR mask. @return the newly created address attribute.
[ "Creates", "a", "XorPeerAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L299-L306
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createUsernameAttribute
public static UsernameAttribute createUsernameAttribute(byte username[]) { UsernameAttribute attribute = new UsernameAttribute(); attribute.setUsername(username); return attribute; }
java
public static UsernameAttribute createUsernameAttribute(byte username[]) { UsernameAttribute attribute = new UsernameAttribute(); attribute.setUsername(username); return attribute; }
[ "public", "static", "UsernameAttribute", "createUsernameAttribute", "(", "byte", "username", "[", "]", ")", "{", "UsernameAttribute", "attribute", "=", "new", "UsernameAttribute", "(", ")", ";", "attribute", ".", "setUsername", "(", "username", ")", ";", "return",...
Create a UsernameAttribute. @param username username value @return newly created UsernameAttribute
[ "Create", "a", "UsernameAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L336-L341
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createChannelNumberAttribute
public static ChannelNumberAttribute createChannelNumberAttribute( char channelNumber) { ChannelNumberAttribute attribute = new ChannelNumberAttribute(); attribute.setChannelNumber(channelNumber); return attribute; }
java
public static ChannelNumberAttribute createChannelNumberAttribute( char channelNumber) { ChannelNumberAttribute attribute = new ChannelNumberAttribute(); attribute.setChannelNumber(channelNumber); return attribute; }
[ "public", "static", "ChannelNumberAttribute", "createChannelNumberAttribute", "(", "char", "channelNumber", ")", "{", "ChannelNumberAttribute", "attribute", "=", "new", "ChannelNumberAttribute", "(", ")", ";", "attribute", ".", "setChannelNumber", "(", "channelNumber", ")...
Create a ChannelNumberAttribute. @param channelNumber channel number @return newly created ChannelNumberAttribute
[ "Create", "a", "ChannelNumberAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L401-L407
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createRealmAttribute
public static RealmAttribute createRealmAttribute(byte realm[]) { RealmAttribute attribute = new RealmAttribute(); attribute.setRealm(realm); return attribute; }
java
public static RealmAttribute createRealmAttribute(byte realm[]) { RealmAttribute attribute = new RealmAttribute(); attribute.setRealm(realm); return attribute; }
[ "public", "static", "RealmAttribute", "createRealmAttribute", "(", "byte", "realm", "[", "]", ")", "{", "RealmAttribute", "attribute", "=", "new", "RealmAttribute", "(", ")", ";", "attribute", ".", "setRealm", "(", "realm", ")", ";", "return", "attribute", ";"...
Create a RealmAttribute. @param realm realm value @return newly created RealmAttribute
[ "Create", "a", "RealmAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L416-L421
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createNonceAttribute
public static NonceAttribute createNonceAttribute(byte nonce[]) { NonceAttribute attribute = new NonceAttribute(); attribute.setNonce(nonce); return attribute; }
java
public static NonceAttribute createNonceAttribute(byte nonce[]) { NonceAttribute attribute = new NonceAttribute(); attribute.setNonce(nonce); return attribute; }
[ "public", "static", "NonceAttribute", "createNonceAttribute", "(", "byte", "nonce", "[", "]", ")", "{", "NonceAttribute", "attribute", "=", "new", "NonceAttribute", "(", ")", ";", "attribute", ".", "setNonce", "(", "nonce", ")", ";", "return", "attribute", ";"...
Create a NonceAttribute. @param nonce nonce value @return newly created NonceAttribute
[ "Create", "a", "NonceAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L430-L435
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createSoftwareAttribute
public static SoftwareAttribute createSoftwareAttribute(byte software[]) { SoftwareAttribute attribute = new SoftwareAttribute(); attribute.setSoftware(software); return attribute; }
java
public static SoftwareAttribute createSoftwareAttribute(byte software[]) { SoftwareAttribute attribute = new SoftwareAttribute(); attribute.setSoftware(software); return attribute; }
[ "public", "static", "SoftwareAttribute", "createSoftwareAttribute", "(", "byte", "software", "[", "]", ")", "{", "SoftwareAttribute", "attribute", "=", "new", "SoftwareAttribute", "(", ")", ";", "attribute", ".", "setSoftware", "(", "software", ")", ";", "return",...
Create a SoftwareAttribute. @param software software value @return newly created SoftwareAttribute
[ "Create", "a", "SoftwareAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L444-L449
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createEvenPortAttribute
public static EvenPortAttribute createEvenPortAttribute(boolean rFlag) { EvenPortAttribute attribute = new EvenPortAttribute(); attribute.setRFlag(rFlag); return attribute; }
java
public static EvenPortAttribute createEvenPortAttribute(boolean rFlag) { EvenPortAttribute attribute = new EvenPortAttribute(); attribute.setRFlag(rFlag); return attribute; }
[ "public", "static", "EvenPortAttribute", "createEvenPortAttribute", "(", "boolean", "rFlag", ")", "{", "EvenPortAttribute", "attribute", "=", "new", "EvenPortAttribute", "(", ")", ";", "attribute", ".", "setRFlag", "(", "rFlag", ")", ";", "return", "attribute", ";...
Create a EventAttribute. @param rFlag R flag @return the newly created EventPortAttribute
[ "Create", "a", "EventAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L458-L463
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createLifetimeAttribute
public static LifetimeAttribute createLifetimeAttribute(int lifetime) { LifetimeAttribute attribute = new LifetimeAttribute(); attribute.setLifetime(lifetime); return attribute; }
java
public static LifetimeAttribute createLifetimeAttribute(int lifetime) { LifetimeAttribute attribute = new LifetimeAttribute(); attribute.setLifetime(lifetime); return attribute; }
[ "public", "static", "LifetimeAttribute", "createLifetimeAttribute", "(", "int", "lifetime", ")", "{", "LifetimeAttribute", "attribute", "=", "new", "LifetimeAttribute", "(", ")", ";", "attribute", ".", "setLifetime", "(", "lifetime", ")", ";", "return", "attribute",...
Create a LifetimeAttribute. @param lifetime lifetime value @return newly created LifetimeAttribute
[ "Create", "a", "LifetimeAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L472-L477
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createRequestedTransportAttribute
public static RequestedTransportAttribute createRequestedTransportAttribute( byte protocol) { RequestedTransportAttribute attribute = new RequestedTransportAttribute(); attribute.setRequestedTransport(protocol); return attribute; }
java
public static RequestedTransportAttribute createRequestedTransportAttribute( byte protocol) { RequestedTransportAttribute attribute = new RequestedTransportAttribute(); attribute.setRequestedTransport(protocol); return attribute; }
[ "public", "static", "RequestedTransportAttribute", "createRequestedTransportAttribute", "(", "byte", "protocol", ")", "{", "RequestedTransportAttribute", "attribute", "=", "new", "RequestedTransportAttribute", "(", ")", ";", "attribute", ".", "setRequestedTransport", "(", "...
Create a RequestedTransportAttribute. @param protocol transport protocol requested @return newly created RequestedTransportAttribute
[ "Create", "a", "RequestedTransportAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L486-L492
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createReservationTokenAttribute
public static ReservationTokenAttribute createReservationTokenAttribute( byte token[]) { ReservationTokenAttribute attribute = new ReservationTokenAttribute(); attribute.setReservationToken(token); return attribute; }
java
public static ReservationTokenAttribute createReservationTokenAttribute( byte token[]) { ReservationTokenAttribute attribute = new ReservationTokenAttribute(); attribute.setReservationToken(token); return attribute; }
[ "public", "static", "ReservationTokenAttribute", "createReservationTokenAttribute", "(", "byte", "token", "[", "]", ")", "{", "ReservationTokenAttribute", "attribute", "=", "new", "ReservationTokenAttribute", "(", ")", ";", "attribute", ".", "setReservationToken", "(", ...
Create a ReservationTokenAttribute. @param token the token @return newly created RequestedTransportAttribute
[ "Create", "a", "ReservationTokenAttribute", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L501-L507
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createIceControlledAttribute
public static ControlledAttribute createIceControlledAttribute( long tieBreaker) { ControlledAttribute attribute = new ControlledAttribute(); attribute.setTieBreaker(tieBreaker); return attribute; }
java
public static ControlledAttribute createIceControlledAttribute( long tieBreaker) { ControlledAttribute attribute = new ControlledAttribute(); attribute.setTieBreaker(tieBreaker); return attribute; }
[ "public", "static", "ControlledAttribute", "createIceControlledAttribute", "(", "long", "tieBreaker", ")", "{", "ControlledAttribute", "attribute", "=", "new", "ControlledAttribute", "(", ")", ";", "attribute", ".", "setTieBreaker", "(", "tieBreaker", ")", ";", "retur...
Creates an Controlled Attribute object with the specified tie-breaker value @param tieBreaker the tie-breaker value to be used @return the created IceControlledAttribute
[ "Creates", "an", "Controlled", "Attribute", "object", "with", "the", "specified", "tie", "-", "breaker", "value" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L545-L551
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createPriorityAttribute
public static PriorityAttribute createPriorityAttribute(long priority) throws IllegalArgumentException { PriorityAttribute attribute = new PriorityAttribute(); attribute.setPriority(priority); return attribute; }
java
public static PriorityAttribute createPriorityAttribute(long priority) throws IllegalArgumentException { PriorityAttribute attribute = new PriorityAttribute(); attribute.setPriority(priority); return attribute; }
[ "public", "static", "PriorityAttribute", "createPriorityAttribute", "(", "long", "priority", ")", "throws", "IllegalArgumentException", "{", "PriorityAttribute", "attribute", "=", "new", "PriorityAttribute", "(", ")", ";", "attribute", ".", "setPriority", "(", "priority...
Creates a Priority attribute with the specified priority value @param priority the priority value @return the created PriorityAttribute @throws IllegalArgumentException if priority < 0 or priority > (2^31 - 1)
[ "Creates", "a", "Priority", "attribute", "with", "the", "specified", "priority", "value" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L562-L569
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createIceControllingAttribute
public static ControllingAttribute createIceControllingAttribute( long tieBreaker) { ControllingAttribute attribute = new ControllingAttribute(); attribute.setTieBreaker(tieBreaker); return attribute; }
java
public static ControllingAttribute createIceControllingAttribute( long tieBreaker) { ControllingAttribute attribute = new ControllingAttribute(); attribute.setTieBreaker(tieBreaker); return attribute; }
[ "public", "static", "ControllingAttribute", "createIceControllingAttribute", "(", "long", "tieBreaker", ")", "{", "ControllingAttribute", "attribute", "=", "new", "ControllingAttribute", "(", ")", ";", "attribute", ".", "setTieBreaker", "(", "tieBreaker", ")", ";", "r...
Creates an Controlling Attribute with the specified tie-breaker value @param tieBreaker the tie-breaker value to be used @return the created IceControllingAttribute
[ "Creates", "an", "Controlling", "Attribute", "with", "the", "specified", "tie", "-", "breaker", "value" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L590-L596
train
RestComm/media-core
stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java
StunAttributeFactory.createDestinationAddressAttribute
public static DestinationAddressAttribute createDestinationAddressAttribute( TransportAddress address) { DestinationAddressAttribute attribute = new DestinationAddressAttribute(); attribute.setAddress(address); return attribute; }
java
public static DestinationAddressAttribute createDestinationAddressAttribute( TransportAddress address) { DestinationAddressAttribute attribute = new DestinationAddressAttribute(); attribute.setAddress(address); return attribute; }
[ "public", "static", "DestinationAddressAttribute", "createDestinationAddressAttribute", "(", "TransportAddress", "address", ")", "{", "DestinationAddressAttribute", "attribute", "=", "new", "DestinationAddressAttribute", "(", ")", ";", "attribute", ".", "setAddress", "(", "...
Creates a DestinationFromAddressAttribute of the specified type and with the specified address and port @param address the address value of the address attribute @return the newly created address attribute.
[ "Creates", "a", "DestinationFromAddressAttribute", "of", "the", "specified", "type", "and", "with", "the", "specified", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L616-L623
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpChannel.java
RtcpChannel.bind
public void bind(boolean isLocal, int port) throws IOException { try { // Open this channel with UDP Manager on first available address this.selectionKey = udpManager.open(this); this.dataChannel = (DatagramChannel) this.selectionKey.channel(); } catch (IOException e) { throw new SocketException(e.getMe...
java
public void bind(boolean isLocal, int port) throws IOException { try { // Open this channel with UDP Manager on first available address this.selectionKey = udpManager.open(this); this.dataChannel = (DatagramChannel) this.selectionKey.channel(); } catch (IOException e) { throw new SocketException(e.getMe...
[ "public", "void", "bind", "(", "boolean", "isLocal", ",", "int", "port", ")", "throws", "IOException", "{", "try", "{", "// Open this channel with UDP Manager on first available address", "this", ".", "selectionKey", "=", "udpManager", ".", "open", "(", "this", ")",...
Binds the channel to an address and port @param isLocal whether the connection is local or not @param port The RTCP port. Usually the RTP channel gets the even port and RTCP channel get the next port. @throws IOException When the channel cannot be openend or bound
[ "Binds", "the", "channel", "to", "an", "address", "and", "port" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpChannel.java#L173-L188
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SessionDescription.java
SessionDescription.parse
public void parse(byte[] data) throws ParseException { Text text = new Text(); text.strain(data, 0, data.length); init(text); }
java
public void parse(byte[] data) throws ParseException { Text text = new Text(); text.strain(data, 0, data.length); init(text); }
[ "public", "void", "parse", "(", "byte", "[", "]", "data", ")", "throws", "ParseException", "{", "Text", "text", "=", "new", "Text", "(", ")", ";", "text", ".", "strain", "(", "data", ",", "0", ",", "data", ".", "length", ")", ";", "init", "(", "t...
Reads descriptor from binary data @param data the binary data @throws ParseException
[ "Reads", "descriptor", "from", "binary", "data" ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SessionDescription.java#L84-L88
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java
MgcpCall.getConnections
public Set<Integer> getConnections(String endpointId) { return Collections.unmodifiableSet(this.entries.get(endpointId)); }
java
public Set<Integer> getConnections(String endpointId) { return Collections.unmodifiableSet(this.entries.get(endpointId)); }
[ "public", "Set", "<", "Integer", ">", "getConnections", "(", "String", "endpointId", ")", "{", "return", "Collections", ".", "unmodifiableSet", "(", "this", ".", "entries", ".", "get", "(", "endpointId", ")", ")", ";", "}" ]
Gets the list of currently registered connections in the Call. @return An <b>unmodifiable</b> set of connection identifiers. If no connections are registered, an empty set is returned.
[ "Gets", "the", "list", "of", "currently", "registered", "connections", "in", "the", "Call", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java#L95-L97
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java
MgcpCall.addConnection
public boolean addConnection(String endpointId, int connectionId) { boolean added = this.entries.put(endpointId, connectionId); if (added && log.isDebugEnabled()) { int left = this.entries.get(endpointId).size(); log.debug("Call " + getCallIdHex() + " registered connection " + In...
java
public boolean addConnection(String endpointId, int connectionId) { boolean added = this.entries.put(endpointId, connectionId); if (added && log.isDebugEnabled()) { int left = this.entries.get(endpointId).size(); log.debug("Call " + getCallIdHex() + " registered connection " + In...
[ "public", "boolean", "addConnection", "(", "String", "endpointId", ",", "int", "connectionId", ")", "{", "boolean", "added", "=", "this", ".", "entries", ".", "put", "(", "endpointId", ",", "connectionId", ")", ";", "if", "(", "added", "&&", "log", ".", ...
Registers a connection in the call. @param endpointId The identifier of the endpoint that owns the connection. @param connectionId The connection identifier. @return Returns <code>true</code> if connection was successfully registered. Returns <code>false</code> otherwise.
[ "Registers", "a", "connection", "in", "the", "call", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java#L106-L113
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java
MgcpCall.removeConnection
public boolean removeConnection(String endpointId, int connectionId) { boolean removed = this.entries.remove(endpointId, connectionId); if (removed && log.isDebugEnabled()) { int left = this.entries.get(endpointId).size(); log.debug("Call " + getCallIdHex() + " unregistered conne...
java
public boolean removeConnection(String endpointId, int connectionId) { boolean removed = this.entries.remove(endpointId, connectionId); if (removed && log.isDebugEnabled()) { int left = this.entries.get(endpointId).size(); log.debug("Call " + getCallIdHex() + " unregistered conne...
[ "public", "boolean", "removeConnection", "(", "String", "endpointId", ",", "int", "connectionId", ")", "{", "boolean", "removed", "=", "this", ".", "entries", ".", "remove", "(", "endpointId", ",", "connectionId", ")", ";", "if", "(", "removed", "&&", "log",...
Unregisters a connection from the call. @param endpointId The identifier of the endpoint that owns the connection. @param connectionId The connection identifier. @return Returns <code>true</code> if connection was removed successfully. Returns <code>false</code> otherwise.
[ "Unregisters", "a", "connection", "from", "the", "call", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java#L122-L129
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java
MgcpCall.removeConnections
public Set<Integer> removeConnections(String endpointId) { Set<Integer> removed = this.entries.removeAll(endpointId); if (!removed.isEmpty() && log.isDebugEnabled()) { log.debug("Call " + getCallIdHex() + " unregistered connections " + Arrays.toString(convertToHex(removed)) + " from endpoint...
java
public Set<Integer> removeConnections(String endpointId) { Set<Integer> removed = this.entries.removeAll(endpointId); if (!removed.isEmpty() && log.isDebugEnabled()) { log.debug("Call " + getCallIdHex() + " unregistered connections " + Arrays.toString(convertToHex(removed)) + " from endpoint...
[ "public", "Set", "<", "Integer", ">", "removeConnections", "(", "String", "endpointId", ")", "{", "Set", "<", "Integer", ">", "removed", "=", "this", ".", "entries", ".", "removeAll", "(", "endpointId", ")", ";", "if", "(", "!", "removed", ".", "isEmpty"...
Unregisters all connections that belong to an endpoint. @param endpointId The identifier of the endpoint that owns the connections. @return A set containing all unregistered connection identifiers. Returns an empty set if no connections exist.
[ "Unregisters", "all", "connections", "that", "belong", "to", "an", "endpoint", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java#L137-L143
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java
CreateConnectionCommand.createRemoteConnection
private MgcpConnection createRemoteConnection(int callId, ConnectionMode mode, MgcpEndpoint endpoint, CrcxContext context) throws MgcpConnectionException { // Create connection MgcpConnection connection = endpoint.createConnection(callId, false); // TODO set call agent String localDescri...
java
private MgcpConnection createRemoteConnection(int callId, ConnectionMode mode, MgcpEndpoint endpoint, CrcxContext context) throws MgcpConnectionException { // Create connection MgcpConnection connection = endpoint.createConnection(callId, false); // TODO set call agent String localDescri...
[ "private", "MgcpConnection", "createRemoteConnection", "(", "int", "callId", ",", "ConnectionMode", "mode", ",", "MgcpEndpoint", "endpoint", ",", "CrcxContext", "context", ")", "throws", "MgcpConnectionException", "{", "// Create connection", "MgcpConnection", "connection",...
Creates a new Remote Connection. <p> The connection will be half-open and a Local Connection Description is generated. </p> @param callId The call identifies which indicates to which session the connection belongs to. @param mode The connection mode. @param endpoint The endpoint where the connection will be registere...
[ "Creates", "a", "new", "Remote", "Connection", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java#L167-L175
train
RestComm/media-core
control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java
CreateConnectionCommand.createLocalConnection
private MgcpConnection createLocalConnection(int callId, MgcpEndpoint endpoint) throws MgcpConnectionException { MgcpConnection connection = endpoint.createConnection(callId, true); connection.open(null); return connection; }
java
private MgcpConnection createLocalConnection(int callId, MgcpEndpoint endpoint) throws MgcpConnectionException { MgcpConnection connection = endpoint.createConnection(callId, true); connection.open(null); return connection; }
[ "private", "MgcpConnection", "createLocalConnection", "(", "int", "callId", ",", "MgcpEndpoint", "endpoint", ")", "throws", "MgcpConnectionException", "{", "MgcpConnection", "connection", "=", "endpoint", ".", "createConnection", "(", "callId", ",", "true", ")", ";", ...
Creates a new Local Connection. <p> The connection will be fully open and connected to a secondary endpoint.<br> </p> @param callId The the call identifies which indicates to which session the connection belongs to. @param secondEndpoint The endpoint where the connection will be registered to. @return The new connec...
[ "Creates", "a", "new", "Local", "Connection", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java#L216-L220
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java
SdpComparator.negotiateAudio
public RTPFormats negotiateAudio(SessionDescription sdp, RTPFormats formats) { this.audio.clean(); MediaDescriptorField descriptor = sdp.getAudioDescriptor(); descriptor.getFormats().intersection(formats, this.audio); return this.audio; }
java
public RTPFormats negotiateAudio(SessionDescription sdp, RTPFormats formats) { this.audio.clean(); MediaDescriptorField descriptor = sdp.getAudioDescriptor(); descriptor.getFormats().intersection(formats, this.audio); return this.audio; }
[ "public", "RTPFormats", "negotiateAudio", "(", "SessionDescription", "sdp", ",", "RTPFormats", "formats", ")", "{", "this", ".", "audio", ".", "clean", "(", ")", ";", "MediaDescriptorField", "descriptor", "=", "sdp", ".", "getAudioDescriptor", "(", ")", ";", "...
Negotiates the audio formats to be used in the call. @param sdp The session description @param formats The available formats @return The supported formats. If no formats are supported the returned list will be empty.
[ "Negotiates", "the", "audio", "formats", "to", "be", "used", "in", "the", "call", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java#L70-L75
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java
SdpComparator.negotiateVideo
public RTPFormats negotiateVideo(SessionDescription sdp, RTPFormats formats) { this.video.clean(); MediaDescriptorField descriptor = sdp.getVideoDescriptor(); descriptor.getFormats().intersection(formats, this.video); return this.video; }
java
public RTPFormats negotiateVideo(SessionDescription sdp, RTPFormats formats) { this.video.clean(); MediaDescriptorField descriptor = sdp.getVideoDescriptor(); descriptor.getFormats().intersection(formats, this.video); return this.video; }
[ "public", "RTPFormats", "negotiateVideo", "(", "SessionDescription", "sdp", ",", "RTPFormats", "formats", ")", "{", "this", ".", "video", ".", "clean", "(", ")", ";", "MediaDescriptorField", "descriptor", "=", "sdp", ".", "getVideoDescriptor", "(", ")", ";", "...
Negotiates the video formats to be used in the call. @param sdp The session description @param formats The available formats @return The supported formats. If no formats are supported the returned list will be empty.
[ "Negotiates", "the", "video", "formats", "to", "be", "used", "in", "the", "call", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java#L83-L88
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java
SdpComparator.negotiateApplication
public RTPFormats negotiateApplication(SessionDescription sdp, RTPFormats formats) { this.application.clean(); MediaDescriptorField descriptor = sdp.getApplicationDescriptor(); descriptor.getFormats().intersection(formats, this.application); return this.application; }
java
public RTPFormats negotiateApplication(SessionDescription sdp, RTPFormats formats) { this.application.clean(); MediaDescriptorField descriptor = sdp.getApplicationDescriptor(); descriptor.getFormats().intersection(formats, this.application); return this.application; }
[ "public", "RTPFormats", "negotiateApplication", "(", "SessionDescription", "sdp", ",", "RTPFormats", "formats", ")", "{", "this", ".", "application", ".", "clean", "(", ")", ";", "MediaDescriptorField", "descriptor", "=", "sdp", ".", "getApplicationDescriptor", "(",...
Negotiates the application formats to be used in the call. @param sdp The session description @param formats The available formats @return The supported formats. If no formats are supported the returned list will be empty.
[ "Negotiates", "the", "application", "formats", "to", "be", "used", "in", "the", "call", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java#L96-L101
train
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java
RtcpPacketFactory.buildSenderReport
private static RtcpSenderReport buildSenderReport(RtpStatistics statistics, boolean padding) { /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
java
private static RtcpSenderReport buildSenderReport(RtpStatistics statistics, boolean padding) { /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "private", "static", "RtcpSenderReport", "buildSenderReport", "(", "RtpStatistics", "statistics", ",", "boolean", "padding", ")", "{", "/*\n\t\t * 0 1 2 3\n * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7...
Builds a packet containing an RTCP Sender Report. @param statistics The statistics of the RTP session @return The RTCP packet
[ "Builds", "a", "packet", "containing", "an", "RTCP", "Sender", "Report", "." ]
07b8703343708599f60af66bae62aded77ee81b5
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java#L49-L109
train