Changeset 515


Ignore:
Timestamp:
Jun 17, 2006 4:08:30 AM (18 years ago)
Author:
bennylp
Message:

Modifications all over the place, but mainly only to update Doxygen documentation

Location:
pjproject/trunk
Files:
4 added
1 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/build/pjlib.dsp

    r458 r515  
    183183# Begin Source File 
    184184 
    185 SOURCE=..\src\pj\equeue_winnt.c 
    186 # End Source File 
    187 # Begin Source File 
    188  
    189185SOURCE=..\src\pj\errno.c 
    190186# End Source File 
     
    234230 
    235231SOURCE=..\src\pj\ioqueue_select.c 
    236  
    237 !IF  "$(CFG)" == "pjlib - Win32 Release" 
    238  
    239 !ELSEIF  "$(CFG)" == "pjlib - Win32 Debug" 
    240  
    241 !ENDIF  
    242  
    243232# End Source File 
    244233# Begin Source File 
  • pjproject/trunk/pjsip/build/pjsip_core.dsp

    r458 r515  
    320320# Begin Source File 
    321321 
     322SOURCE=..\docs\doxygen.h 
     323# End Source File 
     324# Begin Source File 
     325 
    322326SOURCE=..\include\pjsip.h 
    323327# End Source File 
  • pjproject/trunk/pjsip/docs/doxygen.cfg

    r1 r515  
    135135 
    136136#STRIP_FROM_PATH        = "/cygdrive/e/project/bulukucing.org/pjsip/src" 
    137 STRIP_FROM_PATH        = "/c/project/bulukucing.org/pjsip/src" 
     137STRIP_FROM_PATH        = "/c/project/pjproject/pjsip" 
    138138 
    139139# The INTERNAL_DOCS tag determines if documentation  
     
    347347# with spaces. 
    348348 
    349 INPUT                  =  src/pjsip src/pjsip_mod_ua src/pjsip_simple src 
     349INPUT                  =  docs include  
    350350 
    351351# If the value of the INPUT tag contains directories, you can use the  
     
    475475# should be ignored while generating the index headers. 
    476476 
    477 IGNORE_PREFIX          =  
     477IGNORE_PREFIX          =  /c/project/pjproject/pjsip 
    478478 
    479479#--------------------------------------------------------------------------- 
     
    496496# doxygen will generate files with .html extension. 
    497497 
    498 HTML_FILE_EXTENSION    = .html 
     498HTML_FILE_EXTENSION    = .htm 
    499499 
    500500# The HTML_HEADER tag can be used to specify a personal HTML header for  
     
    502502# standard header. 
    503503 
    504 HTML_HEADER            =  
     504HTML_HEADER            =  docs/header.html 
    505505 
    506506# The HTML_FOOTER tag can be used to specify a personal HTML footer for  
     
    508508# standard footer. 
    509509 
    510 HTML_FOOTER            =  
     510HTML_FOOTER            =  docs/footer.html 
    511511 
    512512# The HTML_STYLESHEET tag can be used to specify a user defined cascading  
     
    845845 
    846846PREDEFINED             = PJ_DECL(x)=x PJ_DEF(x)=x PJ_IDECL(x)=x \ 
    847  
    848847                         PJ_IDEF(x)=x PJ_INLINE(x)=x 
    849848 
     
    10111010SEARCHENGINE           = NO 
    10121011 
    1013 # The CGI_NAME tag should be the name of the CGI script that  
    1014 # starts the search engine (doxysearch) with the correct parameters.  
    1015 # A script with this name will be generated by doxygen. 
    1016  
    1017 CGI_NAME               = search.cgi 
    1018  
    1019 # The CGI_URL tag should be the absolute URL to the directory where the  
    1020 # cgi binaries are located. See the documentation of your http daemon for  
    1021 # details. 
    1022  
    1023 CGI_URL                =  
    1024  
    1025 # The DOC_URL tag should be the absolute URL to the directory where the  
    1026 # documentation is located. If left blank the absolute path to the  
    1027 # documentation, with file:// prepended to it, will be used. 
    1028  
    1029 DOC_URL                =  
    1030  
    1031 # The DOC_ABSPATH tag should be the absolute path to the directory where the  
    1032 # documentation is located. If left blank the directory on the local machine  
    1033 # will be used. 
    1034  
    1035 DOC_ABSPATH            =  
    1036  
    1037 # The BIN_ABSPATH tag must point to the directory where the doxysearch binary  
    1038 # is installed. 
    1039  
    1040 BIN_ABSPATH            = /usr/local/bin/ 
    1041  
    1042 # The EXT_DOC_PATHS tag can be used to specify one or more paths to  
    1043 # documentation generated for other projects. This allows doxysearch to search  
    1044 # the documentation for these projects as well. 
    1045  
    1046 EXT_DOC_PATHS          =  
  • pjproject/trunk/pjsip/include/pjsip-simple/evsub.h

    r283 r515  
    3131 * @defgroup PJSIP_EVENT_NOT SIP Event Notification (RFC 3265) Module 
    3232 * @ingroup PJSIP_SIMPLE 
     33 * @brief Core Event Subscription framework, used by presence, call transfer, etc. 
    3334 * @{ 
    3435 * 
     
    431432 * 
    432433 * @param sub           The event subscription. 
    433  * @param index         The module id. 
     434 * @param mod_id        The module id. 
    434435 * @param data          Arbitrary data. 
    435436 */ 
  • pjproject/trunk/pjsip/include/pjsip-simple/evsub_msg.h

    r197 r515  
    2727 
    2828/** 
     29 * @defgroup PJSIP_EVENT_HDRS Additional Header Fields 
    2930 * @ingroup PJSIP_EVENT_NOT 
    3031 * @{ 
     
    4243typedef struct pjsip_event_hdr 
    4344{ 
     45    /** Standard header fields. */ 
    4446    PJSIP_DECL_HDR_MEMBER(struct pjsip_event_hdr); 
     47 
    4548    pj_str_t        event_type;     /**< Event name. */ 
    4649    pj_str_t        id_param;       /**< Optional event ID parameter. */ 
     
    6770 * Create a new Allow-Events header. 
    6871 * 
    69  * @param pool.     The pool. 
     72 * @param pool      The pool. 
    7073 * 
    7174 * @return          Allow-Events header. 
    7275 */ 
    73 PJ_DECL(pjsip_allow_events_hdr*) pjsip_allow_events_hdr_create(pj_pool_t *pool); 
     76PJ_DECL(pjsip_allow_events_hdr*)  
     77pjsip_allow_events_hdr_create(pj_pool_t *pool); 
    7478 
    7579 
     
    7983typedef struct pjsip_sub_state_hdr 
    8084{ 
     85    /** Standard header fields. */ 
    8186    PJSIP_DECL_HDR_MEMBER(struct pjsip_sub_state_hdr); 
     87 
    8288    pj_str_t        sub_state;          /**< Subscription state. */ 
    8389    pj_str_t        reason_param;       /**< Optional termination reason. */ 
  • pjproject/trunk/pjsip/include/pjsip-simple/iscomposing.h

    r268 r515  
    2727#include <pjlib-util/xml.h> 
    2828 
     29/** 
     30 * @defgroup PJSIP_ISCOMPOSING Message Composition Indication (RFC 3994) 
     31 * @ingroup PJSIP_SIMPLE 
     32 * @brief Support for Indication of Message Composition (RFC 3994) 
     33 * @{ 
     34 * 
     35 * This implements message composition indication, as described in 
     36 * RFC 3994. 
     37 */ 
    2938 
    3039PJ_BEGIN_DECL 
     
    114123 
    115124 
     125/** 
     126 * @} 
     127 */ 
     128 
    116129 
    117130PJ_END_DECL 
  • pjproject/trunk/pjsip/include/pjsip-simple/pidf.h

    r197 r515  
    3333 * @defgroup PJSIP_SIMPLE_PIDF PIDF/Presence Information Data Format (RFC 3863) 
    3434 * @ingroup PJSIP_SIMPLE 
     35 * @brief Support for PIDF/Presence Information Data Format (RFC 3863) 
    3536 * @{ 
    3637 * 
  • pjproject/trunk/pjsip/include/pjsip-simple/presence.h

    r283 r515  
    3535 * @defgroup PJSIP_SIMPLE_PRES SIP Extension for Presence (RFC 3856) 
    3636 * @ingroup PJSIP_SIMPLE 
     37 * @brief Support for SIP Extension for Presence (RFC 3856) 
    3738 * @{ 
    3839 * 
     
    6869 
    6970 
     71/** 
     72 * Maximum presence status info. 
     73 */ 
    7074#define PJSIP_PRES_STATUS_MAX_INFO  8 
    7175 
  • pjproject/trunk/pjsip/include/pjsip-simple/xpidf.h

    r197 r515  
    3232 * @defgroup PJSIP_SIMPLE_XPIDF XPIDF/Presence Information Data Format 
    3333 * @ingroup PJSIP_SIMPLE 
     34 * @brief Support for XPIDF/Presence Information Data Format 
    3435 * @{ 
    3536 * 
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h

    r500 r515  
    2020#define __SIP_INVITE_SESSION_H__ 
    2121 
     22/** 
     23 * @file sip_inv.h 
     24 * @brief INVITE sessions 
     25 */ 
     26 
     27 
    2228#include <pjsip/sip_dialog.h> 
    2329#include <pjmedia/sdp_neg.h> 
    2430 
    2531 
     32/** 
     33 * @defgroup PJSIP_HIGH_UA User Agent Library 
     34 * @ingroup PJSIP 
     35 * @brief Mid-level User Agent Library. 
     36 * 
     37 * This is the high level user agent library, which consists of: 
     38 *  - @ref PJSIP_INV, to encapsulate INVITE sessions and SDP 
     39 *    negotiation in the session, 
     40 *  - @ref PJSUA_REGC, high level client registration API, and 
     41 *  - @ref PJSUA_XFER. 
     42 * 
     43 * More detailed information is explained in 
     44 * <A HREF="/docs.htm">PJSIP Developer's Guide</A> 
     45 * PDF document, and readers are encouraged to read the document to 
     46 * get the concept behind dialog, dialog usages, and INVITE sessions. 
     47 * 
     48 * The User Agent Library is implemented in <b>pjsip-ua</b> static 
     49 * library. 
     50 */ 
     51 
     52/** 
     53 * @defgroup PJSIP_INV INVITE Session 
     54 * @ingroup PJSIP_HIGH_UA 
     55 * @brief Provides INVITE session management. 
     56 * @{ 
     57 * 
     58 * The INVITE session uses the @ref PJSIP_DIALOG framework to manage 
     59 * the underlying dialog, and is one type of usages that can use 
     60 * a particular dialog instance (other usages are event subscription, 
     61 * discussed in @ref PJSIP_EVENT_NOT). The INVITE session manages 
     62 * the life-time of the session, and also manages the SDP negotiation. 
     63 * 
     64 * Application must link with  <b>pjsip-ua</b> static library to use this API. 
     65 * 
     66 * More detailed information is explained in 
     67 * <A HREF="/docs.htm">PJSIP Developer's Guide</A> 
     68 * PDF document, and readers are encouraged to read the document to 
     69 * get the concept behind dialog, dialog usages, and INVITE sessions. 
     70 * 
     71 * The INVITE session does NOT manage media. If application wants to 
     72 * use API that encapsulates both signaling and media in a very easy 
     73 * to use API, it can use @ref PJSUA_LIB for this purpose. 
     74 */ 
     75 
    2676PJ_BEGIN_DECL 
    2777 
    2878 
    29 typedef enum pjsip_inv_state pjsip_inv_state; 
     79/** 
     80 * @see pjsip_inv_session 
     81 */ 
    3082typedef struct pjsip_inv_session pjsip_inv_session; 
    31 typedef struct pjsip_inv_callback pjsip_inv_callback; 
     83 
    3284 
    3385/** 
    3486 * This enumeration describes invite session state. 
    3587 */ 
    36 enum pjsip_inv_state 
     88typedef enum pjsip_inv_state 
    3789{ 
    3890    PJSIP_INV_STATE_NULL,           /**< Before INVITE is sent or received  */ 
     
    4395    PJSIP_INV_STATE_CONFIRMED,      /**< After ACK is sent/received.        */ 
    4496    PJSIP_INV_STATE_DISCONNECTED,   /**< Session is terminated.             */ 
    45 }; 
     97} pjsip_inv_state; 
    4698 
    4799/** 
     
    50102 * the invite session. 
    51103 */ 
    52 struct pjsip_inv_callback 
     104typedef struct pjsip_inv_callback 
    53105{ 
    54106    /** 
     
    119171    void (*on_media_update)(pjsip_inv_session *inv_ses,  
    120172                            pj_status_t status); 
    121 }; 
     173 
     174} pjsip_inv_callback; 
     175 
    122176 
    123177 
     
    188242 * 
    189243 * @param endpt         The endpoint instance. 
    190  * @param callback      Callback structure. 
     244 * @param cb            Callback structure. 
    191245 * 
    192246 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     
    311365 *                      received request to see if the request contains  
    312366 *                      features that it supports. 
    313  * @param sdp           If application has determined its media capability,  
     367 * @param local_sdp     If application has determined its media capability,  
    314368 *                      it can specify this capability in this argument.  
    315369 *                      If SDP is received in the initial INVITE, the UAS  
     
    564618PJ_END_DECL 
    565619 
     620/** 
     621 * @} 
     622 */ 
    566623 
    567624 
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h

    r201 r515  
    2727#include <pjsip/sip_types.h> 
    2828#include <pjsip/sip_auth.h> 
    29 //#include <pjsip/sip_ua.h> 
     29 
     30 
     31/** 
     32 * @defgroup PJSUA_REGC Client Registration 
     33 * @ingroup PJSIP_HIGH_UA 
     34 * @brief High Layer API for performing client registration. 
     35 * @{ 
     36 * 
     37 * This provides API for performing client registration. Application must 
     38 * link with  <b>pjsip-ua</b> static library to use this API. 
     39 
     40 */ 
     41 
    3042 
    3143PJ_BEGIN_DECL 
    32  
    33 /** 
    34  * @defgroup PJSUA_REGC SIP Registration Client 
    35  * @ingroup PJSUA 
    36  * @{ 
    37  * \brief 
    38  *   API for performing registration for user agent. 
    39  */ 
    4044 
    4145/** Typedef for client registration data. */ 
     
    5761struct pjsip_regc_cbparam 
    5862{ 
    59     pjsip_regc          *regc; 
    60     void                *token; 
    61     int                  code; 
    62     pj_status_t          status; 
    63     pj_str_t             reason; 
    64     pjsip_rx_data       *rdata; 
    65     int                  contact_cnt; 
    66     int                  expiration; 
    67     pjsip_contact_hdr   *contact[PJSIP_REGC_MAX_CONTACT]; 
     63    pjsip_regc          *regc;      /**< Client registration structure.     */ 
     64    void                *token;     /**< Arbitrary token.                   */ 
     65    pj_status_t          status;    /**< Error status.                      */ 
     66    int                  code;      /**< SIP status code received.          */ 
     67    pj_str_t             reason;    /**< SIP reason phrase received.        */ 
     68    pjsip_rx_data       *rdata;     /**< The complete received response.    */ 
     69    int                  expiration;/**< Next expiration interval.          */ 
     70    int                  contact_cnt;/**<Number of contacts in response.    */ 
     71    pjsip_contact_hdr   *contact[PJSIP_REGC_MAX_CONTACT]; /**< Contacts.    */ 
    6872}; 
    6973 
     
    150154 * 
    151155 * @param regc      The client registration structure. 
     156 * @param srv_url   Server URL. 
    152157 * @param from_url  The person performing the registration, must be a SIP URL type. 
    153158 * @param to_url    The address of record for which the registration is targetd, must 
     
    260265PJ_END_DECL 
    261266 
     267/** 
     268 * @} 
     269 */ 
     270 
    262271#endif  /* __PJSIP_REG_H__ */ 
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_xfer.h

    r212 r515  
    2929#include <pjsip/sip_msg.h> 
    3030 
     31/** 
     32 * @defgroup PJSUA_XFER Call Transfer 
     33 * @ingroup PJSIP_HIGH_UA 
     34 * @brief Provides call transfer functionality. 
     35 * @{ 
     36 * 
     37 * This implements call transfer functionality to INVITE sessions. The call 
     38 * transfer functionality uses SIP Event Subscription framework for 
     39 * managing call transfer status. 
     40 * 
     41 * Application must link with <b>pjsip-ua</b> AND <b>pjsip-simple</b> static 
     42 * libraries to use call transfer functionality. 
     43 */ 
    3144 
    3245 
     
    169182 
    170183 
     184PJ_END_DECL 
    171185 
    172 PJ_END_DECL 
     186/** 
     187 * @} 
     188 */ 
    173189 
    174190#endif  /* __PJSIP_XFER_H__ */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_auth.h

    r127 r515  
    3030PJ_BEGIN_DECL 
    3131 
    32  
    33 /** 
    34  * @defgroup PJSIP_AUTH_API Authorization API's 
     32/** 
     33 * @addtogroup PJSIP_AUTH Authentication Framework 
     34 * @ingroup PJSIP_CORE 
     35 * @brief Client and server side authentication framework. 
     36 */ 
     37 
     38/** 
     39 * @defgroup PJSIP_AUTH_API Authentication API's 
    3540 * @ingroup PJSIP_AUTH 
     41 * @brief Structures and functions to perform authentication. 
    3642 * @{ 
    3743 */ 
    3844 
    39 /* Length of digest string. */ 
     45/** Length of digest string. */ 
    4046#define PJSIP_MD5STRLEN 32 
    4147 
     
    8187typedef struct pjsip_cached_auth_hdr 
    8288{ 
     89    /** Standard list member */ 
    8390    PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth_hdr); 
    8491 
     
    101108typedef struct pjsip_cached_auth 
    102109{ 
     110    /** Standard list member */ 
    103111    PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth); 
    104112 
  • pjproject/trunk/pjsip/include/pjsip/sip_auth_msg.h

    r65 r515  
    2525 
    2626/** 
    27  * @defgroup PJSIP_MSG_AUTHORIZATION Header Field: Authorization and Proxy-Authorization 
    28  * @brief Authorization and Proxy-Authorization header field. 
    29  * @ingroup PJSIP_MSG 
     27 * @addtogroup PJSIP_MSG_HDR 
    3028 * @{ 
    3129 */ 
    3230 
    3331/** 
    34  * Common credential. 
     32 * Common credential structure represents common credential fields 
     33 * present in Authorization/Proxy-Authorization header. 
    3534 */ 
    3635struct pjsip_common_credential 
    3736{ 
    38     pj_str_t    realm; 
    39     pjsip_param other_param; 
    40 }; 
    41  
     37    pj_str_t    realm;          /**< Credential's realm.    */ 
     38    pjsip_param other_param;    /**< Other parameters.      */ 
     39}; 
     40 
     41/** 
     42 * @see pjsip_common_credential 
     43 */ 
    4244typedef struct pjsip_common_credential pjsip_common_credential; 
    4345 
     
    4951struct pjsip_digest_credential 
    5052{ 
    51     pj_str_t    realm; 
    52     pjsip_param other_param; 
    53     pj_str_t    username; 
    54     pj_str_t    nonce; 
    55     pj_str_t    uri; 
    56     pj_str_t    response; 
    57     pj_str_t    algorithm; 
    58     pj_str_t    cnonce; 
    59     pj_str_t    opaque; 
    60     pj_str_t    qop; 
    61     pj_str_t    nc; 
    62 }; 
    63  
     53    pj_str_t    realm;          /**< Realm of the credential    */ 
     54    pjsip_param other_param;    /**< Other parameters.          */ 
     55    pj_str_t    username;       /**< Username parameter.        */ 
     56    pj_str_t    nonce;          /**< Nonce parameter.           */ 
     57    pj_str_t    uri;            /**< URI parameter.             */  
     58    pj_str_t    response;       /**< Response digest.           */ 
     59    pj_str_t    algorithm;      /**< Algorithm.                 */ 
     60    pj_str_t    cnonce;         /**< Cnonce.                    */ 
     61    pj_str_t    opaque;         /**< Opaque value.              */ 
     62    pj_str_t    qop;            /**< Quality of protection.     */ 
     63    pj_str_t    nc;             /**< Nonce count.               */ 
     64}; 
     65 
     66/** 
     67 * @see pjsip_digest_credential 
     68 */ 
    6469typedef struct pjsip_digest_credential pjsip_digest_credential; 
    6570 
     
    7075struct pjsip_pgp_credential 
    7176{ 
    72     pj_str_t    realm; 
    73     pjsip_param other_param; 
    74     pj_str_t    version; 
    75     pj_str_t    signature; 
    76     pj_str_t    signed_by; 
    77     pj_str_t    nonce; 
    78 }; 
    79  
     77    pj_str_t    realm;          /**< Realm.                     */ 
     78    pjsip_param other_param;    /**< Other parameters.          */ 
     79    pj_str_t    version;        /**< Version parameter.         */ 
     80    pj_str_t    signature;      /**< Signature parameter.       */ 
     81    pj_str_t    signed_by;      /**< Signed by parameter.       */ 
     82    pj_str_t    nonce;          /**< Nonce parameter.           */ 
     83}; 
     84 
     85/** 
     86 * @see pjsip_pgp_credential 
     87 */ 
    8088typedef struct pjsip_pgp_credential pjsip_pgp_credential; 
    8189 
     
    8694struct pjsip_authorization_hdr 
    8795{ 
     96    /** Standard header fiends. */ 
    8897    PJSIP_DECL_HDR_MEMBER(struct pjsip_authorization_hdr); 
     98 
     99    /** Authorization scheme.  */ 
    89100    pj_str_t scheme; 
     101 
     102    /** Type of credentials, depending on the scheme. */ 
    90103    union 
    91104    { 
    92         pjsip_common_credential common; 
    93         pjsip_digest_credential digest; 
    94         pjsip_pgp_credential    pgp; 
     105        pjsip_common_credential common; /**< Common fields.         */ 
     106        pjsip_digest_credential digest; /**< Digest credentials.    */ 
     107        pjsip_pgp_credential    pgp;    /**< PGP credentials.       */ 
    95108    } credential; 
    96109}; 
    97110 
     111/** 
     112 * @see pjsip_authorization_hdr. 
     113 */ 
    98114typedef struct pjsip_authorization_hdr pjsip_authorization_hdr; 
    99115 
     
    105121/** 
    106122 * Create SIP Authorization header. 
    107  * @param pool Pool where memory will be allocated from. 
    108  * @return SIP Authorization header. 
    109  */ 
    110 PJ_DECL(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool); 
     123 * @param pool      Pool where memory will be allocated from. 
     124 * @return          SIP Authorization header. 
     125 */ 
     126PJ_DECL(pjsip_authorization_hdr*)  
     127pjsip_authorization_hdr_create(pj_pool_t *pool); 
    111128 
    112129/** 
    113130 * Create SIP Proxy-Authorization header. 
    114  * @param pool Pool where memory will be allocated from. 
    115  * @return SIP Proxy-Authorization header. 
    116  */ 
    117 PJ_DECL(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_pool_t *pool); 
    118  
    119  
    120 /** 
    121  * @} 
    122  */ 
    123  
    124 /** 
    125  * @defgroup PJSIP_WWW_AUTH Header Field: Proxy-Authenticate and WWW-Authenticate 
    126  * @brief Proxy-Authenticate and WWW-Authenticate. 
    127  * @ingroup PJSIP_MSG 
    128  * @{ 
    129  */ 
    130  
     131 * @param pool      Pool where memory will be allocated from. 
     132 * @return SIP      Proxy-Authorization header. 
     133 */ 
     134PJ_DECL(pjsip_proxy_authorization_hdr*)  
     135pjsip_proxy_authorization_hdr_create(pj_pool_t *pool); 
     136 
     137 
     138/** 
     139 * This structure describes common fields in authentication challenge 
     140 * headers (WWW-Authenticate and Proxy-Authenticate). 
     141 */ 
    131142struct pjsip_common_challenge 
    132143{ 
    133     pj_str_t    realm; 
    134     pjsip_param other_param; 
    135 }; 
    136  
     144    pj_str_t    realm;          /**< Realm for the challenge.   */ 
     145    pjsip_param other_param;    /**< Other parameters.          */ 
     146}; 
     147 
     148/** 
     149 * @see pjsip_common_challenge 
     150 */ 
    137151typedef struct pjsip_common_challenge pjsip_common_challenge; 
    138152 
     
    143157struct pjsip_digest_challenge 
    144158{ 
    145     pj_str_t    realm; 
    146     pjsip_param other_param; 
    147     pj_str_t    domain; 
    148     pj_str_t    nonce; 
    149     pj_str_t    opaque; 
    150     int         stale; 
    151     pj_str_t    algorithm; 
    152     pj_str_t    qop; 
    153 }; 
    154  
     159    pj_str_t    realm;          /**< Realm for the challenge.   */ 
     160    pjsip_param other_param;    /**< Other parameters.          */ 
     161    pj_str_t    domain;         /**< Domain.                    */ 
     162    pj_str_t    nonce;          /**< Nonce challenge.           */ 
     163    pj_str_t    opaque;         /**< Opaque value.              */ 
     164    int         stale;          /**< Stale parameter.           */ 
     165    pj_str_t    algorithm;      /**< Algorithm parameter.       */ 
     166    pj_str_t    qop;            /**< Quality of protection.     */ 
     167}; 
     168 
     169/** 
     170 * @see pjsip_digest_challenge 
     171 */ 
    155172typedef struct pjsip_digest_challenge pjsip_digest_challenge; 
    156173 
     
    161178struct pjsip_pgp_challenge 
    162179{ 
    163     pj_str_t    realm; 
    164     pjsip_param other_param; 
    165     pj_str_t    version; 
    166     pj_str_t    micalgorithm; 
    167     pj_str_t    pubalgorithm; 
    168     pj_str_t    nonce; 
    169 }; 
    170  
     180    pj_str_t    realm;          /**< Realm for the challenge.   */ 
     181    pjsip_param other_param;    /**< Other parameters.          */ 
     182    pj_str_t    version;        /**< PGP version.               */ 
     183    pj_str_t    micalgorithm;   /**< micalgorithm parameter.    */ 
     184    pj_str_t    pubalgorithm;   /**< pubalgorithm parameter.    */  
     185    pj_str_t    nonce;          /**< Nonce challenge.           */ 
     186}; 
     187 
     188/** 
     189 * @see pjsip_pgp_challenge 
     190 */ 
    171191typedef struct pjsip_pgp_challenge pjsip_pgp_challenge; 
    172192 
     
    177197struct pjsip_www_authenticate_hdr 
    178198{ 
     199    /** Standard header fields. */ 
    179200    PJSIP_DECL_HDR_MEMBER(struct pjsip_www_authenticate_hdr); 
     201 
     202    /** Authentication scheme  */ 
    180203    pj_str_t    scheme; 
     204 
     205    /** This union contains structures that are only relevant 
     206        depending on the value of the scheme being used. 
     207     */ 
    181208    union 
    182209    { 
    183         pjsip_common_challenge  common; 
    184         pjsip_digest_challenge  digest; 
    185         pjsip_pgp_challenge     pgp; 
     210        pjsip_common_challenge  common; /**< Common fields.     */ 
     211        pjsip_digest_challenge  digest; /**< Digest challenge.  */ 
     212        pjsip_pgp_challenge     pgp;    /**< PGP challenge.     */ 
    186213    } challenge; 
    187214}; 
    188215 
     216/** 
     217 * WWW-Authenticate header. 
     218 */ 
    189219typedef struct pjsip_www_authenticate_hdr pjsip_www_authenticate_hdr; 
     220 
     221/** 
     222 * Proxy-Authenticate header. 
     223 */ 
    190224typedef struct pjsip_www_authenticate_hdr pjsip_proxy_authenticate_hdr; 
    191225 
     
    193227/** 
    194228 * Create SIP WWW-Authenticate header. 
    195  * @param pool Pool where memory will be allocated from. 
    196  * @return SIP WWW-Authenticate header. 
    197  */ 
    198 PJ_DECL(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t *pool); 
     229 * 
     230 * @param pool      Pool where memory will be allocated from. 
     231 * @return          SIP WWW-Authenticate header. 
     232 */ 
     233PJ_DECL(pjsip_www_authenticate_hdr*)  
     234pjsip_www_authenticate_hdr_create(pj_pool_t *pool); 
    199235 
    200236/** 
    201237 * Create SIP Proxy-Authenticate header. 
    202  * @param pool Pool where memory will be allocated from. 
    203  * @return SIP Proxy-Authenticate header. 
    204  */ 
    205 PJ_DECL(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool); 
     238 * 
     239 * @param pool      Pool where memory will be allocated from. 
     240 * @return          SIP Proxy-Authenticate header. 
     241 */ 
     242PJ_DECL(pjsip_proxy_authenticate_hdr*)  
     243pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool); 
    206244 
    207245/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_auth_parser.h

    r65 r515  
    3030 
    3131/** 
    32  * @defgroup PJSIP_AUTH_PARSER_MODULE Authorization Parser Module 
    33  * @ingroup PJSIP_AUTH 
    34  * @{ 
    35  */ 
    36  
    37 /** 
    3832 * Initialize and register authorization parser module. 
    3933 * This will register parser handler for various Authorization related headers 
    4034 * such as Authorization, WWW-Authenticate, Proxy-Authorizization, and  
    4135 * Proxy-Authenticate headers. 
     36 * 
     37 * This function is called automatically by the main SIP parser. 
    4238 * 
    4339 * @return      PJ_SUCCESS or the appropriate status code. 
     
    5147 
    5248 
    53 extern const pj_str_t   pjsip_USERNAME_STR, 
    54                         pjsip_REALM_STR, 
    55                         pjsip_NONCE_STR, 
    56                         pjsip_URI_STR, 
    57                         pjsip_RESPONSE_STR, 
    58                         pjsip_ALGORITHM_STR, 
    59                         pjsip_DOMAIN_STR, 
    60                         pjsip_STALE_STR, 
    61                         pjsip_QOP_STR, 
    62                         pjsip_CNONCE_STR, 
    63                         pjsip_OPAQUE_STR, 
    64                         pjsip_NC_STR, 
    65                         pjsip_TRUE_STR, 
    66                         pjsip_FALSE_STR, 
    67                         pjsip_DIGEST_STR, 
    68                         pjsip_PGP_STR, 
    69                         pjsip_MD5_STR, 
    70                         pjsip_AUTH_STR; 
    71 /* 
    72 extern const pj_str_t   pjsip_QUOTED_TRUE_STR, 
    73                         pjsip_QUOTED_FALSE_STR, 
    74                         pjsip_QUOTED_DIGEST_STR, 
    75                         pjsip_QUOTED_PGP_STR, 
    76                         pjsip_QUOTED_MD5_STR, 
    77                         pjsip_QUOTED_AUTH_STR; 
    78 */ 
    7949 
    80 /** 
    81  * @} 
    82  */ 
     50extern const pj_str_t   pjsip_USERNAME_STR, /**< "username" string const.   */ 
     51                        pjsip_REALM_STR,    /**< "realm" string const.      */ 
     52                        pjsip_NONCE_STR,    /**< "nonce" string const.      */ 
     53                        pjsip_URI_STR,      /**< "uri" string const.        */ 
     54                        pjsip_RESPONSE_STR, /**< "response" string const.   */ 
     55                        pjsip_ALGORITHM_STR,/**< "algorithm" string const.  */ 
     56                        pjsip_DOMAIN_STR,   /**< "domain" string const.     */ 
     57                        pjsip_STALE_STR,    /**< "stale" string const.      */ 
     58                        pjsip_QOP_STR,      /**< "qop" string const.        */ 
     59                        pjsip_CNONCE_STR,   /**< "cnonce" string const.     */ 
     60                        pjsip_OPAQUE_STR,   /**< "opaque" string const.     */ 
     61                        pjsip_NC_STR,       /**< "nc" string const.         */ 
     62                        pjsip_TRUE_STR,     /**< "true" string const.       */ 
     63                        pjsip_FALSE_STR,    /**< "false" string const.      */ 
     64                        pjsip_DIGEST_STR,   /**< "digest" string const.     */ 
     65                        pjsip_PGP_STR,      /**< "pgp" string const.        */ 
     66                        pjsip_MD5_STR,      /**< "md5" string const.        */ 
     67                        pjsip_AUTH_STR;     /**< "auth" string const.       */ 
    8368 
    8469PJ_END_DECL 
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r491 r515  
    2020#define __PJSIP_SIP_CONFIG_H__ 
    2121 
     22/** 
     23 * @file sip_config.h 
     24 * @brief Compile time configuration. 
     25 */ 
    2226#include <pj/config.h> 
     27 
     28/** 
     29 * @defgroup PJSIP PJSIP Library Collection 
     30 */ 
     31 
     32/** 
     33 * @defgroup PJSIP_CORE Core SIP Library 
     34 * @ingroup PJSIP 
     35 * @brief The core framework from which all other SIP components depends on. 
     36 *  
     37 * The PJSIP Core library only provides transport framework, event 
     38 * dispatching/module framework, and SIP message representation and 
     39 * parsing. It doesn't do anything usefull in itself! 
     40 * 
     41 * If application wants the stack to do anything usefull at all, 
     42 * it must registers @ref PJSIP_MOD to the core library. Examples 
     43 * of modules are @ref PJSIP_TRANSACT and @ref PJSUA_UA. 
     44 */ 
     45 
     46/** 
     47 * @defgroup PJSIP_BASE Base Types 
     48 * @ingroup PJSIP_CORE 
     49 * @brief Basic PJSIP types and configurations. 
     50 */ 
     51 
     52/** 
     53 * @defgroup PJSIP_CONFIG Compile Time Configuration 
     54 * @ingroup PJSIP_BASE 
     55 * @brief PJSIP compile time configurations. 
     56 * @{ 
     57 */ 
    2358 
    2459/** 
     
    74109#ifndef PJSIP_MAX_MODULE 
    75110#   define PJSIP_MAX_MODULE             16 
     111#endif 
     112 
     113 
     114/** 
     115 * Maximum packet length. 
     116 */ 
     117#ifndef PJSIP_MAX_PKT_LEN 
     118#   define PJSIP_MAX_PKT_LEN            1500 
    76119#endif 
    77120 
     
    85128/* Transport related constants. */ 
    86129 
    87 #define PJSIP_MAX_PKT_LEN               1500 
    88130#define PJSIP_POOL_RDATA_LEN            4000 
    89131#define PJSIP_POOL_RDATA_INC            4000 
     
    142184//#define PJSIP_T2_TIMEOUT      60000 
    143185 
    144 /* T1 timeout value. */ 
     186/** Transaction T1 timeout value. */ 
    145187#if !defined(PJSIP_T1_TIMEOUT) 
    146188#  define PJSIP_T1_TIMEOUT      500 
    147189#endif 
    148190 
    149 /* T2 timeout value. */ 
     191/** Transaction T2 timeout value. */ 
    150192#if !defined(PJSIP_T2_TIMEOUT) 
    151193#  define PJSIP_T2_TIMEOUT      4000 
    152194#endif 
    153195 
    154 /* Completed timer for non-INVITE */ 
     196/** Transaction completed timer for non-INVITE */ 
    155197#if !defined(PJSIP_T4_TIMEOUT) 
    156198#  define PJSIP_T4_TIMEOUT      5000 
    157199#endif 
    158200 
    159 /* Completed timer for INVITE */ 
     201/** Transaction completed timer for INVITE */ 
    160202#if !defined(PJSIP_TD_TIMEOUT) 
    161203#  define PJSIP_TD_TIMEOUT      32000 
     
    167209 */ 
    168210 
    169 /* 
     211/** 
    170212 * If this flag is set, the stack will keep the Authorization/Proxy-Authorization 
    171213 * headers that are sent in a cache. Future requests with the same realm and 
     
    183225#endif 
    184226 
    185 /* 
     227/** 
    186228 * If this flag is set, the stack will proactively send Authorization/Proxy- 
    187229 * Authorization header for next requests. If next request has the same method 
     
    204246#endif 
    205247 
    206 /* 
     248/** 
    207249 * Support qop="auth" directive. 
    208250 * This option also requires client to cache the last challenge offered by 
     
    216258 
    217259 
     260/** 
     261 * @} 
     262 */ 
     263 
    218264#include <pj/config.h> 
    219265 
  • pjproject/trunk/pjsip/include/pjsip/sip_dialog.h

    r376 r515  
    3131#include <pj/sock.h> 
    3232#include <pj/assert.h> 
     33 
     34 
     35/** 
     36 * @defgroup PJSIP_DIALOG Base Dialog 
     37 * @ingroup PJSIP_UA 
     38 * @brief The base dialog framework to support dialog usages. 
     39 * @{ 
     40 * 
     41 * The base dialog framework provides management for base dialog 
     42 * properties such as <b>From</b> header, <b>To</b> header, <b>CSeq</b> 
     43 * sequencing, <b>Call-ID</b> header, <b>Contact</b> header management,  
     44 * dialog <b>route-set</b> management, and common <b>authentication</b>.  
     45 * This basic dialog functionality will be shared by all <b>dialog 
     46 * usages</b> of a particular dialog. 
     47 * 
     48 * More detailed information is explained in 
     49 * <A HREF="/docs.htm">PJSIP Developer's Guide</A> 
     50 * PDF document, and readers are encouraged to read the document to 
     51 * get the concept behind dialog, dialog usages, and INVITE sessions. 
     52 * 
     53 * Application MUST initialize the user agent layer module by calling 
     54 * #pjsip_ua_init_module() before using any of the dialog API, and link 
     55 * the application with with <b>pjsip-core</b> library. 
     56 */ 
    3357 
    3458PJ_BEGIN_DECL 
     
    5579enum pjsip_dialog_state 
    5680{ 
     81    /** Dialog is not established. */ 
    5782    PJSIP_DIALOG_STATE_NULL, 
     83 
     84    /** Dialog has been established (probably early) */ 
    5885    PJSIP_DIALOG_STATE_ESTABLISHED, 
    5986}; 
     
    87114    pjsip_endpoint     *endpt;      /**< Endpoint instance.                 */ 
    88115 
    89     /* The dialog set. */ 
     116    /** The dialog set which this dialog belongs (opaque type). */ 
    90117    void               *dlg_set; 
    91118 
  • pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h

    r486 r515  
    2828#include <pjsip/sip_resolve.h> 
    2929 
     30/** 
     31 * @defgroup PJSIP_CORE_CORE At the Very Core 
     32 * @ingroup PJSIP_CORE 
     33 * @brief The very core of PJSIP. 
     34 */ 
     35 
    3036PJ_BEGIN_DECL 
    3137 
    3238/** 
    33  * @defgroup PJSIP SIP Stack Core 
    34  * Implementation of core SIP protocol stack processing. 
    35  */ 
    36  
    37 /** 
    38  * @defgroup PJSIP_ENDPT SIP Endpoint 
    39  * @ingroup PJSIP 
    40  * @brief 
    41  * Representation of SIP node instance. 
     39 * @defgroup PJSIP_ENDPT Endpoint 
     40 * @ingroup PJSIP_CORE_CORE 
     41 * @brief The master, owner of all objects 
    4242 * 
    4343 * SIP Endpoint instance (pjsip_endpoint) can be viewed as the master/owner of 
     
    287287 * Note: at the moment we don't have implementation of RFC 3263 yet! 
    288288 * 
    289  * @param resolver  The resolver engine. 
     289 * @param endpt     The endpoint instance. 
    290290 * @param pool      The pool to allocate resolver job. 
    291291 * @param target    The target specification to be resolved. 
     
    420420 
    421421/** 
     422 * @} 
     423 */ 
     424 
     425 
     426/** 
    422427 * Log an error. 
    423428 */ 
     
    437442            } while (0) 
    438443 
    439 /** 
    440  * @} 
    441  */ 
    442  
    443444/* 
    444445 * Internal functions. 
  • pjproject/trunk/pjsip/include/pjsip/sip_errno.h

    r491 r515  
    2020#define __PJSIP_SIP_ERRNO_H__ 
    2121 
     22/** 
     23 * @file sip_errno.h 
     24 * @brief PJSIP Specific Error Code 
     25 */ 
     26 
    2227#include <pj/errno.h> 
    2328 
    2429PJ_BEGIN_DECL 
     30 
     31/** 
     32 * @defgroup PJSIP_CORE_ERRNO PJSIP Specific Error Code 
     33 * @ingroup PJSIP_BASE 
     34 * @brief PJSIP specific error constants. 
     35 * @{ 
     36 */ 
    2537 
    2638/* 
     
    383395PJ_END_DECL 
    384396 
     397 
     398/** 
     399 * @} 
     400 */ 
     401 
    385402#endif  /* __PJSIP_SIP_ERRNO_H__ */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_event.h

    r160 r515  
    2828 
    2929/** 
    30  * @defgroup PJSIP_EVENT SIP Event 
    31  * @ingroup PJSIP 
     30 * @defgroup PJSIP_EVENT Event 
     31 * @ingroup PJSIP_CORE_CORE 
     32 * @brief Representation of events as they are distributed among modules. 
    3233 * @{ 
    3334 */ 
     
    6566 
    6667/** 
    67  * \struct 
    68  * \brief Event descriptor to fully identify a SIP event. 
     68 * This structure describe event descriptor to fully identify a SIP event. 
    6969 * 
    7070 * Events are the only way for a lower layer object to inform something 
     
    8686    pjsip_event_id_e type; 
    8787 
    88     /* 
    89      * The event body. 
     88    /** 
     89     * The event body as union, which fields depends on the event type. 
    9090     * By convention, the first member of each struct in the union must be 
    9191     * the pointer which is relevant to the event. 
     
    217217 * Get the event string from the event ID. 
    218218 * @param e the event ID. 
    219  * @notes defined in sip_util.c 
     219 * @note defined in sip_util.c 
    220220 */ 
    221221PJ_DEF(const char *) pjsip_event_str(pjsip_event_id_e e); 
  • pjproject/trunk/pjsip/include/pjsip/sip_module.h

    r230 r515  
    3030 
    3131/** 
    32  * @defgroup PJSIP_MOD SIP Modules 
    33  * @ingroup PJSIP 
     32 * @defgroup PJSIP_MOD Modules 
     33 * @ingroup PJSIP_CORE_CORE 
     34 * @brief Modules are the primary means to extend PJSIP! 
    3435 * @{ 
    35  */ 
    36  
    37 /** 
    38  * Module registration structure, which is passed by the module to the 
    39  * endpoint during the module registration process. This structure enables 
    40  * the endpoint to query the module capability and to further communicate 
    41  * with the module. 
     36 * Modules are the primary means to extend PJSIP. Without modules, PJSIP 
     37 * would not know how to handle messages, and will simply discard all 
     38 * incoming messages. 
     39 * 
     40 * Modules are registered by creating and initializing #pjsip_module  
     41 * structure, and register the structure to PJSIP with  
     42 * #pjsip_endpt_register_module(). 
     43 * 
     44 * The <A HREF="/docs.htm">PJSIP Developer's Guide</A> 
     45 * has a thorough discussion on this subject, and readers are encouraged 
     46 * to read the document for more information. 
     47 */ 
     48 
     49/** 
     50 * The declaration for SIP module. This structure would be passed to 
     51 * #pjsip_endpt_register_module() to register the module to PJSIP. 
    4252 */ 
    4353struct pjsip_module 
     
    4757 
    4858    /** 
    49      * Module name. 
     59     * Module name to identify the module. 
     60     * 
     61     * This field MUST be initialized before registering the module. 
    5062     */ 
    5163    pj_str_t name; 
    5264 
    5365    /** 
    54      * Module ID. 
     66     * Module ID. Application must initialize this field with -1 before 
     67     * registering the module to PJSIP. After the module is registered, 
     68     * this field will contain a unique ID to identify the module. 
    5569     */ 
    5670    int id; 
     
    6074     * regard to other modules. Higher number will make the module gets 
    6175     * initialized later. 
     76     * 
     77     * This field MUST be initialized before registering the module. 
    6278     */ 
    6379    int priority; 
    6480 
    6581    /** 
    66      * Pointer to function to be called to initialize the module. 
     82     * Optional function to be called to initialize the module. This function 
     83     * will be called by endpoint during module registration. If the value 
     84     * is NULL, then it's equal to returning PJ_SUCCESS. 
    6785     * 
    6886     * @param endpt     The endpoint instance. 
     
    7290 
    7391    /** 
    74      * Pointer to function to be called to start the module. 
     92     * Optional function to be called to start the module. This function 
     93     * will be called by endpoint during module registration. If the value 
     94     * is NULL, then it's equal to returning PJ_SUCCESS. 
    7595     * 
    7696     * @return          Module should return zero to indicate success. 
     
    7999 
    80100    /** 
    81      * Pointer to function to be called to deinitialize the module before 
    82      * it is unloaded. 
     101     * Optional function to be called to deinitialize the module before 
     102     * it is unloaded. This function will be called by endpoint during  
     103     * module unregistration. If the value is NULL, then it's equal to  
     104     * returning PJ_SUCCESS. 
    83105     * 
    84106     * @return          Module should return PJ_SUCCESS to indicate success. 
     
    87109 
    88110    /** 
    89      * Pointer to function to be called to deinitialize the module before 
    90      * it is unloaded. 
     111     * Optional function to be called to deinitialize the module before 
     112     * it is unloaded. This function will be called by endpoint during  
     113     * module unregistration. If the value is NULL, then it's equal to  
     114     * returning PJ_SUCCESS. 
    91115     * 
    92116     * @param mod       The module. 
     
    97121 
    98122    /** 
    99      * Called to process incoming request. 
     123     * Optional function to be called to process incoming request message. 
    100124     * 
    101125     * @param rdata     The incoming message. 
     
    108132 
    109133    /** 
    110      * Called to processed incoming response. 
     134     * Optional function to be called to process incoming response message. 
    111135     * 
    112136     * @param rdata     The incoming message. 
     
    119143 
    120144    /** 
    121      * Called to process outgoing request. 
     145     * Optional function to be called when transport layer is about to 
     146     * transmit outgoing request message. 
    122147     * 
    123148     * @param tdata     The outgoing request message. 
     
    130155 
    131156    /** 
    132      * Called to process outgoing response message. 
     157     * Optional function to be called when transport layer is about to 
     158     * transmit outgoing response message. 
    133159     * 
    134160     * @param tdata     The outgoing response message. 
     
    141167 
    142168    /** 
    143      * Called when this module is acting as transaction user for the specified 
    144      * transaction, when the transaction's state has changed. 
     169     * Optional function to be called when this module is acting as  
     170     * transaction user for the specified transaction, when the  
     171     * transaction's state has changed. 
    145172     * 
    146173     * @param tsx       The transaction. 
     
    158185enum pjsip_module_priority 
    159186{ 
     187    /**  
     188     * This is the priority used by transport layer. 
     189     */ 
    160190    PJSIP_MOD_PRIORITY_TRANSPORT_LAYER  = 8, 
     191 
     192    /** 
     193     * This is the priority used by transaction layer. 
     194     */ 
    161195    PJSIP_MOD_PRIORITY_TSX_LAYER        = 16, 
     196 
     197    /** 
     198     * This is the priority used by the user agent and proxy layer. 
     199     */ 
    162200    PJSIP_MOD_PRIORITY_UA_PROXY_LAYER   = 32, 
     201 
     202    /** 
     203     * This is the priority used by the dialog usages. 
     204     */ 
    163205    PJSIP_MOD_PRIORITY_DIALOG_USAGE     = 48, 
     206 
     207    /** 
     208     * This is the recommended priority to be used by applications. 
     209     */ 
    164210    PJSIP_MOD_PRIORITY_APPLICATION      = 64, 
    165211}; 
  • pjproject/trunk/pjsip/include/pjsip/sip_msg.h

    r266 r515  
    2121 
    2222/** 
    23  * @file sip_msg.h 
     23 * @file pjsip/sip_msg.h 
    2424 * @brief SIP Message Structure. 
    2525 */ 
     
    3232 
    3333/** 
    34  * @defgroup PJSIP_MSG SIP Message Structure 
    35  * @ingroup PJSIP 
     34 * @defgroup PJSIP_MSG Messaging Elements 
     35 * @ingroup PJSIP_CORE 
     36 * @brief Various SIP message elements such as methods, headers, URIs, etc. 
    3637 * @{ 
    3738 */ 
     
    155156/////////////////////////////////////////////////////////////////////////////// 
    156157/**  
    157  * @defgroup PJSIP_MSG_HDR Header Fields General Structure. 
    158  * @brief General Header Fields Structure. 
     158 * @defgroup PJSIP_MSG_HDR Header Fields 
     159 * @brief Declarations for various SIP header fields. 
    159160 * @ingroup PJSIP_MSG 
    160161 * @{ 
     
    462463/////////////////////////////////////////////////////////////////////////////// 
    463464/** 
    464  * @addtogroup PJSIP_MSG_MEDIA Media Type 
    465  * @brief Media type definitions and manipulations. 
     465 * @addtogroup PJSIP_MSG_MEDIA Media/MIME Type 
     466 * @brief Media/MIME type declaration and manipulations. 
    466467 * @ingroup PJSIP_MSG 
    467468 * @{ 
     
    655656/** 
    656657 * @defgroup PJSIP_MSG_MSG Message Structure 
    657  * @brief Message structure and operations. 
     658 * @brief SIP message (request and response) structure and operations. 
    658659 * @ingroup PJSIP_MSG 
    659660 * @{ 
     
    846847/////////////////////////////////////////////////////////////////////////////// 
    847848/** 
    848  * @addtogroup PJSIP_MSG_HDR_GEN Header Field: Generic 
    849  * @brief Generic header field which contains header name and value. 
    850  * @ingroup PJSIP_MSG 
     849 * @addtogroup PJSIP_MSG_HDR 
    851850 * @{ 
    852851 */ 
     
    905904 
    906905 
    907 /** 
    908  * @} 
    909  */ 
    910  
    911 /////////////////////////////////////////////////////////////////////////////// 
    912 /** 
    913  * @addtogroup PJSIP_MSG_HDR_GEN_INT Header Field: Generic Integer 
    914  * @brief Generic header field which contains header name and value. 
    915  * @ingroup PJSIP_MSG 
    916  * @{ 
    917  */ 
     906 
     907/////////////////////////////////////////////////////////////////////////////// 
    918908 
    919909/** 
     
    965955                                                            int value ); 
    966956 
    967 /** 
    968  * @} 
    969  */ 
    970  
    971 /////////////////////////////////////////////////////////////////////////////// 
    972 /** 
    973  * @defgroup PJSIP_MSG_HDR_GENERIC_LIST Header Field: Generic string list. 
    974  * @brief Header with list of strings separated with comma 
    975  * @ingroup PJSIP_MSG 
    976  * @{ 
    977  */ 
     957/////////////////////////////////////////////////////////////////////////////// 
    978958 
    979959/** Maximum elements in the header array. */ 
    980960#define PJSIP_GENERIC_ARRAY_MAX_COUNT   32 
    981961 
     962/** 
     963 * Generic array of string header. 
     964 */ 
    982965typedef struct pjsip_generic_array_hdr 
    983966{ 
     967    /** Standard header fields. */ 
    984968    PJSIP_DECL_HDR_MEMBER(struct pjsip_generic_array_hdr); 
    985     unsigned    count;                                  /**< Number of elements. */ 
    986     pj_str_t    values[PJSIP_GENERIC_ARRAY_MAX_COUNT];  /**< Elements.           */ 
     969 
     970    /** Number of tags/elements. */ 
     971    unsigned    count; 
     972 
     973    /**< Tags/elements. */ 
     974    pj_str_t    values[PJSIP_GENERIC_ARRAY_MAX_COUNT]; 
     975 
    987976} pjsip_generic_array_hdr; 
    988977 
     
    10191008 
    10201009 
    1021 /** 
    1022  * @} 
    1023  */ 
    1024  
    1025 /////////////////////////////////////////////////////////////////////////////// 
    1026 /** 
    1027  * @defgroup PJSIP_MSG_HDR_ACCEPT Header Field: Accept 
    1028  * @brief Accept header field. 
    1029  * @ingroup PJSIP_MSG 
    1030  * @{ 
    1031  */ 
     1010/////////////////////////////////////////////////////////////////////////////// 
     1011 
    10321012/** Accept header. */ 
    10331013typedef pjsip_generic_array_hdr pjsip_accept_hdr; 
     
    10621042                                                  void *mem ); 
    10631043 
    1064 /** 
    1065  * @} 
    1066  */ 
    1067  
    1068 /////////////////////////////////////////////////////////////////////////////// 
    1069 /** 
    1070  * @defgroup PJSIP_MSG_HDR_ALLOW Header Field: Allow 
    1071  * @brief Allow header field. 
    1072  * @ingroup PJSIP_MSG 
    1073  * @{ 
     1044 
     1045/////////////////////////////////////////////////////////////////////////////// 
     1046 
     1047/** 
     1048 * Allow header. 
    10741049 */ 
    10751050typedef pjsip_generic_array_hdr pjsip_allow_hdr; 
     
    11031078                                                void *mem ); 
    11041079 
    1105 /** 
    1106  * @} 
    1107  */ 
    1108  
    1109 /////////////////////////////////////////////////////////////////////////////// 
    1110 /** 
    1111  * @defgroup PJSIP_MSG_HDR_CID Header Field: Call-ID 
    1112  * @brief Call-ID header field. 
    1113  * @ingroup PJSIP_MSG 
    1114  * @{ 
    1115  */ 
     1080/////////////////////////////////////////////////////////////////////////////// 
     1081 
    11161082/** 
    11171083 * Call-ID header. 
     
    11521118 
    11531119 
    1154 /** 
    1155  * @} 
    1156  */ 
    1157  
    1158 /////////////////////////////////////////////////////////////////////////////// 
    1159 /** 
    1160  * @defgroup PJSIP_MSG_HDR_CLEN Header Field: Content-Length 
    1161  * @brief Content-Length header field. 
    1162  * @ingroup PJSIP_MSG 
    1163  * @{ 
    1164  */ 
     1120 
     1121/////////////////////////////////////////////////////////////////////////////// 
    11651122/** 
    11661123 * Content-Length header. 
     
    11981155 
    11991156 
    1200 /** 
    1201  * @} 
    1202  */ 
    1203  
    1204 /////////////////////////////////////////////////////////////////////////////// 
    1205 /** 
    1206  * @defgroup PJSIP_MSG_HDR_CSEQ Header Field: CSeq 
    1207  * @brief CSeq header field. 
    1208  * @ingroup PJSIP_MSG 
    1209  * @{ 
    1210  */ 
     1157/////////////////////////////////////////////////////////////////////////////// 
    12111158/** 
    12121159 * CSeq header. 
     
    12441191                                              void *mem ); 
    12451192 
    1246 /** 
    1247  * @} 
    1248  */ 
    1249  
    1250 /////////////////////////////////////////////////////////////////////////////// 
    1251 /** 
    1252  * @defgroup PJSIP_MSG_HDR_CONTACT Header Field: Contact 
    1253  * @brief Contact header field. 
    1254  * @ingroup PJSIP_MSG 
    1255  * @{ 
    1256  */ 
     1193/////////////////////////////////////////////////////////////////////////////// 
    12571194/** 
    12581195 * Contact header. 
     
    12971234                                                    void *mem ); 
    12981235 
    1299 /** 
    1300  * @} 
    1301  */ 
    1302  
    1303 /////////////////////////////////////////////////////////////////////////////// 
    1304 /** 
    1305  * @defgroup PJSIP_MSG_HDR_CTYPE Header Field: Content-Type 
    1306  * @brief Content-Type header field. 
    1307  * @ingroup PJSIP_MSG 
    1308  * @{ 
    1309  */ 
     1236 
     1237/////////////////////////////////////////////////////////////////////////////// 
    13101238/** 
    13111239 * Content-Type. 
     
    13431271                                                void *mem ); 
    13441272 
    1345 /** 
    1346  * @} 
    1347  */ 
    1348  
    1349 /////////////////////////////////////////////////////////////////////////////// 
    1350 /** 
    1351  * @defgroup PJSIP_MSG_HDR_EXPIRES Header Field: Expires 
    1352  * @brief Expires header field. 
    1353  * @ingroup PJSIP_MSG 
    1354  * @{ 
    1355  */ 
     1273/////////////////////////////////////////////////////////////////////////////// 
    13561274/** Expires header. */ 
    13571275typedef pjsip_generic_int_hdr pjsip_expires_hdr; 
     
    13881306 
    13891307 
    1390 /** 
    1391  * @} 
    1392  */ 
    1393  
    1394 /////////////////////////////////////////////////////////////////////////////// 
    1395 /** 
    1396  * @defgroup PJSIP_MSG_HDR_FROMTO Header Field: From/To 
    1397  * @brief From and To header field. 
    1398  * @ingroup PJSIP_MSG 
    1399  * @{ 
    1400  */ 
     1308 
     1309/////////////////////////////////////////////////////////////////////////////// 
    14011310/** 
    14021311 * To or From header. 
     
    14691378 * Convert the header to a From header. 
    14701379 * 
    1471  * @param pool  The pool. 
    1472  * @return      "From" header. 
     1380 * @param hdr       The generic from/to header. 
     1381 * @return          "From" header. 
    14731382 */ 
    14741383PJ_DECL(pjsip_from_hdr*) pjsip_fromto_hdr_set_from( pjsip_fromto_hdr *hdr ); 
     
    14771386 * Convert the header to a To header. 
    14781387 * 
    1479  * @param pool  The pool. 
    1480  * @return      "To" header. 
     1388 * @param hdr       The generic from/to header. 
     1389 * @return          "To" header. 
    14811390 */ 
    14821391PJ_DECL(pjsip_to_hdr*)   pjsip_fromto_hdr_set_to( pjsip_fromto_hdr *hdr ); 
    14831392 
    1484 /** 
    1485  * @} 
    1486  */ 
    1487  
    1488  
    1489 /////////////////////////////////////////////////////////////////////////////// 
    1490 /** 
    1491  * @defgroup PJSIP_MSG_HDR_MAX_FORWARDS Header Field: Max-Forwards 
    1492  * @brief Max-Forwards header field. 
    1493  * @ingroup PJSIP_MSG 
    1494  * @{ 
     1393 
     1394/////////////////////////////////////////////////////////////////////////////// 
     1395/** 
     1396 * Max-Forwards header. 
    14951397 */ 
    14961398typedef pjsip_generic_int_hdr pjsip_max_fwd_hdr; 
     
    15261428pjsip_max_fwd_hdr_init( pj_pool_t *pool, void *mem, int value ); 
    15271429 
    1528 /** 
    1529  * @} 
    1530  */ 
    1531  
    1532  
    1533 /////////////////////////////////////////////////////////////////////////////// 
    1534 /** 
    1535  * @defgroup PJSIP_MSG_HDR_MIN_EXPIRES Header Field: Min-Expires 
    1536  * @brief Min-Expires header field. 
    1537  * @ingroup PJSIP_MSG 
    1538  * @{ 
     1430 
     1431/////////////////////////////////////////////////////////////////////////////// 
     1432/** 
     1433 * Min-Expires header. 
    15391434 */ 
    15401435typedef pjsip_generic_int_hdr pjsip_min_expires_hdr; 
     
    15711466                                                            int value ); 
    15721467 
    1573 /** 
    1574  * @} 
    1575  */ 
    1576  
    1577  
    1578 /////////////////////////////////////////////////////////////////////////////// 
    1579 /** 
    1580  * @defgroup PJSIP_MSG_HDR_ROUTING Header Field: Record-Route/Route 
    1581  * @brief Record-Route and Route header fields. 
    1582  * @ingroup PJSIP_MSG 
    1583  * @{ 
    1584  */ 
     1468 
     1469/////////////////////////////////////////////////////////////////////////////// 
    15851470/** 
    15861471 * Record-Route and Route headers. 
     
    15901475    PJSIP_DECL_HDR_MEMBER(struct pjsip_routing_hdr);  /**< Generic header fields. */ 
    15911476    pjsip_name_addr  name_addr;   /**< The URL in the Route/Record-Route header. */ 
    1592     pjsip_param      other_param; /** Other parameter. */ 
     1477    pjsip_param      other_param; /**< Other parameter. */ 
    15931478} pjsip_routing_hdr; 
    15941479 
     
    16661551PJ_DECL(pjsip_route_hdr*)   pjsip_routing_hdr_set_route( pjsip_routing_hdr *r ); 
    16671552 
    1668 /** 
    1669  * @} 
    1670  */ 
    1671  
    1672 /////////////////////////////////////////////////////////////////////////////// 
    1673 /** 
    1674  * @defgroup PJSIP_MSG_HDR_REQUIRE Header Field: Require 
    1675  * @brief Require header field. 
    1676  * @ingroup PJSIP_MSG 
    1677  * @{ 
     1553/////////////////////////////////////////////////////////////////////////////// 
     1554/** 
     1555 * Require header. 
    16781556 */ 
    16791557typedef pjsip_generic_array_hdr pjsip_require_hdr; 
     
    17051583                                                    void *mem ); 
    17061584 
    1707 /** 
    1708  * @} 
    1709  */ 
    1710  
    1711  
    1712 /////////////////////////////////////////////////////////////////////////////// 
    1713 /** 
    1714  * @defgroup PJSIP_MSG_HDR_RETRY_AFTER Header Field: Retry-After 
    1715  * @brief Retry-After header field. 
    1716  * @ingroup PJSIP_MSG 
    1717  * @{ 
     1585 
     1586/////////////////////////////////////////////////////////////////////////////// 
     1587/** 
     1588 * Retry-After header. 
    17181589 */ 
    17191590typedef pjsip_generic_int_hdr pjsip_retry_after_hdr; 
     
    17451616 
    17461617 
    1747 /** 
    1748  * @} 
    1749  */ 
    1750  
    1751 /////////////////////////////////////////////////////////////////////////////// 
    1752 /** 
    1753  * @defgroup PJSIP_MSG_HDR_SUPPORTED Header Field: Supported 
    1754  * @brief Supported header field. 
    1755  * @ingroup PJSIP_MSG 
    1756  * @{ 
     1618/////////////////////////////////////////////////////////////////////////////// 
     1619/** 
     1620 * Supported header. 
    17571621 */ 
    17581622typedef pjsip_generic_array_hdr pjsip_supported_hdr; 
     
    17791643                                                        void *mem ); 
    17801644 
    1781 /** 
    1782  * @} 
    1783  */ 
    1784  
    1785 /////////////////////////////////////////////////////////////////////////////// 
    1786 /** 
    1787  * @defgroup PJSIP_MSG_HDR_UNSUPPORTED Header Field: Unsupported 
    1788  * @brief Unsupported header field. 
    1789  * @ingroup PJSIP_MSG 
    1790  * @{ 
     1645/////////////////////////////////////////////////////////////////////////////// 
     1646/** 
     1647 * Unsupported header. 
    17911648 */ 
    17921649typedef pjsip_generic_array_hdr pjsip_unsupported_hdr; 
     
    18131670                                                            void *mem ); 
    18141671 
    1815 /** 
    1816  * @} 
    1817  */ 
    1818  
    1819  
    1820 /////////////////////////////////////////////////////////////////////////////// 
    1821 /** 
    1822  * @defgroup PJSIP_MSG_HDR_VIA Header Field: Via 
    1823  * @brief Via header field. 
    1824  * @ingroup PJSIP_MSG 
    1825  * @{ 
    1826  */ 
     1672/////////////////////////////////////////////////////////////////////////////// 
    18271673/** 
    18281674 * SIP Via header. 
     
    18661712                                            void *mem ); 
    18671713 
    1868 /** 
    1869  * @} 
    1870  */ 
    1871  
    1872  
    1873 /////////////////////////////////////////////////////////////////////////////// 
    1874 /** 
    1875  * @defgroup PJSIP_MSG_HDR_WARNING Header Field: Warning 
    1876  * @brief Warning header field. 
    1877  * @ingroup PJSIP_MSG 
    1878  * @{ 
    1879  */ 
     1714/////////////////////////////////////////////////////////////////////////////// 
    18801715/** 
    18811716 * SIP Warning header. 
     
    19181753                                      pj_status_t status); 
    19191754 
    1920 /** 
    1921  * @} 
    1922  */ 
    1923  
    1924 /** 
    1925  * @bug Once a header is put in the message, the header CAN NOT be put in 
    1926  *      other list. Solution: 
    1927  *      - always clone header in the message. 
    1928  *      - create a list node for each header in the message. 
    1929  */ 
    1930  
    1931  
    1932 /////////////////////////////////////////////////////////////////////////////// 
    1933 /** 
    1934  * @defgroup PJSIP_MSG_HDR_UNIMP Unimplemented Header Fields 
    1935  * @brief Unimplemented header fields. 
    1936  * @ingroup PJSIP_MSG 
    1937  * @{ 
    1938  */ 
     1755/////////////////////////////////////////////////////////////////////////////// 
    19391756/** Accept-Encoding header. */ 
    19401757typedef pjsip_generic_string_hdr pjsip_accept_encoding_hdr; 
  • pjproject/trunk/pjsip/include/pjsip/sip_parser.h

    r82 r515  
    3232 
    3333/** 
    34  * @defgroup PJSIP_PARSER SIP Message Parser 
    35  * @ingroup PJSIP 
     34 * @defgroup PJSIP_PARSER Parser 
     35 * @ingroup PJSIP_MSG 
     36 * @brief Message and message elements parsing. 
    3637 * @{ 
    3738 */ 
     
    6768typedef struct pjsip_parser_err_report 
    6869{ 
     70    /** Standard header fields. */ 
    6971    PJ_DECL_LIST_MEMBER(struct pjsip_parser_err_report); 
    7072    int         except_code;    /**< Error exception (e.g. PJSIP_SYN_ERR_EXCEPTION) */ 
     
    135137 * @param hname         The header name registered. 
    136138 * @param hshortname    The short header name registered, or NULL. 
     139 * @param fptr          Previously registered function to parse the header. 
    137140 * 
    138141 * @return              zero if unregistration was successfull. 
     
    186189PJ_DECL(pjsip_uri*) pjsip_parse_uri( pj_pool_t *pool,  
    187190                                     char *buf, pj_size_t size, 
    188                                      unsigned option); 
     191                                     unsigned options); 
    189192 
    190193/** 
     
    238241 * @param buf           The input buffer, which must be NULL terminated. 
    239242 * @param size          The buffer size. 
     243 * @param is_datagram   Put non-zero if transport is datagram oriented. 
    240244 * @param msg_size      [out] If message is valid, this parameter will contain 
    241245 *                      the size of the SIP message (including body, if any). 
     
    279283 * however is optional for the last header. 
    280284 * 
    281  * @param pool the pool. 
    282  * @param buf the input text to parse. 
    283  * @param size the text length. 
    284  * @param hlist the header list to store the parsed headers. This list must 
    285  *              have been initialized before calling this function. 
    286  * @return zero if successfull, or -1 if error is encountered. Upon error, 
    287  *              the \a hlist argument MAY contain successfully parsed headers. 
     285 * @param pool          the pool. 
     286 * @param input         the input text to parse. 
     287 * @param size          the text length. 
     288 * @param hlist         the header list to store the parsed headers.  
     289 *                      This list must have been initialized before calling  
     290 *                      this function. 
     291 * @return              zero if successfull, or -1 if error is encountered.  
     292 *                      Upon error, the \a hlist argument MAY contain  
     293 *                      successfully parsed headers. 
    288294 */ 
    289295PJ_DECL(pj_status_t) pjsip_parse_headers( pj_pool_t *pool, 
    290296                                          char *input, pj_size_t size, 
    291297                                          pj_list *hlist ); 
     298 
     299 
     300/** 
     301 * @} 
     302 */ 
    292303 
    293304 
     
    317328 * Various string constants. 
    318329 */ 
    319 extern const pj_str_t pjsip_USER_STR, 
    320                       pjsip_METHOD_STR, 
    321                       pjsip_TRANSPORT_STR, 
    322                       pjsip_MADDR_STR, 
    323                       pjsip_LR_STR, 
    324                       pjsip_SIP_STR, 
    325                       pjsip_SIPS_STR, 
    326                       pjsip_TEL_STR, 
    327                       pjsip_BRANCH_STR, 
    328                       pjsip_TTL_STR, 
    329                       pjsip_PNAME_STR, 
    330                       pjsip_Q_STR, 
    331                       pjsip_EXPIRES_STR, 
    332                       pjsip_TAG_STR; 
     330extern const pj_str_t pjsip_USER_STR,       /**< "user" string constant.    */ 
     331                      pjsip_METHOD_STR,     /**< "method" string constant   */ 
     332                      pjsip_TRANSPORT_STR,  /**< "transport" string const.  */ 
     333                      pjsip_MADDR_STR,      /**< "maddr" string const.      */ 
     334                      pjsip_LR_STR,         /**< "lr" string const.         */ 
     335                      pjsip_SIP_STR,        /**< "sip" string constant.     */ 
     336                      pjsip_SIPS_STR,       /**< "sips" string constant.    */ 
     337                      pjsip_TEL_STR,        /**< "tel" string constant.     */ 
     338                      pjsip_BRANCH_STR,     /**< "branch" string constant.  */ 
     339                      pjsip_TTL_STR,        /**< "ttl" string constant.     */ 
     340                      pjsip_RECEIVED_STR,   /**< "received" string const.   */ 
     341                      pjsip_Q_STR,          /**< "q" string constant.       */ 
     342                      pjsip_EXPIRES_STR,    /**< "expires" string constant. */ 
     343                      pjsip_TAG_STR,        /**< "tag" string constant.     */ 
     344                      pjsip_RPORT_STR;      /**< "rport" string const.      */ 
     345 
    333346 
    334347/* 
     
    347360void pjsip_parse_end_hdr_imp ( pj_scanner *scanner ); 
    348361 
    349 /** 
    350  * @} 
    351  */ 
    352  
    353362PJ_END_DECL 
    354363 
  • pjproject/trunk/pjsip/include/pjsip/sip_private.h

    r65 r515  
    2727#include <pjsip/sip_types.h> 
    2828 
    29 PJ_BEGIN_DECL 
    30  
    31 /** 
    32  * @defgroup PJSIP_PRIVATE Private structures and functions (PJSIP internals) 
    33  * @ingroup PJSIP 
    34  * @{ 
    35  */ 
    36  
    37  
    38  
    39 /**  
    40  * @} 
    41  */ 
    42  
    43 PJ_END_DECL 
    4429 
    4530#endif /* __PJSIP_PRIVATE_I_H__ */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_resolve.h

    r105 r515  
    3333 
    3434/** 
    35  * @defgroup PJSIP_RESOLVE SIP Server Resolver 
    36  * @ingroup PJSIP 
     35 * @defgroup PJSIP_RESOLVE Server Resolution 
     36 * @ingroup PJSIP_TRANSPORT 
     37 * @brief Framework to resolve SIP servers based on RFC 3263. 
    3738 * @{ 
     39 * This is the server resolution framework, which is modelled after  
     40 * RFC 3263 - Locating SIP Servers document. The server resolution 
     41 * framework is asynchronous; callback will be called once the server  
     42 * address has been resolved (successfully or with errors). 
    3843 */ 
    3944 
     
    4348#define PJSIP_MAX_RESOLVED_ADDRESSES    8 
    4449 
    45 typedef struct pjsip_server_addresses pjsip_server_addresses; 
    46  
    4750/** 
    4851 * The server addresses returned by the resolver. 
    4952 */ 
    50 struct pjsip_server_addresses 
     53typedef struct pjsip_server_addresses 
    5154{ 
    5255    /** Number of address records. */ 
     
    6770    } entry[PJSIP_MAX_RESOLVED_ADDRESSES]; 
    6871 
    69 }; 
     72} pjsip_server_addresses; 
     73 
    7074 
    7175/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_tel_uri.h

    r82 r515  
    2626 
    2727#include <pjsip/sip_uri.h> 
     28 
     29/** 
     30 * @addtogroup PJSIP_TEL_URI tel URI Scheme 
     31 * @ingroup PJSIP_URI 
     32 * @brief Support for "tel:" URI scheme. 
     33 * @{ 
     34 */ 
    2835 
    2936 
     
    6976 
    7077 
     78/** 
     79 * @} 
     80 */ 
     81 
     82 
    7183#endif  /* __PJSIP_TEL_URI_H__ */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    r500 r515  
    3232 
    3333/** 
    34  * @defgroup PJSIP_TRANSACT SIP Transaction 
     34 * @defgroup PJSIP_TRANSACT Transaction Layer 
    3535 * @ingroup PJSIP 
     36 * @brief Provides statefull message processing. 
     37 * 
     38 * This module provides stateful processing to incoming or outgoing SIP 
     39 * messages.  
     40 * Before performing any stateful operations, application must register the 
     41 * transaction layer module by calling #pjsip_tsx_layer_init_module(). 
     42 * 
     43 * Application should link with <b>pjsip-core</b> library to 
     44 * use the transaction layer. 
     45 */ 
     46 
     47/** 
     48 * @defgroup PJSIP_TRANSACT_TRANSACTION Transaction 
     49 * @ingroup PJSIP_TRANSACT 
     50 * @brief Transaction instance for all types of SIP transactions. 
    3651 * @{ 
     52 * The pjsip_transaction describes SIP transaction, and is used for 
     53 * both INVITE and non-INVITE, UAC or UAS. Application must register the 
     54 * transaction layer module with #pjsip_tsx_layer_init_module() before 
     55 * performing any stateful operations. 
    3756 */ 
    3857 
     
    258277 */ 
    259278PJ_DECL(pj_status_t) pjsip_tsx_terminate( pjsip_transaction *tsx, 
    260                                           int st_code ); 
     279                                          int code ); 
    261280 
    262281 
  • pjproject/trunk/pjsip/include/pjsip/sip_transport.h

    r252 r515  
    3535 
    3636/** 
    37  * @defgroup PJSIP_TRANSPORT SIP Transport 
    38  * @ingroup PJSIP 
    39  * 
    40  * This is the low-level transport layer. Application normally won't need to  
    41  * use this function, but instead can use transaction or higher layer API to 
    42  * send and receive messages. 
     37 * @defgroup PJSIP_TRANSPORT Transport 
     38 * @ingroup PJSIP_CORE 
     39 * @brief This is the transport framework. 
     40 * 
     41 * The transport framework is fully extensible. Please see 
     42 * <A HREF="/docs.htm">PJSIP Developer's Guide</A> PDF 
     43 * document for more information. 
     44 * 
     45 * Application MUST register at least one transport to PJSIP before any 
     46 * messages can be sent or received. Please see @ref PJSIP_TRANSPORT_UDP 
     47 * on how to create/register UDP transport to the transport framework. 
    4348 * 
    4449 * @{ 
     
    138143typedef struct pjsip_rx_data_op_key 
    139144{ 
    140     pj_ioqueue_op_key_t         op_key; 
    141     pjsip_rx_data              *rdata; 
     145    pj_ioqueue_op_key_t         op_key; /**< ioqueue op_key.            */ 
     146    pjsip_rx_data              *rdata;  /**< rdata associated with this */ 
    142147} pjsip_rx_data_op_key; 
    143148 
     
    304309typedef struct pjsip_tx_data_op_key 
    305310{ 
     311    /** ioqueue pending operation key. */ 
    306312    pj_ioqueue_op_key_t     key; 
     313 
     314    /** Transmit data associated with this key. */ 
    307315    pjsip_tx_data          *tdata; 
     316 
     317    /** Arbitrary token (attached by transport) */ 
    308318    void                   *token; 
     319 
     320    /** Callback to be called when pending transmit operation has 
     321        completed. 
     322     */ 
    309323    void                  (*callback)(pjsip_transport*,void*,pj_ssize_t); 
    310324} pjsip_tx_data_op_key; 
     
    377391    /** Transport manager internal. */ 
    378392    void                *token; 
     393 
     394    /** Callback to be called when this tx_data has been transmitted.   */ 
    379395    void               (*cb)(void*, pjsip_tx_data*, pj_ssize_t); 
    380396 
     
    593609struct pjsip_tpfactory 
    594610{ 
    595     /* This list is managed by transport manager. */ 
     611    /** This list is managed by transport manager. */ 
    596612    PJ_DECL_LIST_MEMBER(struct pjsip_tpfactory); 
    597613 
    598     pj_pool_t              *pool; 
    599     pj_lock_t              *lock; 
    600  
    601     pjsip_transport_type_e  type; 
    602     char                    type_name[8]; 
    603     unsigned                flag; 
    604  
    605     pj_sockaddr             local_addr; 
    606     pjsip_host_port         addr_name; 
     614    pj_pool_t              *pool;           /**< Owned memory pool.     */ 
     615    pj_lock_t              *lock;           /**< Lock object.           */ 
     616 
     617    pjsip_transport_type_e  type;           /**< Transport type.        */ 
     618    char                    type_name[8];   /**< Type string name.      */ 
     619    unsigned                flag;           /**< Transport flag.        */ 
     620 
     621    pj_sockaddr             local_addr;     /**< Bound address.         */ 
     622    pjsip_host_port         addr_name;      /**< Published name.        */ 
    607623 
    608624    /** 
     
    629645 * 
    630646 * @param mgr           The transport manager. 
    631  * @param factory       Transport factory. 
     647 * @param tpf           Transport factory. 
    632648 * 
    633649 * @return              PJ_SUCCESS if listener was successfully created. 
     
    638654/** 
    639655 * Unregister factory. 
     656 * 
     657 * @param mgr           The transport manager. 
     658 * @param tpf           Transport factory. 
     659 * 
     660 * @return              PJ_SUCCESS is sucessfully unregistered. 
    640661 */ 
    641662PJ_DECL(pj_status_t) pjsip_tpmgr_unregister_tpfactory(pjsip_tpmgr *mgr, 
  • pjproject/trunk/pjsip/include/pjsip/sip_transport_loop.h

    r109 r515  
    2020#define __PJSIP_TRANSPORT_LOOP_H__ 
    2121 
     22 
     23/** 
     24 * @file sip_transport_loop.h 
     25 * @brief  
     26 * Loopback transport (for debugging) 
     27 */ 
     28 
     29 
    2230#include <pjsip/sip_transport.h> 
     31 
     32/** 
     33 * @defgroup PJSIP_TRANSPORT_LOOP Loop Transport 
     34 * @ingroup PJSIP_TRANSPORT 
     35 * @brief Loopback transport (for testing purposes). 
     36 * @{ 
     37 * The loopback transport simply bounce back outgoing messages as 
     38 * incoming messages. This feature is used mostly during automated 
     39 * testing, to provide controlled behavior. 
     40 */ 
    2341 
    2442PJ_BEGIN_DECL 
     
    121139PJ_END_DECL 
    122140 
     141/** 
     142 * @} 
     143 */ 
    123144 
    124145#endif  /* __PJSIP_TRANSPORT_LOOP_H__ */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_transport_udp.h

    r107 r515  
    1 /* $Id: $ */ 
     1/* $Id$ */ 
    22/*  
    33 * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org> 
     
    2020#define __PJSIP_TRANSPORT_UDP_H__ 
    2121 
     22/** 
     23 * @file sip_transport_udp.h 
     24 * @brief SIP UDP Transport. 
     25 */ 
     26 
    2227#include <pjsip/sip_transport.h> 
    2328 
    2429PJ_BEGIN_DECL 
     30 
     31/** 
     32 * @defgroup PJSIP_TRANSPORT_UDP UDP transport 
     33 * @ingroup PJSIP_TRANSPORT 
     34 * @brief API to create and register UDP transport. 
     35 * @{ 
     36 * The functions below are used to create UDP transport and register  
     37 * the transport to the framework. 
     38 */ 
    2539 
    2640/** 
     
    6882PJ_END_DECL 
    6983 
     84/** 
     85 * @} 
     86 */ 
    7087 
    7188#endif  /* __PJSIP_TRANSPORT_UDP_H__ */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_types.h

    r197 r515  
    2020#define __PJSIP_SIP_TYPES_H__ 
    2121 
     22 
     23/* 
     24 * My note: Doxygen PJSIP and PJSIP_CORE group is declared in 
     25 *          sip_config.h 
     26 */ 
     27 
     28/** 
     29 * @file sip_types.h 
     30 * @brief Basic PJSIP types. 
     31 */ 
     32 
    2233#include <pjsip/sip_config.h> 
    2334#include <pj/types.h> 
    2435 
    2536/** 
    26  * Opaque data structure for transports (sip_transport.h). 
     37 * @addtogroup PJSIP_BASE 
     38 */ 
     39 
     40/* @defgroup PJSIP_TYPES Basic Data Types 
     41 * @ingroup PJSIP_BASE 
     42 * @brief Basic data types. 
     43 * @{ 
     44 */ 
     45 
     46 
     47 
     48/** 
     49 * Forward declaration for SIP transport. 
    2750 */ 
    2851typedef struct pjsip_transport pjsip_transport; 
    2952 
    3053/** 
    31  * Opaque data type for transport manager (sip_transport.h). 
     54 * Forward declaration for transport manager. 
    3255 */ 
    3356typedef struct pjsip_tpmgr pjsip_tpmgr; 
     
    218241#define PJSIP_THROW_SPEC(list) 
    219242 
     243 
     244/** 
     245 * @} 
     246 */ 
     247 
    220248#endif  /* __PJSIP_SIP_TYPES_H__ */ 
    221249 
  • pjproject/trunk/pjsip/include/pjsip/sip_ua_layer.h

    r253 r515  
    3030 
    3131/** 
    32  * @defgroup PJSUA SIP User Agent Stack 
     32 * @defgroup PJSIP_UA Base User Agent Layer/Common Dialog Layer 
     33 * @ingroup PJSIP 
     34 * @brief Dialog management. 
     35 * 
     36 * This module provides basic dialog management, which is used by higher 
     37 * layer dialog usages such as INVITE sessions and SIP Event Subscription 
     38 * framework (RFC 3265). Application should link  with <b>pjsip-core</b>  
     39 * library to use this base UA layer. The base UA layer module is initialized 
     40 * with #pjsip_ua_init_module(). 
    3341 */ 
    3442 
    3543/** 
    3644 * @defgroup PJSUA_UA SIP User Agent Module 
    37  * @ingroup PJSUA 
     45 * @ingroup PJSIP_UA 
     46 * @brief Provides dialog management. 
    3847 * @{ 
    39  * \brief 
    40  *   User Agent manages the interactions between application and SIP dialogs. 
     48 * 
     49 * Application MUST initialize the user agent layer module by calling 
     50 * #pjsip_ua_init_module() before using any of the dialog API, and link 
     51 * the application with with <b>pjsip-core</b> library. 
    4152 */ 
    4253 
     
    4455typedef struct pjsip_ua_init_param 
    4556{ 
     57    /** Callback to be called when the UA layer detects that outgoing 
     58     *  dialog has forked. 
     59     */ 
    4660    pjsip_dialog* (*on_dlg_forked)(pjsip_dialog *first_set, pjsip_rx_data *res); 
    4761} pjsip_ua_init_param; 
     
    91105 
    92106 
     107/** 
     108 * @} 
     109 */ 
     110 
     111 
    93112/* 
    94113 * Internal (called by sip_dialog.c). 
     
    101120 
    102121 
    103 /** 
    104  * @} 
    105  */ 
    106  
    107122PJ_END_DECL 
    108123 
  • pjproject/trunk/pjsip/include/pjsip/sip_uri.h

    r127 r515  
    3434 
    3535/** 
    36  * @defgroup PJSIP_URL URL Structures 
    37  * @brief SIP Url, tel: Url, and generic URI. 
     36 * @defgroup PJSIP_URI URI 
     37 * @brief URI types and manipulations. 
    3838 * @ingroup PJSIP_MSG 
     39 */ 
     40 
     41/** 
     42 * @addtogroup PJSIP_URI_PARAM URI Parameter Container 
     43 * @ingroup PJSIP_URI 
     44 * @brief Generic parameter elements container. 
    3945 * @{ 
    4046 */ 
     
    118124                                         const pj_cis_t *pvalue_unres, 
    119125                                         int sep); 
     126 
     127/** 
     128 * @} 
     129 */ 
     130 
     131/** 
     132 * @defgroup PJSIP_URI_GENERIC Generic URI 
     133 * @ingroup PJSIP_URI 
     134 * @brief Generic representation for all types of URI. 
     135 * @{ 
     136 */ 
    120137 
    121138/** 
     
    220237#define PJSIP_URI_SCHEME_IS_TEL(url)    \ 
    221238    (pj_strnicmp2(pjsip_uri_get_scheme(url), "tel", 3)==0) 
     239 
     240 
     241/** 
     242 * Generic function to get the URI scheme. 
     243 * @param uri       the URI object. 
     244 * @return          the URI scheme. 
     245 */ 
     246PJ_INLINE(const pj_str_t*) pjsip_uri_get_scheme(const void *uri) 
     247{ 
     248    return (*((pjsip_uri*)uri)->vptr->p_get_scheme)(uri); 
     249} 
     250 
     251/** 
     252 * Generic function to get the URI object contained by this URI, or the URI  
     253 * itself if it doesn't contain another URI. 
     254 * 
     255 * @param uri       the URI. 
     256 * @return          the URI. 
     257 */ 
     258PJ_INLINE(void*) pjsip_uri_get_uri(void *uri) 
     259{ 
     260    return (*((pjsip_uri*)uri)->vptr->p_get_uri)(uri); 
     261} 
     262 
     263/** 
     264 * Generic function to compare two URIs. 
     265 * 
     266 * @param context   Comparison context. 
     267 * @param uri1      The first URI. 
     268 * @param uri2      The second URI. 
     269 * @return          PJ_SUCCESS if equal, or otherwise the error status which 
     270 *                  should point to the mismatch part. 
     271 */ 
     272PJ_INLINE(pj_status_t) pjsip_uri_cmp(pjsip_uri_context_e context,  
     273                                     const void *uri1, const void *uri2) 
     274{ 
     275    return (*((const pjsip_uri*)uri1)->vptr->p_compare)(context, uri1, uri2); 
     276} 
     277 
     278/** 
     279 * Generic function to print an URI object. 
     280 * 
     281 * @param context   Print context. 
     282 * @param uri       The URI to print. 
     283 * @param buf       The buffer. 
     284 * @param size      Size of the buffer. 
     285 * @return          Length printed. 
     286 */ 
     287PJ_INLINE(int) pjsip_uri_print(pjsip_uri_context_e context, 
     288                               const void *uri, 
     289                               char *buf, pj_size_t size) 
     290{ 
     291    return (*((const pjsip_uri*)uri)->vptr->p_print)(context, uri, buf, size); 
     292} 
     293 
     294/** 
     295 * Generic function to clone an URI object. 
     296 * 
     297 * @param pool      Pool. 
     298 * @param uri       URI to clone. 
     299 * @return          New URI. 
     300 */ 
     301PJ_INLINE(void*) pjsip_uri_clone( pj_pool_t *pool, const void *uri ) 
     302{ 
     303    return (*((const pjsip_uri*)uri)->vptr->p_clone)(pool, uri); 
     304} 
     305 
     306 
     307 
     308/** 
     309 * @} 
     310 */ 
     311 
     312/** 
     313 * @defgroup PJSIP_SIP_URI SIP URI Scheme and Name address 
     314 * @ingroup PJSIP_URI 
     315 * @brief SIP URL structure ("sip:" and "sips:") 
     316 * @{ 
     317 */ 
    222318 
    223319 
     
    262358 
    263359/** 
    264  * Generic function to get the URI scheme. 
    265  * @param uri       the URI object. 
    266  * @return          the URI scheme. 
    267  */ 
    268 PJ_INLINE(const pj_str_t*) pjsip_uri_get_scheme(const void *uri) 
    269 { 
    270     return (*((pjsip_uri*)uri)->vptr->p_get_scheme)(uri); 
    271 } 
    272  
    273 /** 
    274  * Generic function to get the URI object contained by this URI, or the URI  
    275  * itself if it doesn't contain another URI. 
    276  * 
    277  * @param uri       the URI. 
    278  * @return          the URI. 
    279  */ 
    280 PJ_INLINE(void*) pjsip_uri_get_uri(void *uri) 
    281 { 
    282     return (*((pjsip_uri*)uri)->vptr->p_get_uri)(uri); 
    283 } 
    284  
    285 /** 
    286  * Generic function to compare two URIs. 
    287  * 
    288  * @param context   Comparison context. 
    289  * @param uri1      The first URI. 
    290  * @param uri2      The second URI. 
    291  * @return          PJ_SUCCESS if equal, or otherwise the error status which 
    292  *                  should point to the mismatch part. 
    293  */ 
    294 PJ_INLINE(pj_status_t) pjsip_uri_cmp(pjsip_uri_context_e context,  
    295                                      const void *uri1, const void *uri2) 
    296 { 
    297     return (*((const pjsip_uri*)uri1)->vptr->p_compare)(context, uri1, uri2); 
    298 } 
    299  
    300 /** 
    301  * Generic function to print an URI object. 
    302  * 
    303  * @param context   Print context. 
    304  * @param uri       The URI to print. 
    305  * @param buf       The buffer. 
    306  * @param size      Size of the buffer. 
    307  * @return          Length printed. 
    308  */ 
    309 PJ_INLINE(int) pjsip_uri_print(pjsip_uri_context_e context, 
    310                                const void *uri, 
    311                                char *buf, pj_size_t size) 
    312 { 
    313     return (*((const pjsip_uri*)uri)->vptr->p_print)(context, uri, buf, size); 
    314 } 
    315  
    316 /** 
    317  * Generic function to clone an URI object. 
    318  * 
    319  * @param pool      Pool. 
    320  * @param uri       URI to clone. 
    321  * @return          New URI. 
    322  */ 
    323 PJ_INLINE(void*) pjsip_uri_clone( pj_pool_t *pool, const void *uri ) 
    324 { 
    325     return (*((const pjsip_uri*)uri)->vptr->p_clone)(pool, uri); 
    326 } 
    327  
    328  
    329 /** 
    330360 * Create new SIP URL and initialize all fields with zero or NULL. 
    331361 * @param pool      The pool. 
     
    345375 * Initialize SIP URL (all fields are set to NULL or zero). 
    346376 * @param url       The URL. 
     377 * @param secure    Create sips URI? 
    347378 */ 
    348379PJ_DECL(void)  pjsip_sip_uri_init(pjsip_sip_uri *url, int secure); 
  • pjproject/trunk/pjsip/include/pjsip/sip_util.h

    r134 r515  
    2626 
    2727/** 
    28  * @defgroup PJSIP_ENDPT SIP Endpoint 
    29  * @ingroup PJSIP 
     28 * @defgroup PJSIP_ENDPT_STATELESS Message Creation and Stateless Operations 
     29 * @ingroup PJSIP_CORE_CORE 
     30 * @brief Utilities to create various messages and base function to send messages. 
    3031 * @{ 
    3132 */ 
     
    239240 * @param endpt     The endpoint instance. 
    240241 * @param tdata     The transmit data to be sent. 
     242 * @param token     Arbitrary token to be given back on the callback. 
     243 * @param cb        Optional callback to notify transmission status (also 
     244 *                  gives chance for application to discontinue retrying 
     245 *                  sending to alternate address). 
    241246 * 
    242247 * @return          PJ_SUCCESS, or the appropriate error code. 
     
    350355                                                   const pjsip_msg_body *body); 
    351356                                                     
     357/** 
     358 * @} 
     359 */ 
     360 
     361/** 
     362 * @defgroup PJSIP_TRANSACT_UTIL Stateful Operations 
     363 * @ingroup PJSIP_TRANSACT 
     364 * @brief Utility function to send requests/responses statefully. 
     365 * @{ 
     366 */ 
    352367 
    353368/** 
  • pjproject/trunk/pjsip/include/pjsip_simple.h

    r268 r515  
    1919 
    2020/** 
    21  * @defgroup PJSIP_SIMPLE SIP Event, Instant Messaging and Presence Extension (SIMPLE) 
     21 * @defgroup PJSIP_SIMPLE Event and Presence Framework 
     22 * @ingroup PJSIP 
    2223 */ 
    2324 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r503 r515  
    2020#define __PJSUA_H__ 
    2121 
     22/** 
     23 * @file pjsua.h 
     24 * @brief PJSUA API. 
     25 */ 
     26 
     27 
    2228/* Include all PJSIP core headers. */ 
    2329#include <pjsip.h> 
     
    4248 
    4349 
     50/** 
     51 * @defgroup PJSUA_LIB PJSUA API 
     52 * @ingroup PJSIP 
     53 * @brief Very high level API for constructing SIP UA applications. 
     54 * @{ 
     55 * 
     56 * PJSUA API is very high level API for constructing SIP user agent 
     57 * applications. It wraps together the signaling and media functionalities 
     58 * into an easy to use call API, provides account management, buddy 
     59 * management, presence, instant messaging, along with multimedia 
     60 * features such as conferencing, file streaming, local playback, 
     61 * voice recording, and so on. 
     62 * 
     63 * Application must link with <b>pjsua-lib</b> to use this API. In addition, 
     64 * this library depends on the following libraries: 
     65 *  - <b>pjsip-ua</b>,  
     66 *  - <b>pjsip-simple</b>,  
     67 *  - <b>pjsip-core</b>,  
     68 *  - <b>pjmedia</b>, 
     69 *  - <b>pjmedia-codec</b>,  
     70 *  - <b>pjlib-util</b>, and 
     71 *  - <b>pjlib</b>,  
     72 * 
     73 * so application must also link with these libraries as well. 
     74 * 
     75 * @section root_using_pjsua_lib Using PJSUA API 
     76 * 
     77 * Please refer to @ref using_pjsua_lib on how to use PJSUA API. 
     78 */  
     79 
    4480PJ_BEGIN_DECL 
    4581 
    4682 
    47 /** 
    48  * Max buddies in buddy list. 
    49  */ 
    50 #ifndef PJSUA_MAX_BUDDIES 
    51 #   define PJSUA_MAX_BUDDIES        256 
    52 #endif 
    53  
    54  
    55 /** 
    56  * Max simultaneous calls. 
    57  */ 
    58 #ifndef PJSUA_MAX_CALLS 
    59 #   define PJSUA_MAX_CALLS          32 
    60 #endif 
    61  
    62  
    63 /** 
    64  * Max ports in the conference bridge. 
    65  */ 
    66 #ifndef PJSUA_MAX_CONF_PORTS 
    67 #   define PJSUA_MAX_CONF_PORTS     254 
    68 #endif 
    69  
    70  
    71 /** 
    72  * Maximum accounts. 
    73  */ 
    74 #ifndef PJSUA_MAX_ACC 
    75 #   define PJSUA_MAX_ACC            8 
    76 #endif 
     83/** Forward declaration */ 
     84typedef struct pjsua_media_config pjsua_media_config; 
     85 
     86 
     87/***************************************************************************** 
     88 * BASE API 
     89 */ 
     90 
     91/** 
     92 * @defgroup PJSUA_LIB_BASE Base API 
     93 * @ingroup PJSUA_LIB 
     94 * @brief Basic application creation/initialization, logging configuration, etc. 
     95 * @{ 
     96 * 
     97 * The base PJSUA API controls PJSUA creation, initialization, and startup, and 
     98 * also provides various auxiliary functions. 
     99 * 
     100 * @section using_pjsua_lib Using PJSUA Library 
     101 * 
     102 * @subsection creating_pjsua_lib Creating PJSUA 
     103 * 
     104 * Before anything else, application must create PJSUA by calling #pjsua_create(). 
     105 * This, among other things, will initialize PJLIB, which is crucial before  
     106 * any PJLIB functions can be called. 
     107 * 
     108 * @subsection init_pjsua_lib Initializing PJSUA 
     109 * 
     110 * After PJSUA is created, application can initialize PJSUA by calling 
     111 * #pjsua_init(). This function takes several configuration settings in the 
     112 * argument, so application normally would want to set these configuration 
     113 * before passing them to #pjsua_init(). 
     114 * 
     115 * Sample code to initialize PJSUA: 
     116 \code 
     117 
     118    pjsua_config         ua_cfg; 
     119    pjsua_logging_config log_cfg; 
     120    pjsua_media_config   media_cfg; 
     121 
     122    // Initialize configs with default settings. 
     123    pjsua_config_default(&ua_cfg); 
     124    pjsua_logging_config_default(&log_cfg); 
     125    pjsua_media_config_default(&media_cfg); 
     126 
     127    // At the very least, application would want to override 
     128    // the call callbacks in pjsua_config: 
     129    ua_cfg.cb.on_incoming_call = ... 
     130    ua_cfg.cb.on_call_state = .. 
     131    ... 
     132 
     133    // Customize other settings (or initialize them from application specific 
     134    // configuration file): 
     135    ... 
     136 
     137    // Initialize pjsua 
     138    status = pjsua_init(&ua_cfg, &log_cfg, &media_cfg); 
     139    if (status != PJ_SUCCESS) { 
     140          pjsua_perror(THIS_FILE, "Error initializing pjsua", status); 
     141          return status; 
     142    } 
     143    .. 
     144 
     145 \endcode 
     146 * 
     147 * @subsection other_init_pjsua_lib Other Initialization 
     148 * 
     149 * After PJSUA is initialized with #pjsua_init(), application will normally 
     150 * need/want to perform the following tasks: 
     151 * 
     152 *  - create SIP transport with #pjsua_transport_create(). Please see 
     153 *    @ref PJSUA_LIB_TRANSPORT section for more info. 
     154 *  - create one or more SIP accounts with #pjsua_acc_add() or 
     155 *    #pjsua_acc_add_local(). Please see @ref PJSUA_LIB_ACC for more info. 
     156 *  - add one or more buddies with #pjsua_buddy_add(). Please see 
     157 *    @ref PJSUA_LIB_BUDDY section for more info. 
     158 *  - optionally configure the sound device, codec settings, and other 
     159 *    media settings. Please see @ref PJSUA_LIB_MEDIA for more info. 
     160 * 
     161 * 
     162 * @subsection starting_pjsua_lib Starting PJSUA 
     163 * 
     164 * After all initializations have been done, application must call 
     165 * #pjsua_start() to start PJSUA. This function will check that all settings 
     166 * are properly configured, and apply default settings when it's not, or 
     167 * report error status when it is unable to recover from missing setting. 
     168 * 
     169 * Most settings can be changed during run-time. For example, application 
     170 * may add, modify, or delete accounts, buddies, or change media settings 
     171 * during run-time. 
     172 */ 
     173 
     174/** Constant to identify invalid ID for all sorts of IDs. */ 
     175#define PJSUA_INVALID_ID            (-1) 
     176 
     177/** Call identification */ 
     178typedef int pjsua_call_id; 
     179 
     180/** Account identification */ 
     181typedef int pjsua_acc_id; 
     182 
     183/** Buddy identification */ 
     184typedef int pjsua_buddy_id; 
     185 
     186/** File player identification */ 
     187typedef int pjsua_player_id; 
     188 
     189/** File recorder identification */ 
     190typedef int pjsua_recorder_id; 
     191 
     192/** Conference port identification */ 
     193typedef int pjsua_conf_port_id; 
     194 
    77195 
    78196 
     
    83201#   define PJSUA_ACC_MAX_PROXIES    8 
    84202#endif 
    85  
    86 /** 
    87  * Default registration interval. 
    88  */ 
    89 #ifndef PJSUA_REG_INTERVAL 
    90 #   define PJSUA_REG_INTERVAL       55 
    91 #endif 
    92  
    93  
    94 /** Account identification */ 
    95 typedef int pjsua_acc_id; 
    96  
    97 /** Call identification */ 
    98 typedef int pjsua_call_id; 
    99  
    100 /** SIP transport identification */ 
    101 typedef int pjsua_transport_id; 
    102  
    103 /** Buddy identification */ 
    104 typedef int pjsua_buddy_id; 
    105  
    106 /** File player identification */ 
    107 typedef int pjsua_player_id; 
    108  
    109 /** File recorder identification */ 
    110 typedef int pjsua_recorder_id; 
    111  
    112 /** Conference port identification */ 
    113 typedef int pjsua_conf_port_id; 
    114  
    115  
    116 /** Constant to identify invalid ID for all sorts of IDs. */ 
    117 #define PJSUA_INVALID_ID            (-1) 
    118  
    119  
    120  
    121 /** 
    122  * Account configuration. 
    123  */ 
    124 typedef struct pjsua_acc_config 
    125 { 
    126     /**  
    127      * The full SIP URL for the account. The value can take name address or  
    128      * URL format, and will look something like "sip:account@serviceprovider". 
    129      * 
    130      * This field is mandatory. 
    131      */ 
    132     pj_str_t        id; 
    133  
    134     /**  
    135      * This is the URL to be put in the request URI for the registration, 
    136      * and will look something like "sip:serviceprovider". 
    137      * 
    138      * This field should be specified if registration is desired. If the 
    139      * value is empty, no account registration will be performed. 
    140      */ 
    141     pj_str_t        reg_uri; 
    142  
    143     /**  
    144      * Optional URI to be put as Contact for this account. It is recommended 
    145      * that this field is left empty, so that the value will be calculated 
    146      * automatically based on the transport address. 
    147      */ 
    148     pj_str_t        contact; 
    149  
    150     /** 
    151      * Number of proxies in the proxy array below. 
    152      */ 
    153     unsigned        proxy_cnt; 
    154  
    155     /**  
    156      * Optional URI of the proxies to be visited for all outgoing requests  
    157      * that are using this account (REGISTER, INVITE, etc). Application need  
    158      * to specify these proxies if the service provider requires that requests 
    159      * destined towards its network should go through certain proxies first 
    160      * (for example, border controllers). 
    161      * 
    162      * These proxies will be put in the route set for this account, with  
    163      * maintaining the orders (the first proxy in the array will be visited 
    164      * first). 
    165      */ 
    166     pj_str_t        proxy[PJSUA_ACC_MAX_PROXIES]; 
    167  
    168     /**  
    169      * Optional interval for registration, in seconds. If the value is zero,  
    170      * default interval will be used (PJSUA_REG_INTERVAL, 55 seconds). 
    171      */ 
    172     unsigned        reg_timeout; 
    173  
    174     /**  
    175      * Number of credentials in the credential array. 
    176      */ 
    177     unsigned        cred_count; 
    178  
    179     /**  
    180      * Array of credentials. If registration is desired, normally there should 
    181      * be at least one credential specified, to successfully authenticate 
    182      * against the service provider. More credentials can be specified, for 
    183      * example when the requests are expected to be challenged by the 
    184      * proxies in the route set. 
    185      */ 
    186     pjsip_cred_info cred_info[PJSUA_ACC_MAX_PROXIES]; 
    187  
    188 } pjsua_acc_config; 
    189  
    190  
    191 /** 
    192  * Call this function to initialize account config with default values. 
    193  * 
    194  * @param cfg       The account config to be initialized. 
    195  */ 
    196 PJ_INLINE(void) pjsua_acc_config_default(pjsua_acc_config *cfg) 
    197 { 
    198     pj_memset(cfg, 0, sizeof(*cfg)); 
    199  
    200     cfg->reg_timeout = PJSUA_REG_INTERVAL; 
    201 } 
    202  
    203  
    204  
    205 /** 
    206  * Account info. Application can query account info by calling  
    207  * #pjsua_acc_get_info(). 
    208  */ 
    209 typedef struct pjsua_acc_info 
    210 { 
    211     /**  
    212      * The account ID.  
    213      */ 
    214     pjsua_acc_id        id; 
    215  
    216     /** 
    217      * Flag to indicate whether this is the default account. 
    218      */ 
    219     pj_bool_t           is_default; 
    220  
    221     /**  
    222      * Account URI  
    223      */ 
    224     pj_str_t            acc_uri; 
    225  
    226     /**  
    227      * Flag to tell whether this account has registration setting 
    228      * (reg_uri is not empty). 
    229      */ 
    230     pj_bool_t           has_registration; 
    231  
    232     /** 
    233      * An up to date expiration interval for account registration session. 
    234      */ 
    235     int                 expires; 
    236  
    237     /** 
    238      * Last registration status code. If status code is zero, the account 
    239      * is currently not registered. Any other value indicates the SIP 
    240      * status code of the registration. 
    241      */ 
    242     pjsip_status_code   status; 
    243  
    244     /** 
    245      * String describing the registration status. 
    246      */ 
    247     pj_str_t            status_text; 
    248  
    249     /** 
    250      * Presence online status for this account. 
    251      */ 
    252     pj_bool_t           online_status; 
    253  
    254     /** 
    255      * Buffer that is used internally to store the status text. 
    256      */ 
    257     char                buf_[PJ_ERR_MSG_SIZE]; 
    258  
    259 } pjsua_acc_info; 
    260  
    261  
    262  
    263 /** 
    264  * STUN configuration. 
    265  */ 
    266 typedef struct pjsua_stun_config 
    267 { 
    268     /** 
    269      * The first STUN server IP address or hostname. 
    270      */ 
    271     pj_str_t    stun_srv1; 
    272  
    273     /** 
    274      * Port number of the first STUN server. 
    275      * If zero, default STUN port will be used. 
    276      */ 
    277     unsigned    stun_port1; 
    278      
    279     /** 
    280      * Optional second STUN server IP address or hostname, for which the 
    281      * result of the mapping request will be compared to. If the value 
    282      * is empty, only one STUN server will be used. 
    283      */ 
    284     pj_str_t    stun_srv2; 
    285  
    286     /** 
    287      * Port number of the second STUN server. 
    288      * If zero, default STUN port will be used. 
    289      */ 
    290     unsigned    stun_port2; 
    291  
    292 } pjsua_stun_config; 
    293  
    294  
    295  
    296 /** 
    297  * Call this function to initialize STUN config with default values. 
    298  * 
    299  * @param cfg       The STUN config to be initialized. 
    300  */ 
    301 PJ_INLINE(void) pjsua_stun_config_default(pjsua_stun_config *cfg) 
    302 { 
    303     pj_memset(cfg, 0, sizeof(*cfg)); 
    304 } 
    305  
    306  
    307 /** 
    308  * Transport configuration for creating UDP transports for both SIP 
    309  * and media. 
    310  */ 
    311 typedef struct pjsua_transport_config 
    312 { 
    313     /** 
    314      * UDP port number to bind locally. This setting MUST be specified 
    315      * even when default port is desired. If the value is zero, the 
    316      * transport will be bound to any available port, and application 
    317      * can query the port by querying the transport info. 
    318      */ 
    319     unsigned            port; 
    320  
    321     /** 
    322      * Optional address where the socket should be bound. 
    323      */ 
    324     pj_in_addr          ip_addr; 
    325  
    326     /** 
    327      * Flag to indicate whether STUN should be used. 
    328      */ 
    329     pj_bool_t           use_stun; 
    330  
    331     /** 
    332      * STUN configuration, must be specified when STUN is used. 
    333      */ 
    334     pjsua_stun_config   stun_config; 
    335  
    336 } pjsua_transport_config; 
    337  
    338  
    339 /** 
    340  * Call this function to initialize UDP config with default values. 
    341  * 
    342  * @param cfg       The UDP config to be initialized. 
    343  */ 
    344 PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg) 
    345 { 
    346     pj_memset(cfg, 0, sizeof(*cfg)); 
    347 } 
    348  
    349  
    350 /** 
    351  * Normalize STUN config. 
    352  */ 
    353 PJ_INLINE(void) pjsua_normalize_stun_config( pjsua_stun_config *cfg ) 
    354 { 
    355     if (cfg->stun_srv1.slen) { 
    356  
    357         if (cfg->stun_port1 == 0) 
    358             cfg->stun_port1 = 3478; 
    359  
    360         if (cfg->stun_srv2.slen == 0) { 
    361             cfg->stun_srv2 = cfg->stun_srv1; 
    362             cfg->stun_port2 = cfg->stun_port1; 
    363         } else { 
    364             if (cfg->stun_port2 == 0) 
    365                 cfg->stun_port2 = 3478; 
    366         } 
    367  
    368     } else { 
    369         cfg->stun_port1 = 0; 
    370         cfg->stun_srv2.slen = 0; 
    371         cfg->stun_port2 = 0; 
    372     } 
    373 } 
    374  
    375  
    376 /** 
    377  * Duplicate transport config. 
    378  */ 
    379 PJ_INLINE(void) pjsua_transport_config_dup(pj_pool_t *pool, 
    380                                            pjsua_transport_config *dst, 
    381                                            const pjsua_transport_config *src) 
    382 { 
    383     pj_memcpy(dst, src, sizeof(*src)); 
    384  
    385     if (src->stun_config.stun_srv1.slen) { 
    386         pj_strdup_with_null(pool, &dst->stun_config.stun_srv1, 
    387                             &src->stun_config.stun_srv1); 
    388     } 
    389  
    390     if (src->stun_config.stun_srv2.slen) { 
    391         pj_strdup_with_null(pool, &dst->stun_config.stun_srv2, 
    392                             &src->stun_config.stun_srv2); 
    393     } 
    394  
    395     pjsua_normalize_stun_config(&dst->stun_config); 
    396 } 
    397  
    398  
    399  
    400 /** 
    401  * Transport info. 
    402  */ 
    403 typedef struct pjsua_transport_info 
    404 { 
    405     /** 
    406      * PJSUA transport identification. 
    407      */ 
    408     pjsua_transport_id      id; 
    409  
    410     /** 
    411      * Transport type. 
    412      */ 
    413     pjsip_transport_type_e  type; 
    414  
    415     /** 
    416      * Transport type name. 
    417      */ 
    418     pj_str_t                type_name; 
    419  
    420     /** 
    421      * Transport string info/description. 
    422      */ 
    423     pj_str_t                info; 
    424  
    425     /** 
    426      * Transport flag (see ##pjsip_transport_flags_e). 
    427      */ 
    428     unsigned                flag; 
    429  
    430     /** 
    431      * Local address length. 
    432      */ 
    433     unsigned                addr_len; 
    434  
    435     /** 
    436      * Local/bound address. 
    437      */ 
    438     pj_sockaddr             local_addr; 
    439  
    440     /** 
    441      * Published address (or transport address name). 
    442      */ 
    443     pjsip_host_port         local_name; 
    444  
    445     /** 
    446      * Current number of objects currently referencing this transport. 
    447      */ 
    448     unsigned                usage_count; 
    449  
    450  
    451 } pjsua_transport_info; 
    452  
    453  
    454 /** 
    455  * Media configuration. 
    456  */ 
    457 typedef struct pjsua_media_config 
    458 { 
    459     /** 
    460      * Clock rate to be applied to the conference bridge. 
    461      * If value is zero, default clock rate will be used (16KHz). 
    462      */ 
    463     unsigned            clock_rate; 
    464  
    465     /** 
    466      * Specify maximum number of media ports to be created in the 
    467      * conference bridge. Since all media terminate in the bridge 
    468      * (calls, file player, file recorder, etc), the value must be 
    469      * large enough to support all of them. However, the larger 
    470      * the value, the more computations are performed. 
    471      */ 
    472     unsigned            max_media_ports; 
    473  
    474     /** 
    475      * Specify whether the media manager should manage its own 
    476      * ioqueue for the RTP/RTCP sockets. If yes, ioqueue will be created 
    477      * and at least one worker thread will be created too. If no, 
    478      * the RTP/RTCP sockets will share the same ioqueue as SIP sockets, 
    479      * and no worker thread is needed. 
    480      * 
    481      * Normally application would say yes here, unless it wants to 
    482      * run everything from a single thread. 
    483      */ 
    484     pj_bool_t           has_ioqueue; 
    485  
    486     /** 
    487      * Specify the number of worker threads to handle incoming RTP 
    488      * packets. A value of one is recommended for most applications. 
    489      */ 
    490     unsigned            thread_cnt; 
    491  
    492  
    493 } pjsua_media_config; 
    494  
    495  
    496 /** 
    497  * Use this function to initialize media config. 
    498  * 
    499  * @param cfg   The media config to be initialized. 
    500  */ 
    501 PJ_INLINE(void) pjsua_media_config_default(pjsua_media_config *cfg) 
    502 { 
    503     pj_memset(cfg, 0, sizeof(*cfg)); 
    504  
    505     cfg->clock_rate = 16000; 
    506     cfg->max_media_ports = 32; 
    507     cfg->has_ioqueue = PJ_TRUE; 
    508     cfg->thread_cnt = 1; 
    509 } 
    510203 
    511204 
     
    583276} 
    584277 
    585  
    586 /** 
    587  * Buddy configuration. 
    588  */ 
    589 typedef struct pjsua_buddy_config 
    590 { 
    591     /** 
    592      * Buddy URL or name address. 
    593      */ 
    594     pj_str_t    uri; 
    595  
    596     /** 
    597      * Specify whether presence subscription should start immediately. 
    598      */ 
    599     pj_bool_t   subscribe; 
    600  
    601 } pjsua_buddy_config; 
    602  
    603  
    604 /** 
    605  * Buddy's online status. 
    606  */ 
    607 typedef enum pjsua_buddy_status 
    608 { 
    609     /** 
    610      * Online status is unknown (possibly because no presence subscription 
    611      * has been established). 
    612      */ 
    613     PJSUA_BUDDY_STATUS_UNKNOWN, 
    614  
    615     /** 
    616      * Buddy is known to be offline. 
    617      */ 
    618     PJSUA_BUDDY_STATUS_ONLINE, 
    619  
    620     /** 
    621      * Buddy is offline. 
    622      */ 
    623     PJSUA_BUDDY_STATUS_OFFLINE, 
    624  
    625 } pjsua_buddy_status; 
    626  
    627  
    628  
    629 /** 
    630  * Buddy info. 
    631  */ 
    632 typedef struct pjsua_buddy_info 
    633 { 
    634     /** 
    635      * The buddy ID. 
    636      */ 
    637     pjsua_buddy_id      id; 
    638  
    639     /** 
    640      * The full URI of the buddy, as specified in the configuration. 
    641      */ 
    642     pj_str_t            uri; 
    643  
    644     /** 
    645      * Buddy's Contact, only available when presence subscription has 
    646      * been established to the buddy. 
    647      */ 
    648     pj_str_t            contact; 
    649  
    650     /** 
    651      * Buddy's online status. 
    652      */ 
    653     pjsua_buddy_status  status; 
    654  
    655     /** 
    656      * Text to describe buddy's online status. 
    657      */ 
    658     pj_str_t            status_text; 
    659  
    660     /** 
    661      * Flag to indicate that we should monitor the presence information for 
    662      * this buddy (normally yes, unless explicitly disabled). 
    663      */ 
    664     pj_bool_t           monitor_pres; 
    665  
    666     /** 
    667      * Internal buffer. 
    668      */ 
    669     char                buf_[256]; 
    670  
    671 } pjsua_buddy_info; 
    672  
    673  
    674 /** 
    675  * Codec config. 
    676  */ 
    677 typedef struct pjsua_codec_info 
    678 { 
    679     /** 
    680      * Codec unique identification. 
    681      */ 
    682     pj_str_t            codec_id; 
    683  
    684     /** 
    685      * Codec priority (integer 0-255). 
    686      */ 
    687     pj_uint8_t          priority; 
    688  
    689     /** 
    690      * Internal buffer. 
    691      */ 
    692     char                buf_[32]; 
    693  
    694 } pjsua_codec_info; 
    695278 
    696279 
     
    889472 
    890473 
     474 
     475/** 
     476 * This structure describes additional information to be sent with 
     477 * outgoing SIP message. 
     478 */ 
     479typedef struct pjsua_msg_data 
     480{ 
     481    /** 
     482     * Additional message headers as linked list. 
     483     */ 
     484    pjsip_hdr   hdr_list; 
     485 
     486    /** 
     487     * MIME type of optional message body.  
     488     */ 
     489    pj_str_t    content_type; 
     490 
     491    /** 
     492     * Optional message body. 
     493     */ 
     494    pj_str_t    msg_body; 
     495 
     496} pjsua_msg_data; 
     497 
     498 
     499/** 
     500 * Initialize message data. 
     501 * 
     502 * @param msg_data  Message data to be initialized. 
     503 */ 
     504PJ_INLINE(void) pjsua_msg_data_init(pjsua_msg_data *msg_data) 
     505{ 
     506    pj_memset(msg_data, 0, sizeof(*msg_data)); 
     507    pj_list_init(&msg_data->hdr_list); 
     508} 
     509 
     510 
     511 
     512/** 
     513 * Instantiate pjsua application. Application must call this function before 
     514 * calling any other functions, to make sure that the underlying libraries 
     515 * are properly initialized. Once this function has returned success, 
     516 * application must call pjsua_destroy() before quitting. 
     517 * 
     518 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     519 */ 
     520PJ_DECL(pj_status_t) pjsua_create(void); 
     521 
     522 
     523/** 
     524 * Initialize pjsua with the specified settings. All the settings are  
     525 * optional, and the default values will be used when the config is not 
     526 * specified. 
     527 * 
     528 * @param ua_cfg        User agent configuration. 
     529 * @param log_cfg       Optional logging configuration. 
     530 * @param media_cfg     Optional media configuration. 
     531 * 
     532 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     533 */ 
     534PJ_DECL(pj_status_t) pjsua_init(const pjsua_config *ua_cfg, 
     535                                const pjsua_logging_config *log_cfg, 
     536                                const pjsua_media_config *media_cfg); 
     537 
     538 
     539/** 
     540 * Application is recommended to call this function after all initialization 
     541 * is done, so that the library can do additional checking set up 
     542 * additional  
     543 * 
     544 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     545 */ 
     546PJ_DECL(pj_status_t) pjsua_start(void); 
     547 
     548 
     549/** 
     550 * Destroy pjsua. This function must be called once PJSUA is created. To 
     551 * make it easier for application, application may call this function 
     552 * several times with no danger. 
     553 * 
     554 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     555 */ 
     556PJ_DECL(pj_status_t) pjsua_destroy(void); 
     557 
     558 
     559/** 
     560 * Poll pjsua for events, and if necessary block the caller thread for 
     561 * the specified maximum interval (in miliseconds). 
     562 * 
     563 * @param msec_timeout  Maximum time to wait, in miliseconds. 
     564 * 
     565 * @return  The number of events that have been handled during the 
     566 *          poll. Negative value indicates error, and application 
     567 *          can retrieve the error as (err = -return_value). 
     568 */ 
     569PJ_DECL(int) pjsua_handle_events(unsigned msec_timeout); 
     570 
     571 
     572/** 
     573 * Create memory pool. 
     574 * 
     575 * @param name          Optional pool name. 
     576 * @param init_size     Initial size of the pool. 
     577 * @param increment     Increment size. 
     578 * 
     579 * @return              The pool, or NULL when there's no memory. 
     580 */ 
     581PJ_DECL(pj_pool_t*) pjsua_pool_create(const char *name, pj_size_t init_size, 
     582                                      pj_size_t increment); 
     583 
     584 
     585/** 
     586 * Application can call this function at any time (after pjsua_create(), of 
     587 * course) to change logging settings. 
     588 * 
     589 * @param c             Logging configuration. 
     590 * 
     591 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     592 */ 
     593PJ_DECL(pj_status_t) pjsua_reconfigure_logging(const pjsua_logging_config *c); 
     594 
     595 
     596/** 
     597 * Internal function to get SIP endpoint instance of pjsua, which is 
     598 * needed for example to register module, create transports, etc. 
     599 * Probably is only valid after #pjsua_init() is called. 
     600 *  
     601 * @return              SIP endpoint instance. 
     602 */ 
     603PJ_DECL(pjsip_endpoint*) pjsua_get_pjsip_endpt(void); 
     604 
     605/** 
     606 * Internal function to get media endpoint instance. 
     607 * Only valid after #pjsua_init() is called. 
     608 * 
     609 * @return              Media endpoint instance. 
     610 */ 
     611PJ_DECL(pjmedia_endpt*) pjsua_get_pjmedia_endpt(void); 
     612 
     613 
     614/***************************************************************************** 
     615 * Utilities. 
     616 * 
     617 */ 
     618 
     619/** 
     620 * Verify that valid SIP url is given. 
     621 * 
     622 * @param c_url         The URL, as NULL terminated string. 
     623 * 
     624 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     625 */ 
     626PJ_DECL(pj_status_t) pjsua_verify_sip_url(const char *c_url); 
     627 
     628 
     629/** 
     630 * Display error message for the specified error code. 
     631 * 
     632 * @param sender        The log sender field. 
     633 * @param title         Message title for the error. 
     634 * @param status        Status code. 
     635 */ 
     636PJ_DECL(void) pjsua_perror(const char *sender, const char *title,  
     637                           pj_status_t status); 
     638 
     639 
     640 
     641 
     642/** 
     643 * @} 
     644 */ 
     645 
     646 
     647 
     648/***************************************************************************** 
     649 * TRANSPORT API 
     650 */ 
     651 
     652/** 
     653 * @defgroup PJSUA_LIB_TRANSPORT Signaling Transport 
     654 * @ingroup PJSUA_LIB 
     655 * @brief API for managing SIP transports 
     656 * @{ 
     657 * SIP transport must be created before adding an account. SIP transport is 
     658 * created by calling #pjsua_transport_create() function. 
     659 */ 
     660 
     661 
     662/** SIP transport identification */ 
     663typedef int pjsua_transport_id; 
     664 
     665 
     666/** 
     667 * STUN configuration. 
     668 */ 
     669typedef struct pjsua_stun_config 
     670{ 
     671    /** 
     672     * The first STUN server IP address or hostname. 
     673     */ 
     674    pj_str_t    stun_srv1; 
     675 
     676    /** 
     677     * Port number of the first STUN server. 
     678     * If zero, default STUN port will be used. 
     679     */ 
     680    unsigned    stun_port1; 
     681     
     682    /** 
     683     * Optional second STUN server IP address or hostname, for which the 
     684     * result of the mapping request will be compared to. If the value 
     685     * is empty, only one STUN server will be used. 
     686     */ 
     687    pj_str_t    stun_srv2; 
     688 
     689    /** 
     690     * Port number of the second STUN server. 
     691     * If zero, default STUN port will be used. 
     692     */ 
     693    unsigned    stun_port2; 
     694 
     695} pjsua_stun_config; 
     696 
     697 
     698 
     699/** 
     700 * Call this function to initialize STUN config with default values. 
     701 * 
     702 * @param cfg       The STUN config to be initialized. 
     703 */ 
     704PJ_INLINE(void) pjsua_stun_config_default(pjsua_stun_config *cfg) 
     705{ 
     706    pj_memset(cfg, 0, sizeof(*cfg)); 
     707} 
     708 
     709 
     710/** 
     711 * Transport configuration for creating UDP transports for both SIP 
     712 * and media. 
     713 */ 
     714typedef struct pjsua_transport_config 
     715{ 
     716    /** 
     717     * UDP port number to bind locally. This setting MUST be specified 
     718     * even when default port is desired. If the value is zero, the 
     719     * transport will be bound to any available port, and application 
     720     * can query the port by querying the transport info. 
     721     */ 
     722    unsigned            port; 
     723 
     724    /** 
     725     * Optional address where the socket should be bound. 
     726     */ 
     727    pj_in_addr          ip_addr; 
     728 
     729    /** 
     730     * Flag to indicate whether STUN should be used. 
     731     */ 
     732    pj_bool_t           use_stun; 
     733 
     734    /** 
     735     * STUN configuration, must be specified when STUN is used. 
     736     */ 
     737    pjsua_stun_config   stun_config; 
     738 
     739} pjsua_transport_config; 
     740 
     741 
     742/** 
     743 * Call this function to initialize UDP config with default values. 
     744 * 
     745 * @param cfg       The UDP config to be initialized. 
     746 */ 
     747PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg) 
     748{ 
     749    pj_memset(cfg, 0, sizeof(*cfg)); 
     750} 
     751 
     752 
     753/** 
     754 * Normalize STUN config. 
     755 */ 
     756PJ_INLINE(void) pjsua_normalize_stun_config( pjsua_stun_config *cfg ) 
     757{ 
     758    if (cfg->stun_srv1.slen) { 
     759 
     760        if (cfg->stun_port1 == 0) 
     761            cfg->stun_port1 = 3478; 
     762 
     763        if (cfg->stun_srv2.slen == 0) { 
     764            cfg->stun_srv2 = cfg->stun_srv1; 
     765            cfg->stun_port2 = cfg->stun_port1; 
     766        } else { 
     767            if (cfg->stun_port2 == 0) 
     768                cfg->stun_port2 = 3478; 
     769        } 
     770 
     771    } else { 
     772        cfg->stun_port1 = 0; 
     773        cfg->stun_srv2.slen = 0; 
     774        cfg->stun_port2 = 0; 
     775    } 
     776} 
     777 
     778 
     779/** 
     780 * Duplicate transport config. 
     781 */ 
     782PJ_INLINE(void) pjsua_transport_config_dup(pj_pool_t *pool, 
     783                                           pjsua_transport_config *dst, 
     784                                           const pjsua_transport_config *src) 
     785{ 
     786    pj_memcpy(dst, src, sizeof(*src)); 
     787 
     788    if (src->stun_config.stun_srv1.slen) { 
     789        pj_strdup_with_null(pool, &dst->stun_config.stun_srv1, 
     790                            &src->stun_config.stun_srv1); 
     791    } 
     792 
     793    if (src->stun_config.stun_srv2.slen) { 
     794        pj_strdup_with_null(pool, &dst->stun_config.stun_srv2, 
     795                            &src->stun_config.stun_srv2); 
     796    } 
     797 
     798    pjsua_normalize_stun_config(&dst->stun_config); 
     799} 
     800 
     801 
     802 
     803/** 
     804 * Transport info. 
     805 */ 
     806typedef struct pjsua_transport_info 
     807{ 
     808    /** 
     809     * PJSUA transport identification. 
     810     */ 
     811    pjsua_transport_id      id; 
     812 
     813    /** 
     814     * Transport type. 
     815     */ 
     816    pjsip_transport_type_e  type; 
     817 
     818    /** 
     819     * Transport type name. 
     820     */ 
     821    pj_str_t                type_name; 
     822 
     823    /** 
     824     * Transport string info/description. 
     825     */ 
     826    pj_str_t                info; 
     827 
     828    /** 
     829     * Transport flag (see ##pjsip_transport_flags_e). 
     830     */ 
     831    unsigned                flag; 
     832 
     833    /** 
     834     * Local address length. 
     835     */ 
     836    unsigned                addr_len; 
     837 
     838    /** 
     839     * Local/bound address. 
     840     */ 
     841    pj_sockaddr             local_addr; 
     842 
     843    /** 
     844     * Published address (or transport address name). 
     845     */ 
     846    pjsip_host_port         local_name; 
     847 
     848    /** 
     849     * Current number of objects currently referencing this transport. 
     850     */ 
     851    unsigned                usage_count; 
     852 
     853 
     854} pjsua_transport_info; 
     855 
     856 
     857/** 
     858 * Create SIP transport. 
     859 * 
     860 * @param type          Transport type. 
     861 * @param cfg           Transport configuration. 
     862 * @param p_id          Optional pointer to receive transport ID. 
     863 * 
     864 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     865 */ 
     866PJ_DECL(pj_status_t) pjsua_transport_create(pjsip_transport_type_e type, 
     867                                            const pjsua_transport_config *cfg, 
     868                                            pjsua_transport_id *p_id); 
     869 
     870/** 
     871 * Register transport that has been created by application. 
     872 * 
     873 * @param tp            Transport instance. 
     874 * @param p_id          Optional pointer to receive transport ID. 
     875 * 
     876 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     877 */ 
     878PJ_DECL(pj_status_t) pjsua_transport_register(pjsip_transport *tp, 
     879                                              pjsua_transport_id *p_id); 
     880 
     881 
     882/** 
     883 * Enumerate all transports currently created in the system. 
     884 * 
     885 * @param id            Array to receive transport ids. 
     886 * @param count         In input, specifies the maximum number of elements. 
     887 *                      On return, it contains the actual number of elements. 
     888 * 
     889 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     890 */ 
     891PJ_DECL(pj_status_t) pjsua_enum_transports( pjsua_transport_id id[], 
     892                                            unsigned *count ); 
     893 
     894 
     895/** 
     896 * Get information about transports. 
     897 * 
     898 * @param id            Transport ID. 
     899 * @param info          Pointer to receive transport info. 
     900 * 
     901 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     902 */ 
     903PJ_DECL(pj_status_t) pjsua_transport_get_info(pjsua_transport_id id, 
     904                                              pjsua_transport_info *info); 
     905 
     906 
     907/** 
     908 * Disable a transport or re-enable it. By default transport is always  
     909 * enabled after it is created. Disabling a transport does not necessarily 
     910 * close the socket, it will only discard incoming messages and prevent 
     911 * the transport from being used to send outgoing messages. 
     912 * 
     913 * @param id            Transport ID. 
     914 * @param enabled       Non-zero to enable, zero to disable. 
     915 * 
     916 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     917 */ 
     918PJ_DECL(pj_status_t) pjsua_transport_set_enable(pjsua_transport_id id, 
     919                                                pj_bool_t enabled); 
     920 
     921 
     922/** 
     923 * Close the transport. If transport is forcefully closed, it will be 
     924 * immediately closed, and any pending transactions that are using the 
     925 * transport may not terminate properly. Otherwise, the system will wait 
     926 * until all transactions are closed while preventing new users from 
     927 * using the transport, and will close the transport when it is safe to 
     928 * do so. 
     929 * 
     930 * @param id            Transport ID. 
     931 * @param force         Non-zero to immediately close the transport. This 
     932 *                      is not recommended! 
     933 * 
     934 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     935 */ 
     936PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, 
     937                                            pj_bool_t force ); 
     938 
     939/** 
     940 * @} 
     941 */ 
     942 
     943 
     944 
     945 
     946/***************************************************************************** 
     947 * ACCOUNT API 
     948 */ 
     949 
     950 
     951/** 
     952 * @defgroup PJSUA_LIB_ACC Account Management 
     953 * @ingroup PJSUA_LIB 
     954 * @brief PJSUA supports multiple accounts.. 
     955 * @{ 
     956 * PJSUA accounts provide identity (or identities) of the user who is currently 
     957 * using the application. More than one account maybe created with PJSUA. 
     958 * 
     959 * Account may or may not have client registration associated with it. 
     960 * An account is also associated with <b>route set</b> and some <b>authentication 
     961 * credentials</b>, which are used when sending SIP request messages using the 
     962 * account. An account also has presence's <b>online status</b>, which 
     963 * will be reported to remote peer when the subscribe to the account's 
     964 * presence. 
     965 * 
     966 * At least one account MUST be created in the application. If no user 
     967 * association is required, application can create a userless account by 
     968 * calling #pjsua_acc_add_local(). A userless account identifies local endpoint 
     969 * instead of a particular user. 
     970 * 
     971 * Also one account must be set as the <b>default account</b>, which is used as 
     972 * the account to use when PJSUA fails to match a request with any other 
     973 * accounts. 
     974 * 
     975 * When sending outgoing SIP requests (such as making calls or sending 
     976 * instant messages), normally PJSUA requires the application to specify 
     977 * which account to use for the request. If no account is specified, 
     978 * PJSUA may be able to select the account by matching the destination 
     979 * domain name, and fall back to default account when no match is found. 
     980 */ 
     981 
     982/** 
     983 * Maximum accounts. 
     984 */ 
     985#ifndef PJSUA_MAX_ACC 
     986#   define PJSUA_MAX_ACC            8 
     987#endif 
     988 
     989 
     990/** 
     991 * Default registration interval. 
     992 */ 
     993#ifndef PJSUA_REG_INTERVAL 
     994#   define PJSUA_REG_INTERVAL       55 
     995#endif 
     996 
     997 
     998/** 
     999 * Account configuration. 
     1000 */ 
     1001typedef struct pjsua_acc_config 
     1002{ 
     1003    /**  
     1004     * The full SIP URL for the account. The value can take name address or  
     1005     * URL format, and will look something like "sip:account@serviceprovider". 
     1006     * 
     1007     * This field is mandatory. 
     1008     */ 
     1009    pj_str_t        id; 
     1010 
     1011    /**  
     1012     * This is the URL to be put in the request URI for the registration, 
     1013     * and will look something like "sip:serviceprovider". 
     1014     * 
     1015     * This field should be specified if registration is desired. If the 
     1016     * value is empty, no account registration will be performed. 
     1017     */ 
     1018    pj_str_t        reg_uri; 
     1019 
     1020    /**  
     1021     * Optional URI to be put as Contact for this account. It is recommended 
     1022     * that this field is left empty, so that the value will be calculated 
     1023     * automatically based on the transport address. 
     1024     */ 
     1025    pj_str_t        contact; 
     1026 
     1027    /** 
     1028     * Number of proxies in the proxy array below. 
     1029     */ 
     1030    unsigned        proxy_cnt; 
     1031 
     1032    /**  
     1033     * Optional URI of the proxies to be visited for all outgoing requests  
     1034     * that are using this account (REGISTER, INVITE, etc). Application need  
     1035     * to specify these proxies if the service provider requires that requests 
     1036     * destined towards its network should go through certain proxies first 
     1037     * (for example, border controllers). 
     1038     * 
     1039     * These proxies will be put in the route set for this account, with  
     1040     * maintaining the orders (the first proxy in the array will be visited 
     1041     * first). 
     1042     */ 
     1043    pj_str_t        proxy[PJSUA_ACC_MAX_PROXIES]; 
     1044 
     1045    /**  
     1046     * Optional interval for registration, in seconds. If the value is zero,  
     1047     * default interval will be used (PJSUA_REG_INTERVAL, 55 seconds). 
     1048     */ 
     1049    unsigned        reg_timeout; 
     1050 
     1051    /**  
     1052     * Number of credentials in the credential array. 
     1053     */ 
     1054    unsigned        cred_count; 
     1055 
     1056    /**  
     1057     * Array of credentials. If registration is desired, normally there should 
     1058     * be at least one credential specified, to successfully authenticate 
     1059     * against the service provider. More credentials can be specified, for 
     1060     * example when the requests are expected to be challenged by the 
     1061     * proxies in the route set. 
     1062     */ 
     1063    pjsip_cred_info cred_info[PJSUA_ACC_MAX_PROXIES]; 
     1064 
     1065} pjsua_acc_config; 
     1066 
     1067 
     1068/** 
     1069 * Call this function to initialize account config with default values. 
     1070 * 
     1071 * @param cfg       The account config to be initialized. 
     1072 */ 
     1073PJ_INLINE(void) pjsua_acc_config_default(pjsua_acc_config *cfg) 
     1074{ 
     1075    pj_memset(cfg, 0, sizeof(*cfg)); 
     1076 
     1077    cfg->reg_timeout = PJSUA_REG_INTERVAL; 
     1078} 
     1079 
     1080 
     1081 
     1082/** 
     1083 * Account info. Application can query account info by calling  
     1084 * #pjsua_acc_get_info(). 
     1085 */ 
     1086typedef struct pjsua_acc_info 
     1087{ 
     1088    /**  
     1089     * The account ID.  
     1090     */ 
     1091    pjsua_acc_id        id; 
     1092 
     1093    /** 
     1094     * Flag to indicate whether this is the default account. 
     1095     */ 
     1096    pj_bool_t           is_default; 
     1097 
     1098    /**  
     1099     * Account URI  
     1100     */ 
     1101    pj_str_t            acc_uri; 
     1102 
     1103    /**  
     1104     * Flag to tell whether this account has registration setting 
     1105     * (reg_uri is not empty). 
     1106     */ 
     1107    pj_bool_t           has_registration; 
     1108 
     1109    /** 
     1110     * An up to date expiration interval for account registration session. 
     1111     */ 
     1112    int                 expires; 
     1113 
     1114    /** 
     1115     * Last registration status code. If status code is zero, the account 
     1116     * is currently not registered. Any other value indicates the SIP 
     1117     * status code of the registration. 
     1118     */ 
     1119    pjsip_status_code   status; 
     1120 
     1121    /** 
     1122     * String describing the registration status. 
     1123     */ 
     1124    pj_str_t            status_text; 
     1125 
     1126    /** 
     1127     * Presence online status for this account. 
     1128     */ 
     1129    pj_bool_t           online_status; 
     1130 
     1131    /** 
     1132     * Buffer that is used internally to store the status text. 
     1133     */ 
     1134    char                buf_[PJ_ERR_MSG_SIZE]; 
     1135 
     1136} pjsua_acc_info; 
     1137 
     1138 
     1139 
     1140/** 
     1141 * Get number of current accounts. 
     1142 * 
     1143 * @return              Current number of accounts. 
     1144 */ 
     1145PJ_DECL(unsigned) pjsua_acc_get_count(void); 
     1146 
     1147 
     1148/** 
     1149 * Check if the specified account ID is valid. 
     1150 * 
     1151 * @param acc_id        Account ID to check. 
     1152 * 
     1153 * @return              Non-zero if account ID is valid. 
     1154 */ 
     1155PJ_DECL(pj_bool_t) pjsua_acc_is_valid(pjsua_acc_id acc_id); 
     1156 
     1157 
     1158/** 
     1159 * Add a new account to pjsua. PJSUA must have been initialized (with 
     1160 * #pjsua_init()) before calling this function. 
     1161 * 
     1162 * @param cfg           Account configuration. 
     1163 * @param is_default    If non-zero, this account will be set as the default 
     1164 *                      account. The default account will be used when sending 
     1165 *                      outgoing requests (e.g. making call) when no account is 
     1166 *                      specified, and when receiving incoming requests when the 
     1167 *                      request does not match any accounts. It is recommended 
     1168 *                      that default account is set to local/LAN account. 
     1169 * @param p_acc_id      Pointer to receive account ID of the new account. 
     1170 * 
     1171 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1172 */ 
     1173PJ_DECL(pj_status_t) pjsua_acc_add(const pjsua_acc_config *cfg, 
     1174                                   pj_bool_t is_default, 
     1175                                   pjsua_acc_id *p_acc_id); 
     1176 
     1177 
     1178/** 
     1179 * Add a local account. A local account is used to identify local endpoint 
     1180 * instead of a specific user, and for this reason, a transport ID is needed 
     1181 * to obtain the local address information. 
     1182 * 
     1183 * @param tid           Transport ID to generate account address. 
     1184 * @param is_default    If non-zero, this account will be set as the default 
     1185 *                      account. The default account will be used when sending 
     1186 *                      outgoing requests (e.g. making call) when no account is 
     1187 *                      specified, and when receiving incoming requests when the 
     1188 *                      request does not match any accounts. It is recommended 
     1189 *                      that default account is set to local/LAN account. 
     1190 * @param p_acc_id      Pointer to receive account ID of the new account. 
     1191 * 
     1192 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1193 */ 
     1194PJ_DECL(pj_status_t) pjsua_acc_add_local(pjsua_transport_id tid, 
     1195                                         pj_bool_t is_default, 
     1196                                         pjsua_acc_id *p_acc_id); 
     1197 
     1198/** 
     1199 * Delete account. 
     1200 * 
     1201 * @param acc_id        Id of the account to be deleted. 
     1202 * 
     1203 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1204 */ 
     1205PJ_DECL(pj_status_t) pjsua_acc_del(pjsua_acc_id acc_id); 
     1206 
     1207 
     1208/** 
     1209 * Modify account information. 
     1210 * 
     1211 * @param acc_id        Id of the account to be modified. 
     1212 * @param cfg           New account configuration. 
     1213 * 
     1214 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1215 */ 
     1216PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id, 
     1217                                      const pjsua_acc_config *cfg); 
     1218 
     1219 
     1220/** 
     1221 * Modify account's presence status to be advertised to remote/presence 
     1222 * subscribers. 
     1223 * 
     1224 * @param acc_id        The account ID. 
     1225 * @param is_online     True of false. 
     1226 * 
     1227 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1228 */ 
     1229PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id, 
     1230                                                 pj_bool_t is_online); 
     1231 
     1232 
     1233/** 
     1234 * Update registration or perform unregistration.  
     1235 * 
     1236 * @param acc_id        The account ID. 
     1237 * @param renew         If renew argument is zero, this will start  
     1238 *                      unregistration process. 
     1239 * 
     1240 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1241 */ 
     1242PJ_DECL(pj_status_t) pjsua_acc_set_registration(pjsua_acc_id acc_id,  
     1243                                                pj_bool_t renew); 
     1244 
     1245 
     1246/** 
     1247 * Get account information. 
     1248 * 
     1249 * @param acc_id        Account identification. 
     1250 * @param info          Pointer to receive account information. 
     1251 * 
     1252 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1253 */ 
     1254PJ_DECL(pj_status_t) pjsua_acc_get_info(pjsua_acc_id acc_id, 
     1255                                        pjsua_acc_info *info); 
     1256 
     1257 
     1258/** 
     1259 * Enum accounts all account ids. 
     1260 * 
     1261 * @param ids           Array of account IDs to be initialized. 
     1262 * @param count         In input, specifies the maximum number of elements. 
     1263 *                      On return, it contains the actual number of elements. 
     1264 * 
     1265 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1266 */ 
     1267PJ_DECL(pj_status_t) pjsua_enum_accs(pjsua_acc_id ids[], 
     1268                                     unsigned *count ); 
     1269 
     1270 
     1271/** 
     1272 * Enum accounts info. 
     1273 * 
     1274 * @param info          Array of account infos to be initialized. 
     1275 * @param count         In input, specifies the maximum number of elements. 
     1276 *                      On return, it contains the actual number of elements. 
     1277 * 
     1278 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     1279 */ 
     1280PJ_DECL(pj_status_t) pjsua_acc_enum_info( pjsua_acc_info info[], 
     1281                                          unsigned *count ); 
     1282 
     1283 
     1284/** 
     1285 * This is an internal function to find the most appropriate account to 
     1286 * used to reach to the specified URL. 
     1287 * 
     1288 * @param url           The remote URL to reach. 
     1289 * 
     1290 * @return              Account id. 
     1291 */ 
     1292PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_outgoing(const pj_str_t *url); 
     1293 
     1294 
     1295/** 
     1296 * This is an internal function to find the most appropriate account to be 
     1297 * used to handle incoming calls. 
     1298 * 
     1299 * @param rdata         The incoming request message. 
     1300 * 
     1301 * @return              Account id. 
     1302 */ 
     1303PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_incoming(pjsip_rx_data *rdata); 
     1304 
     1305 
     1306 
     1307/** 
     1308 * @} 
     1309 */ 
     1310 
     1311 
     1312/***************************************************************************** 
     1313 * CALLS API 
     1314 */ 
     1315 
     1316 
     1317/** 
     1318 * @defgroup PJSUA_LIB_CALL Calls 
     1319 * @ingroup PJSUA_LIB 
     1320 * @brief Call manipulation. 
     1321 * @{ 
     1322 */ 
     1323 
     1324/** 
     1325 * Max simultaneous calls. 
     1326 */ 
     1327#ifndef PJSUA_MAX_CALLS 
     1328#   define PJSUA_MAX_CALLS          32 
     1329#endif 
     1330 
     1331 
     1332 
    8911333/** 
    8921334 * Call media status. 
     
    9701412 
    9711413 
    972  
    973 /** 
    974  * Conference port info. 
    975  */ 
    976 typedef struct pjsua_conf_port_info 
    977 { 
    978     /** Conference port number. */ 
    979     pjsua_conf_port_id  slot_id; 
    980  
    981     /** Port name. */ 
    982     pj_str_t            name; 
    983  
    984     /** Clock rate. */ 
    985     unsigned            clock_rate; 
    986  
    987     /** Number of channels. */ 
    988     unsigned            channel_count; 
    989  
    990     /** Samples per frame */ 
    991     unsigned            samples_per_frame; 
    992  
    993     /** Bits per sample */ 
    994     unsigned            bits_per_sample; 
    995  
    996     /** Number of listeners in the array. */ 
    997     unsigned            listener_cnt; 
    998  
    999     /** Array of listeners (in other words, ports where this port is  
    1000      *  transmitting to. 
    1001      */ 
    1002     pjsua_conf_port_id  listeners[PJSUA_MAX_CONF_PORTS]; 
    1003  
    1004 } pjsua_conf_port_info; 
    1005  
    1006  
    1007 /** 
    1008  * This structure holds information about custom media transport to 
    1009  * be registered to pjsua. 
    1010  */ 
    1011 typedef struct pjsua_media_transport 
    1012 { 
    1013     /** 
    1014      * Media socket information containing the address information 
    1015      * of the RTP and RTCP socket. 
    1016      */ 
    1017     pjmedia_sock_info    skinfo; 
    1018  
    1019     /** 
    1020      * The media transport instance. 
    1021      */ 
    1022     pjmedia_transport   *transport; 
    1023  
    1024 } pjsua_media_transport; 
    1025  
    1026  
    1027 /** 
    1028  * This structure describes additional information to be sent with 
    1029  * outgoing SIP message. 
    1030  */ 
    1031 typedef struct pjsua_msg_data 
    1032 { 
    1033     /** 
    1034      * Additional message headers as linked list. 
    1035      */ 
    1036     pjsip_hdr   hdr_list; 
    1037  
    1038     /** 
    1039      * MIME type of optional message body.  
    1040      */ 
    1041     pj_str_t    content_type; 
    1042  
    1043     /** 
    1044      * Optional message body. 
    1045      */ 
    1046     pj_str_t    msg_body; 
    1047  
    1048 } pjsua_msg_data; 
    1049  
    1050  
    1051 /** 
    1052  * Initialize message data. 
    1053  * 
    1054  * @param msg_data  Message data to be initialized. 
    1055  */ 
    1056 PJ_INLINE(void) pjsua_msg_data_init(pjsua_msg_data *msg_data) 
    1057 { 
    1058     pj_memset(msg_data, 0, sizeof(*msg_data)); 
    1059     pj_list_init(&msg_data->hdr_list); 
    1060 } 
    1061  
    1062  
    1063 /***************************************************************************** 
    1064  * PJSUA Core API 
    1065  */ 
    1066  
    1067  
    1068 /** 
    1069  * Instantiate pjsua application. Application must call this function before 
    1070  * calling any other functions, to make sure that the underlying libraries 
    1071  * are properly initialized. Once this function has returned success, 
    1072  * application must call pjsua_destroy() before quitting. 
    1073  * 
    1074  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1075  */ 
    1076 PJ_DECL(pj_status_t) pjsua_create(void); 
    1077  
    1078  
    1079 /** 
    1080  * Initialize pjsua with the specified settings. All the settings are  
    1081  * optional, and the default values will be used when the config is not 
    1082  * specified. 
    1083  * 
    1084  * @param ua_cfg        User agent configuration. 
    1085  * @param log_cfg       Optional logging configuration. 
    1086  * @param media_cfg     Optional media configuration. 
    1087  * 
    1088  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1089  */ 
    1090 PJ_DECL(pj_status_t) pjsua_init(const pjsua_config *ua_cfg, 
    1091                                 const pjsua_logging_config *log_cfg, 
    1092                                 const pjsua_media_config *media_cfg); 
    1093  
    1094  
    1095 /** 
    1096  * Application is recommended to call this function after all initialization 
    1097  * is done, so that the library can do additional checking set up 
    1098  * additional  
    1099  * 
    1100  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1101  */ 
    1102 PJ_DECL(pj_status_t) pjsua_start(void); 
    1103  
    1104  
    1105 /** 
    1106  * Destroy pjsua. This function must be called once PJSUA is created. To 
    1107  * make it easier for application, application may call this function 
    1108  * several times with no danger. 
    1109  * 
    1110  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1111  */ 
    1112 PJ_DECL(pj_status_t) pjsua_destroy(void); 
    1113  
    1114  
    1115 /** 
    1116  * Poll pjsua for events, and if necessary block the caller thread for 
    1117  * the specified maximum interval (in miliseconds). 
    1118  * 
    1119  * @param msec_timeout  Maximum time to wait, in miliseconds. 
    1120  * 
    1121  * @return  The number of events that have been handled during the 
    1122  *          poll. Negative value indicates error, and application 
    1123  *          can retrieve the error as (err = -return_value). 
    1124  */ 
    1125 PJ_DECL(int) pjsua_handle_events(unsigned msec_timeout); 
    1126  
    1127  
    1128 /** 
    1129  * Create memory pool. 
    1130  * 
    1131  * @param name          Optional pool name. 
    1132  * @param size          Initial size of the pool. 
    1133  * @param increment     Increment size. 
    1134  * 
    1135  * @return              The pool, or NULL when there's no memory. 
    1136  */ 
    1137 PJ_DECL(pj_pool_t*) pjsua_pool_create(const char *name, pj_size_t init_size, 
    1138                                       pj_size_t increment); 
    1139  
    1140  
    1141 /** 
    1142  * Application can call this function at any time (after pjsua_create(), of 
    1143  * course) to change logging settings. 
    1144  * 
    1145  * @param c             Logging configuration. 
    1146  * 
    1147  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1148  */ 
    1149 PJ_DECL(pj_status_t) pjsua_reconfigure_logging(const pjsua_logging_config *c); 
    1150  
    1151  
    1152 /** 
    1153  * Internal function to get SIP endpoint instance of pjsua, which is 
    1154  * needed for example to register module, create transports, etc. 
    1155  * Probably is only valid after #pjsua_init() is called. 
    1156  *  
    1157  * @return              SIP endpoint instance. 
    1158  */ 
    1159 PJ_DECL(pjsip_endpoint*) pjsua_get_pjsip_endpt(void); 
    1160  
    1161 /** 
    1162  * Internal function to get media endpoint instance. 
    1163  * Only valid after #pjsua_init() is called. 
    1164  * 
    1165  * @return              Media endpoint instance. 
    1166  */ 
    1167 PJ_DECL(pjmedia_endpt*) pjsua_get_pjmedia_endpt(void); 
    1168  
    1169  
    1170 /***************************************************************************** 
    1171  * PJSUA SIP Transport API. 
    1172  */ 
    1173  
    1174 /** 
    1175  * Create SIP transport. 
    1176  * 
    1177  * @param type          Transport type. 
    1178  * @param cfg           Transport configuration. 
    1179  * @param p_id          Optional pointer to receive transport ID. 
    1180  * 
    1181  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1182  */ 
    1183 PJ_DECL(pj_status_t) pjsua_transport_create(pjsip_transport_type_e type, 
    1184                                             const pjsua_transport_config *cfg, 
    1185                                             pjsua_transport_id *p_id); 
    1186  
    1187 /** 
    1188  * Register transport that has been created by application. 
    1189  * 
    1190  * @param tp            Transport instance. 
    1191  * @param p_id          Optional pointer to receive transport ID. 
    1192  * 
    1193  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1194  */ 
    1195 PJ_DECL(pj_status_t) pjsua_transport_register(pjsip_transport *tp, 
    1196                                               pjsua_transport_id *p_id); 
    1197  
    1198  
    1199 /** 
    1200  * Enumerate all transports currently created in the system. 
    1201  * 
    1202  * @param id            Array to receive transport ids. 
    1203  * @param count         In input, specifies the maximum number of elements. 
    1204  *                      On return, it contains the actual number of elements. 
    1205  * 
    1206  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1207  */ 
    1208 PJ_DECL(pj_status_t) pjsua_enum_transports( pjsua_transport_id id[], 
    1209                                             unsigned *count ); 
    1210  
    1211  
    1212 /** 
    1213  * Get information about transports. 
    1214  * 
    1215  * @param id            Transport ID. 
    1216  * @param info          Pointer to receive transport info. 
    1217  * 
    1218  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1219  */ 
    1220 PJ_DECL(pj_status_t) pjsua_transport_get_info(pjsua_transport_id id, 
    1221                                               pjsua_transport_info *info); 
    1222  
    1223  
    1224 /** 
    1225  * Disable a transport or re-enable it. By default transport is always  
    1226  * enabled after it is created. Disabling a transport does not necessarily 
    1227  * close the socket, it will only discard incoming messages and prevent 
    1228  * the transport from being used to send outgoing messages. 
    1229  * 
    1230  * @param id            Transport ID. 
    1231  * @param enabled       Non-zero to enable, zero to disable. 
    1232  * 
    1233  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1234  */ 
    1235 PJ_DECL(pj_status_t) pjsua_transport_set_enable(pjsua_transport_id id, 
    1236                                                 pj_bool_t enabled); 
    1237  
    1238  
    1239 /** 
    1240  * Close the transport. If transport is forcefully closed, it will be 
    1241  * immediately closed, and any pending transactions that are using the 
    1242  * transport may not terminate properly. Otherwise, the system will wait 
    1243  * until all transactions are closed while preventing new users from 
    1244  * using the transport, and will close the transport when it is safe to 
    1245  * do so. 
    1246  * 
    1247  * @param id            Transport ID. 
    1248  * @param force         Non-zero to immediately close the transport. This 
    1249  *                      is not recommended! 
    1250  * 
    1251  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1252  */ 
    1253 PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, 
    1254                                             pj_bool_t force ); 
    1255  
    1256  
    1257 /***************************************************************************** 
    1258  * PJSUA Media Transport. 
    1259  */ 
    1260  
    1261 /** 
    1262  * Create UDP media transports for all the calls. This function creates 
    1263  * one UDP media transport for each call. 
    1264  * 
    1265  * @param cfg           Media transport configuration. The "port" field in the 
    1266  *                      configuration is used as the start port to bind the 
    1267  *                      sockets. 
    1268  * 
    1269  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1270  */ 
    1271 PJ_DECL(pj_status_t)  
    1272 pjsua_media_transports_create(const pjsua_transport_config *cfg); 
    1273  
    1274  
    1275 /** 
    1276  * Register custom media transports to be used by calls. There must 
    1277  * enough media transports for all calls. 
    1278  * 
    1279  * @param tp            The media transport array. 
    1280  * @param count         Number of elements in the array. This number MUST 
    1281  *                      match the number of maximum calls configured when 
    1282  *                      pjsua is created. 
    1283  * @param auto_delete   Flag to indicate whether the transports should be 
    1284  *                      destroyed when pjsua is shutdown. 
    1285  * 
    1286  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1287  */ 
    1288 PJ_DECL(pj_status_t)  
    1289 pjsua_media_transports_attach( pjsua_media_transport tp[], 
    1290                                unsigned count, 
    1291                                pj_bool_t auto_delete); 
    1292  
    1293  
    1294  
    1295 /***************************************************************************** 
    1296  * PJSUA Call API. 
    1297  */ 
    1298  
    12991414/** 
    13001415 * Get maximum number of calls configured in pjsua. 
     
    13281443 * 
    13291444 * @param acc_id        The account to be used. 
    1330  * @param target        URI to be put in the request URI. 
    13311445 * @param dst_uri       URI to be put in the To header (normally is the same 
    13321446 *                      as the target URI). 
     
    15651679                                     const char *indent); 
    15661680 
     1681/** 
     1682 * @} 
     1683 */ 
     1684 
    15671685 
    15681686/***************************************************************************** 
    1569  * PJSUA Account and Client Registration API. 
    1570  */ 
    1571  
    1572  
    1573 /** 
    1574  * Get number of current accounts. 
    1575  * 
    1576  * @return              Current number of accounts. 
    1577  */ 
    1578 PJ_DECL(unsigned) pjsua_acc_get_count(void); 
    1579  
    1580  
    1581 /** 
    1582  * Check if the specified account ID is valid. 
    1583  * 
    1584  * @param acc_id        Account ID to check. 
    1585  * 
    1586  * @return              Non-zero if account ID is valid. 
    1587  */ 
    1588 PJ_DECL(pj_bool_t) pjsua_acc_is_valid(pjsua_acc_id acc_id); 
    1589  
    1590  
    1591 /** 
    1592  * Add a new account to pjsua. PJSUA must have been initialized (with 
    1593  * #pjsua_init()) before calling this function. 
    1594  * 
    1595  * @param cfg           Account configuration. 
    1596  * @param is_default    If non-zero, this account will be set as the default 
    1597  *                      account. The default account will be used when sending 
    1598  *                      outgoing requests (e.g. making call) when no account is 
    1599  *                      specified, and when receiving incoming requests when the 
    1600  *                      request does not match any accounts. It is recommended 
    1601  *                      that default account is set to local/LAN account. 
    1602  * @param p_acc_id      Pointer to receive account ID of the new account. 
    1603  * 
    1604  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1605  */ 
    1606 PJ_DECL(pj_status_t) pjsua_acc_add(const pjsua_acc_config *cfg, 
    1607                                    pj_bool_t is_default, 
    1608                                    pjsua_acc_id *p_acc_id); 
    1609  
    1610  
    1611 /** 
    1612  * Add a local account. A local account is used to identify local endpoint 
    1613  * instead of a specific user, and for this reason, a transport ID is needed 
    1614  * to obtain the local address information. 
    1615  * 
    1616  * @param tid           Transport ID to generate account address. 
    1617  * @param is_default    If non-zero, this account will be set as the default 
    1618  *                      account. The default account will be used when sending 
    1619  *                      outgoing requests (e.g. making call) when no account is 
    1620  *                      specified, and when receiving incoming requests when the 
    1621  *                      request does not match any accounts. It is recommended 
    1622  *                      that default account is set to local/LAN account. 
    1623  * @param p_acc_id      Pointer to receive account ID of the new account. 
    1624  * 
    1625  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1626  */ 
    1627 PJ_DECL(pj_status_t) pjsua_acc_add_local(pjsua_transport_id tid, 
    1628                                          pj_bool_t is_default, 
    1629                                          pjsua_acc_id *p_acc_id); 
    1630  
    1631 /** 
    1632  * Delete account. 
    1633  * 
    1634  * @param acc_id        Id of the account to be deleted. 
    1635  * 
    1636  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1637  */ 
    1638 PJ_DECL(pj_status_t) pjsua_acc_del(pjsua_acc_id acc_id); 
    1639  
    1640  
    1641 /** 
    1642  * Modify account information. 
    1643  * 
    1644  * @param acc_id        Id of the account to be modified. 
    1645  * @param cfg           New account configuration. 
    1646  * 
    1647  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1648  */ 
    1649 PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id, 
    1650                                       const pjsua_acc_config *cfg); 
    1651  
    1652  
    1653 /** 
    1654  * Modify account's presence status to be advertised to remote/presence 
    1655  * subscribers. 
    1656  * 
    1657  * @param acc_id        The account ID. 
    1658  * @param is_online     True of false. 
    1659  * 
    1660  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1661  */ 
    1662 PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id, 
    1663                                                  pj_bool_t is_online); 
    1664  
    1665  
    1666 /** 
    1667  * Update registration or perform unregistration.  
    1668  * 
    1669  * @param acc_id        The account ID. 
    1670  * @param renew         If renew argument is zero, this will start  
    1671  *                      unregistration process. 
    1672  * 
    1673  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1674  */ 
    1675 PJ_DECL(pj_status_t) pjsua_acc_set_registration(pjsua_acc_id acc_id,  
    1676                                                 pj_bool_t renew); 
    1677  
    1678  
    1679 /** 
    1680  * Get account information. 
    1681  * 
    1682  * @param acc_id        Account identification. 
    1683  * @param info          Pointer to receive account information. 
    1684  * 
    1685  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1686  */ 
    1687 PJ_DECL(pj_status_t) pjsua_acc_get_info(pjsua_acc_id acc_id, 
    1688                                         pjsua_acc_info *info); 
    1689  
    1690  
    1691 /** 
    1692  * Enum accounts all account ids. 
    1693  * 
    1694  * @param ids           Array of account IDs to be initialized. 
    1695  * @param count         In input, specifies the maximum number of elements. 
    1696  *                      On return, it contains the actual number of elements. 
    1697  * 
    1698  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1699  */ 
    1700 PJ_DECL(pj_status_t) pjsua_enum_accs(pjsua_acc_id ids[], 
    1701                                      unsigned *count ); 
    1702  
    1703  
    1704 /** 
    1705  * Enum accounts info. 
    1706  * 
    1707  * @param info          Array of account infos to be initialized. 
    1708  * @param count         In input, specifies the maximum number of elements. 
    1709  *                      On return, it contains the actual number of elements. 
    1710  * 
    1711  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    1712  */ 
    1713 PJ_DECL(pj_status_t) pjsua_acc_enum_info( pjsua_acc_info info[], 
    1714                                           unsigned *count ); 
    1715  
    1716  
    1717 /** 
    1718  * This is an internal function to find the most appropriate account to 
    1719  * used to reach to the specified URL. 
    1720  * 
    1721  * @param url           The remote URL to reach. 
    1722  * 
    1723  * @return              Account id. 
    1724  */ 
    1725 PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_outgoing(const pj_str_t *url); 
    1726  
    1727  
    1728 /** 
    1729  * This is an internal function to find the most appropriate account to be 
    1730  * used to handle incoming calls. 
    1731  * 
    1732  * @param rdata         The incoming request message. 
    1733  * 
    1734  * @return              Account id. 
    1735  */ 
    1736 PJ_DECL(pjsua_acc_id) pjsua_acc_find_for_incoming(pjsip_rx_data *rdata); 
    1737  
    1738  
    1739  
    1740 /***************************************************************************** 
    1741  * PJSUA Presence (pjsua_pres.c) 
    1742  */ 
     1687 * BUDDY API 
     1688 */ 
     1689 
     1690 
     1691/** 
     1692 * @defgroup PJSUA_LIB_BUDDY Buddy, Presence, and Instant Messaging 
     1693 * @ingroup PJSUA_LIB 
     1694 * @brief Buddy management, buddy's presence, and instant messaging. 
     1695 * @{ 
     1696 */ 
     1697 
     1698/** 
     1699 * Max buddies in buddy list. 
     1700 */ 
     1701#ifndef PJSUA_MAX_BUDDIES 
     1702#   define PJSUA_MAX_BUDDIES        256 
     1703#endif 
     1704 
     1705 
     1706/** 
     1707 * Buddy configuration. 
     1708 */ 
     1709typedef struct pjsua_buddy_config 
     1710{ 
     1711    /** 
     1712     * Buddy URL or name address. 
     1713     */ 
     1714    pj_str_t    uri; 
     1715 
     1716    /** 
     1717     * Specify whether presence subscription should start immediately. 
     1718     */ 
     1719    pj_bool_t   subscribe; 
     1720 
     1721} pjsua_buddy_config; 
     1722 
     1723 
     1724/** 
     1725 * Buddy's online status. 
     1726 */ 
     1727typedef enum pjsua_buddy_status 
     1728{ 
     1729    /** 
     1730     * Online status is unknown (possibly because no presence subscription 
     1731     * has been established). 
     1732     */ 
     1733    PJSUA_BUDDY_STATUS_UNKNOWN, 
     1734 
     1735    /** 
     1736     * Buddy is known to be offline. 
     1737     */ 
     1738    PJSUA_BUDDY_STATUS_ONLINE, 
     1739 
     1740    /** 
     1741     * Buddy is offline. 
     1742     */ 
     1743    PJSUA_BUDDY_STATUS_OFFLINE, 
     1744 
     1745} pjsua_buddy_status; 
     1746 
     1747 
     1748 
     1749/** 
     1750 * Buddy info. 
     1751 */ 
     1752typedef struct pjsua_buddy_info 
     1753{ 
     1754    /** 
     1755     * The buddy ID. 
     1756     */ 
     1757    pjsua_buddy_id      id; 
     1758 
     1759    /** 
     1760     * The full URI of the buddy, as specified in the configuration. 
     1761     */ 
     1762    pj_str_t            uri; 
     1763 
     1764    /** 
     1765     * Buddy's Contact, only available when presence subscription has 
     1766     * been established to the buddy. 
     1767     */ 
     1768    pj_str_t            contact; 
     1769 
     1770    /** 
     1771     * Buddy's online status. 
     1772     */ 
     1773    pjsua_buddy_status  status; 
     1774 
     1775    /** 
     1776     * Text to describe buddy's online status. 
     1777     */ 
     1778    pj_str_t            status_text; 
     1779 
     1780    /** 
     1781     * Flag to indicate that we should monitor the presence information for 
     1782     * this buddy (normally yes, unless explicitly disabled). 
     1783     */ 
     1784    pj_bool_t           monitor_pres; 
     1785 
     1786    /** 
     1787     * Internal buffer. 
     1788     */ 
     1789    char                buf_[256]; 
     1790 
     1791} pjsua_buddy_info; 
     1792 
    17431793 
    17441794/** 
     
    18261876PJ_DECL(void) pjsua_pres_dump(pj_bool_t verbose); 
    18271877 
    1828  
    1829 /***************************************************************************** 
    1830  * PJSUA Instant Messaging (pjsua_im.c) 
    1831  */ 
    18321878 
    18331879/** 
     
    18821928 
    18831929 
     1930/** 
     1931 * @} 
     1932 */ 
     1933 
     1934 
    18841935/***************************************************************************** 
    1885  * Conference bridge manipulation. 
    1886  */ 
     1936 * MEDIA API 
     1937 */ 
     1938 
     1939 
     1940/** 
     1941 * @defgroup PJSUA_LIB_MEDIA Media 
     1942 * @ingroup PJSUA_LIB 
     1943 * @brief Media manipulation. 
     1944 * @{ 
     1945 * 
     1946 * PJSUA has rather powerful media features, which are built around the 
     1947 * PJMEDIA conference bridge. Basically, all media termination (such as 
     1948 * calls, file players, file recorders, sound device, tone generators, etc) 
     1949 * are terminated in the conference bridge, and application can manipulate 
     1950 * the interconnection between these terminations freely. If more than 
     1951 * one media terminations are terminated in the same slot, the conference 
     1952 * bridge will mix the signal automatically. 
     1953 * 
     1954 * Application connects one media termination/slot to another by calling 
     1955 * #pjsua_conf_connect() function. This will establish <b>unidirectional</b> 
     1956 * media flow from the source termination to the sink termination. For 
     1957 * example, to stream a WAV file to remote call, application may use 
     1958 * the following steps: 
     1959 * 
     1960 \code 
     1961   
     1962  pj_status_t stream_to_call( pjsua_call_id call_id ) 
     1963  { 
     1964     pjsua_player_id player_id; 
     1965      
     1966     status = pjsua_player_create("mysong.wav", 0, NULL, &player_id); 
     1967     if (status != PJ_SUCCESS) 
     1968        return status; 
     1969 
     1970     status = pjsua_conf_connect( pjsua_player_get_conf_port(), 
     1971                                  pjsua_call_get_conf_port() ); 
     1972  } 
     1973 \endcode 
     1974 * 
     1975 * 
     1976 * Other features of PJSUA media: 
     1977 *  - efficient N to M interconnections between media terminations. 
     1978 *  - media termination can be connected to itself to create loopback 
     1979 *    media. 
     1980 *  - the media termination may have different clock rates, and resampling 
     1981 *    will be done automatically by conference bridge. 
     1982 *  - media terminations may also have different frame time; the 
     1983 *    conference bridge will perform the necessary bufferring to adjust 
     1984 *    the difference between terminations. 
     1985 *  - interconnections are removed automatically when media termination 
     1986 *    is removed from the bridge. 
     1987 *  - sound device may be changed even when there are active media  
     1988 *    interconnections. 
     1989 *  - correctly report call's media quality (in #pjsua_call_dump()) from 
     1990 *    RTCP packet exchange. 
     1991 */ 
     1992 
     1993/** 
     1994 * Max ports in the conference bridge. 
     1995 */ 
     1996#ifndef PJSUA_MAX_CONF_PORTS 
     1997#   define PJSUA_MAX_CONF_PORTS     254 
     1998#endif 
     1999 
     2000 
     2001 
     2002/** 
     2003 * Media configuration. 
     2004 */ 
     2005struct pjsua_media_config 
     2006{ 
     2007    /** 
     2008     * Clock rate to be applied to the conference bridge. 
     2009     * If value is zero, default clock rate will be used (16KHz). 
     2010     */ 
     2011    unsigned            clock_rate; 
     2012 
     2013    /** 
     2014     * Specify maximum number of media ports to be created in the 
     2015     * conference bridge. Since all media terminate in the bridge 
     2016     * (calls, file player, file recorder, etc), the value must be 
     2017     * large enough to support all of them. However, the larger 
     2018     * the value, the more computations are performed. 
     2019     */ 
     2020    unsigned            max_media_ports; 
     2021 
     2022    /** 
     2023     * Specify whether the media manager should manage its own 
     2024     * ioqueue for the RTP/RTCP sockets. If yes, ioqueue will be created 
     2025     * and at least one worker thread will be created too. If no, 
     2026     * the RTP/RTCP sockets will share the same ioqueue as SIP sockets, 
     2027     * and no worker thread is needed. 
     2028     * 
     2029     * Normally application would say yes here, unless it wants to 
     2030     * run everything from a single thread. 
     2031     */ 
     2032    pj_bool_t           has_ioqueue; 
     2033 
     2034    /** 
     2035     * Specify the number of worker threads to handle incoming RTP 
     2036     * packets. A value of one is recommended for most applications. 
     2037     */ 
     2038    unsigned            thread_cnt; 
     2039 
     2040 
     2041}; 
     2042 
     2043 
     2044/** 
     2045 * Use this function to initialize media config. 
     2046 * 
     2047 * @param cfg   The media config to be initialized. 
     2048 */ 
     2049PJ_INLINE(void) pjsua_media_config_default(pjsua_media_config *cfg) 
     2050{ 
     2051    pj_memset(cfg, 0, sizeof(*cfg)); 
     2052 
     2053    cfg->clock_rate = 16000; 
     2054    cfg->max_media_ports = 32; 
     2055    cfg->has_ioqueue = PJ_TRUE; 
     2056    cfg->thread_cnt = 1; 
     2057} 
     2058 
     2059 
     2060 
     2061/** 
     2062 * Codec config. 
     2063 */ 
     2064typedef struct pjsua_codec_info 
     2065{ 
     2066    /** 
     2067     * Codec unique identification. 
     2068     */ 
     2069    pj_str_t            codec_id; 
     2070 
     2071    /** 
     2072     * Codec priority (integer 0-255). 
     2073     */ 
     2074    pj_uint8_t          priority; 
     2075 
     2076    /** 
     2077     * Internal buffer. 
     2078     */ 
     2079    char                buf_[32]; 
     2080 
     2081} pjsua_codec_info; 
     2082 
     2083 
     2084/** 
     2085 * Conference port info. 
     2086 */ 
     2087typedef struct pjsua_conf_port_info 
     2088{ 
     2089    /** Conference port number. */ 
     2090    pjsua_conf_port_id  slot_id; 
     2091 
     2092    /** Port name. */ 
     2093    pj_str_t            name; 
     2094 
     2095    /** Clock rate. */ 
     2096    unsigned            clock_rate; 
     2097 
     2098    /** Number of channels. */ 
     2099    unsigned            channel_count; 
     2100 
     2101    /** Samples per frame */ 
     2102    unsigned            samples_per_frame; 
     2103 
     2104    /** Bits per sample */ 
     2105    unsigned            bits_per_sample; 
     2106 
     2107    /** Number of listeners in the array. */ 
     2108    unsigned            listener_cnt; 
     2109 
     2110    /** Array of listeners (in other words, ports where this port is  
     2111     *  transmitting to. 
     2112     */ 
     2113    pjsua_conf_port_id  listeners[PJSUA_MAX_CONF_PORTS]; 
     2114 
     2115} pjsua_conf_port_info; 
     2116 
     2117 
     2118/** 
     2119 * This structure holds information about custom media transport to 
     2120 * be registered to pjsua. 
     2121 */ 
     2122typedef struct pjsua_media_transport 
     2123{ 
     2124    /** 
     2125     * Media socket information containing the address information 
     2126     * of the RTP and RTCP socket. 
     2127     */ 
     2128    pjmedia_sock_info    skinfo; 
     2129 
     2130    /** 
     2131     * The media transport instance. 
     2132     */ 
     2133    pjmedia_transport   *transport; 
     2134 
     2135} pjsua_media_transport; 
     2136 
     2137 
     2138 
    18872139 
    18882140/** 
     
    19692221 * 
    19702222 * @param filename      The filename to be played. Currently only 
    1971  *                      WAV files are supported. 
     2223 *                      WAV files are supported, and the WAV file MUST be 
     2224 *                      formatted as 16bit PCM mono/single channel (any 
     2225 *                      clock rate is supported). 
    19722226 * @param options       Options (currently zero). 
    19732227 * @param user_data     Arbitrary user data to be associated with the player. 
     
    21662420 
    21672421 
    2168  
    2169 /***************************************************************************** 
    2170  * Utilities. 
    2171  * 
    2172  */ 
    2173  
    2174 /* 
    2175  * Verify that valid SIP url is given. 
    2176  * 
    2177  * @param c_url         The URL, as NULL terminated string. 
    2178  * 
    2179  * @return              PJ_SUCCESS on success, or the appropriate error code. 
    2180  */ 
    2181 PJ_DECL(pj_status_t) pjsua_verify_sip_url(const char *c_url); 
    2182  
    2183  
    2184 /** 
    2185  * Display error message for the specified error code. 
    2186  * 
    2187  * @param sender        The log sender field. 
    2188  * @param title         Message title for the error. 
    2189  * @param status        Status code. 
    2190  */ 
    2191 PJ_DECL(void) pjsua_perror(const char *sender, const char *title,  
    2192                            pj_status_t status); 
    2193  
     2422/** 
     2423 * Create UDP media transports for all the calls. This function creates 
     2424 * one UDP media transport for each call. 
     2425 * 
     2426 * @param cfg           Media transport configuration. The "port" field in the 
     2427 *                      configuration is used as the start port to bind the 
     2428 *                      sockets. 
     2429 * 
     2430 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2431 */ 
     2432PJ_DECL(pj_status_t)  
     2433pjsua_media_transports_create(const pjsua_transport_config *cfg); 
     2434 
     2435 
     2436/** 
     2437 * Register custom media transports to be used by calls. There must 
     2438 * enough media transports for all calls. 
     2439 * 
     2440 * @param tp            The media transport array. 
     2441 * @param count         Number of elements in the array. This number MUST 
     2442 *                      match the number of maximum calls configured when 
     2443 *                      pjsua is created. 
     2444 * @param auto_delete   Flag to indicate whether the transports should be 
     2445 *                      destroyed when pjsua is shutdown. 
     2446 * 
     2447 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     2448 */ 
     2449PJ_DECL(pj_status_t)  
     2450pjsua_media_transports_attach( pjsua_media_transport tp[], 
     2451                               unsigned count, 
     2452                               pj_bool_t auto_delete); 
     2453 
     2454 
     2455/** 
     2456 * @} 
     2457 */ 
    21942458 
    21952459 
     
    21982462 
    21992463 
     2464/** 
     2465 * @} 
     2466 */ 
     2467 
     2468 
    22002469#endif  /* __PJSUA_H__ */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_parser.c

    r491 r515  
    9898const pj_str_t  pjsip_BRANCH_STR    = { "branch", 6 }; 
    9999const pj_str_t  pjsip_TTL_STR       = { "ttl", 3 }; 
    100 const pj_str_t  pjsip_PNAME_STR     = { "received", 8 }; 
     100const pj_str_t  pjsip_RECEIVED_STR  = { "received", 8 }; 
    101101const pj_str_t  pjsip_Q_STR         = { "q", 1 }; 
    102102const pj_str_t  pjsip_EXPIRES_STR   = { "expires", 7 }; 
     
    16571657            hdr->maddr_param = pvalue; 
    16581658 
    1659         } else if (!parser_stricmp(pname, pjsip_PNAME_STR) && pvalue.slen) { 
     1659        } else if (!parser_stricmp(pname, pjsip_RECEIVED_STR) && pvalue.slen) { 
    16601660            hdr->recvd_param = pvalue; 
    16611661 
Note: See TracChangeset for help on using the changeset viewer.