Ignore:
Timestamp:
Oct 24, 2011 9:28:13 AM (13 years ago)
Author:
ming
Message:

Re #1395: Backport of PJSIP 1.x branch into PJSIP 2.0 trunk

TODO: ticket #1268 (Option for automatic/manual sending of RTCP SDES/BYE for the stream) for video stream.

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk

  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r3796 r3841  
    540540 
    541541/** 
     542 * This enumeration specifies the options for custom media transport creation. 
     543 */ 
     544typedef enum pjsua_create_media_transport_flag 
     545{ 
     546   /** 
     547    * This flag indicates that the media transport must also close its 
     548    * "member" or "child" transport when pjmedia_transport_close() is 
     549    * called. If this flag is not specified, then the media transport 
     550    * must not call pjmedia_transport_close() of its member transport. 
     551    */ 
     552   PJSUA_MED_TP_CLOSE_MEMBER = 1 
     553 
     554} pjsua_create_media_transport_flag; 
     555 
     556 
     557/** 
    542558 * This structure describes application callback to receive various event 
    543559 * notification from PJSUA-API. All of these callbacks are OPTIONAL, 
     
    706722 
    707723 
     724    /** 
     725     * Notify application when registration or unregistration has been 
     726     * initiated. Note that this only notifies the initial registration 
     727     * and unregistration. Once registration session is active, subsequent 
     728     * refresh will not cause this callback to be called. 
     729     * 
     730     * @param acc_id        The account ID. 
     731     * @param renew         Non-zero for registration and zero for 
     732     *                      unregistration. 
     733     */ 
     734    void (*on_reg_started)(pjsua_acc_id acc_id, pj_bool_t renew); 
     735     
    708736    /** 
    709737     * Notify application when registration status has changed. 
     
    10751103                                pjmedia_event *event); 
    10761104 
     1105    /** 
     1106     * This callback can be used by application to implement custom media 
     1107     * transport adapter for the call, or to replace the media transport 
     1108     * with something completely new altogether. 
     1109     * 
     1110     * This callback is called when a new call is created. The library has 
     1111     * created a media transport for the call, and it is provided as the 
     1112     * \a base_tp argument of this callback. Upon returning, the callback 
     1113     * must return an instance of media transport to be used by the call. 
     1114     * 
     1115     * @param call_id       Call ID 
     1116     * @param media_idx     The media index in the SDP for which this media 
     1117     *                      transport will be used. 
     1118     * @param base_tp       The media transport which otherwise will be 
     1119     *                      used by the call has this callback not been 
     1120     *                      implemented. 
     1121     * @param flags         Bitmask from pjsua_create_media_transport_flag. 
     1122     * 
     1123     * @return              The callback must return an instance of media 
     1124     *                      transport to be used by the call. 
     1125     */ 
     1126    pjmedia_transport* (*on_create_media_transport)(pjsua_call_id call_id, 
     1127                                                    unsigned media_idx, 
     1128                                                    pjmedia_transport *base_tp, 
     1129                                                    unsigned flags); 
     1130 
    10771131} pjsua_callback; 
    10781132 
     
    11081162 
    11091163} pjsua_sip_timer_use; 
     1164 
     1165 
     1166/** 
     1167 * This constants controls the use of 100rel extension. 
     1168 */ 
     1169typedef enum pjsua_100rel_use 
     1170{ 
     1171    /** 
     1172     * Not used. For UAC, support for 100rel will be indicated in Supported 
     1173     * header so that peer can opt to use it if it wants to. As UAS, this 
     1174     * option will NOT cause 100rel to be used even if UAC indicates that 
     1175     * it supports this feature. 
     1176     */ 
     1177    PJSUA_100REL_NOT_USED, 
     1178 
     1179    /** 
     1180     * Mandatory. UAC will place 100rel in Require header, and UAS will 
     1181     * reject incoming calls unless it has 100rel in Supported header. 
     1182     */ 
     1183    PJSUA_100REL_MANDATORY, 
     1184 
     1185    /** 
     1186     * Optional. Similar to PJSUA_100REL_NOT_USED, except that as UAS, this 
     1187     * option will cause 100rel to be used if UAC indicates that it supports it. 
     1188     */ 
     1189    PJSUA_100REL_OPTIONAL 
     1190 
     1191} pjsua_100rel_use; 
    11101192 
    11111193 
     
    12461328 
    12471329    /** 
    1248      * Specify whether support for reliable provisional response (100rel and 
    1249      * PRACK) should be required by default. Note that this setting can be 
     1330     * Specify how the support for reliable provisional response (100rel/ 
     1331     * PRACK) should be used by default. Note that this setting can be 
    12501332     * further customized in account configuration (#pjsua_acc_config). 
    12511333     * 
    1252      * Default: PJ_FALSE 
    1253      */ 
    1254     pj_bool_t      require_100rel; 
     1334     * Default: PJSUA_100REL_NOT_USED 
     1335     */ 
     1336    pjsua_100rel_use require_100rel; 
    12551337 
    12561338    /** 
     
    13671449 
    13681450/** 
     1451 * Flags to be given to pjsua_destroy2() 
     1452 */ 
     1453typedef enum pjsua_destroy_flag 
     1454{ 
     1455    /** 
     1456     * Allow sending outgoing messages (such as unregistration, event 
     1457     * unpublication, BYEs, unsubscription, etc.), but do not wait for 
     1458     * responses. This is useful to perform "best effort" clean up 
     1459     * without delaying the shutdown process waiting for responses. 
     1460     */ 
     1461    PJSUA_DESTROY_NO_RX_MSG = 1, 
     1462 
     1463    /** 
     1464     * If this flag is set, do not send any outgoing messages at all. 
     1465     * This flag is useful if application knows that the network which 
     1466     * the messages are to be sent on is currently down. 
     1467     */ 
     1468    PJSUA_DESTROY_NO_TX_MSG = 2, 
     1469 
     1470    /** 
     1471     * Do not send or receive messages during destroy. This flag is 
     1472     * shorthand for  PJSUA_DESTROY_NO_RX_MSG + PJSUA_DESTROY_NO_TX_MSG. 
     1473     */ 
     1474    PJSUA_DESTROY_NO_NETWORK = PJSUA_DESTROY_NO_RX_MSG | 
     1475                               PJSUA_DESTROY_NO_TX_MSG 
     1476 
     1477} pjsua_destroy_flag; 
     1478 
     1479/** 
    13691480 * Use this function to initialize pjsua config. 
    13701481 * 
     
    15141625 * keep track of it's state. 
    15151626 * 
     1627 * @see pjsua_destroy2() 
     1628 * 
    15161629 * @return              PJ_SUCCESS on success, or the appropriate error code. 
    15171630 */ 
     
    15251638 */ 
    15261639PJ_DECL(pjsua_state) pjsua_get_state(void); 
     1640 
     1641 
     1642/** 
     1643 * Variant of destroy with additional flags. 
     1644 * 
     1645 * @param flags         Combination of pjsua_destroy_flag enumeration. 
     1646 * 
     1647 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1648 */ 
     1649PJ_DECL(pj_status_t) pjsua_destroy2(unsigned flags); 
    15271650 
    15281651 
     
    23962519 
    23972520    /** 
    2398      * Specify whether support for reliable provisional response (100rel and 
    2399      * PRACK) should be required for all sessions of this account. 
    2400      * 
    2401      * Default: PJ_FALSE 
    2402      */ 
    2403     pj_bool_t       require_100rel; 
     2521     * Specify how support for reliable provisional response (100rel/ 
     2522     * PRACK) should be used for all sessions in this account. See the 
     2523     * documentation of pjsua_100rel_use enumeration for more info. 
     2524     * 
     2525     * Default: The default value is taken from the value of 
     2526     *          require_100rel in pjsua_config. 
     2527     */ 
     2528    pjsua_100rel_use require_100rel; 
    24042529 
    24052530    /** 
     
    26772802     * Specify interval of auto registration retry upon registration failure 
    26782803     * (including caused by transport problem), in second. Set to 0 to 
    2679      * disable auto re-registration. 
     2804     * disable auto re-registration. Note that if the registration retry 
     2805     * occurs because of transport failure, the first retry will be done 
     2806     * after \a reg_first_retry_interval seconds instead. Also note that 
     2807     * the interval will be randomized slightly by approximately +/- ten 
     2808     * seconds to avoid all clients re-registering at the same time. 
     2809     * 
     2810     * See also \a reg_first_retry_interval setting. 
    26802811     * 
    26812812     * Default: #PJSUA_REG_RETRY_INTERVAL 
    26822813     */ 
    26832814    unsigned         reg_retry_interval; 
     2815 
     2816    /** 
     2817     * This specifies the interval for the first registration retry. The 
     2818     * registration retry is explained in \a reg_retry_interval. Note that 
     2819     * the value here will also be randomized by +/- ten seconds. 
     2820     * 
     2821     * Default: 0 
     2822     */ 
     2823    unsigned         reg_first_retry_interval; 
    26842824 
    26852825    /** 
     
    27222862     */ 
    27232863    pjsua_call_hold_type call_hold_type; 
     2864     
     2865     
     2866    /** 
     2867     * Specify whether the account should register as soon as it is 
     2868     * added to the UA. Application can set this to PJ_FALSE and control 
     2869     * the registration manually with pjsua_acc_set_registration(). 
     2870     * 
     2871     * Default: PJ_TRUE 
     2872     */ 
     2873    pj_bool_t         register_on_acc_add; 
    27242874 
    27252875} pjsua_acc_config; 
Note: See TracChangeset for help on using the changeset viewer.