Ignore:
Timestamp:
Jun 12, 2009 5:37:13 PM (15 years ago)
Author:
nanang
Message:

Ticket #883: Added user defined NAT hole-punching and keep-alive mechanism to media stream.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/config.h

    r2506 r2759  
    697697 
    698698 
     699/** 
     700 * Value to be specified in PJMEDIA_STREAM_ENABLE_KA setting. 
     701 * This indicates that an empty RTP packet should be used as 
     702 * the keep-alive packet. 
     703 */ 
     704#define PJMEDIA_STREAM_KA_EMPTY_RTP                 1 
     705 
     706/** 
     707 * Value to be specified in PJMEDIA_STREAM_ENABLE_KA setting. 
     708 * This indicates that a user defined packet should be used 
     709 * as the keep-alive packet. The content of the user-defined 
     710 * packet is specified by PJMEDIA_STREAM_KA_USER_PKT. Default 
     711 * content is a CR-LF packet. 
     712 */ 
     713#define PJMEDIA_STREAM_KA_USER                      2 
     714 
     715/** 
     716 * The content of the user defined keep-alive packet. The format 
     717 * of the packet is initializer to pj_str_t structure. Note that 
     718 * the content may contain NULL character. 
     719 */ 
     720#ifndef PJMEDIA_STREAM_KA_USER_PKT 
     721#   define PJMEDIA_STREAM_KA_USER_PKT   { "\r\n", 2 } 
     722#endif 
     723 
     724/** 
     725 * Specify another type of keep-alive and NAT hole punching  
     726 * mechanism (the other type is PJMEDIA_STREAM_VAD_SUSPEND_MSEC 
     727 * and PJMEDIA_CODEC_MAX_SILENCE_PERIOD) to be used by stream.  
     728 * When this feature is enabled, the stream will initially  
     729 * transmit one packet to punch a hole in NAT, and periodically 
     730 * transmit keep-alive packets. 
     731 * 
     732 * When this alternative keep-alive mechanism is used, application 
     733 * may disable the other keep-alive mechanisms, i.e: by setting  
     734 * PJMEDIA_STREAM_VAD_SUSPEND_MSEC to zero and  
     735 * PJMEDIA_CODEC_MAX_SILENCE_PERIOD to -1. 
     736 * 
     737 * The value of this macro specifies the type of packet used 
     738 * for the keep-alive mechanism. Valid values are 
     739 * PJMEDIA_STREAM_KA_EMPTY_RTP and PJMEDIA_STREAM_KA_USER. 
     740 *  
     741 * The duration of the keep-alive interval further can be set 
     742 * with PJMEDIA_STREAM_KA_INTERVAL setting. 
     743 * 
     744 * Default: 0 (disabled) 
     745 */ 
     746#ifndef PJMEDIA_STREAM_ENABLE_KA 
     747#   define PJMEDIA_STREAM_ENABLE_KA                 0 
     748#endif 
     749 
     750 
     751/** 
     752 * Specify the keep-alive interval of PJMEDIA_STREAM_ENABLE_KA 
     753 * mechanism, in seconds. 
     754 * 
     755 * Default: 5 seconds 
     756 */ 
     757#ifndef PJMEDIA_STREAM_KA_INTERVAL 
     758#       define PJMEDIA_STREAM_KA_INTERVAL           5 
     759#endif 
     760 
    699761 
    700762/** 
Note: See TracChangeset for help on using the changeset viewer.