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

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@515 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2006-06-17 04:08:30 +00:00
parent 294c2533fd
commit 312aff9600
42 changed files with 2183 additions and 1510 deletions

View File

@ -182,10 +182,6 @@ SOURCE=..\src\pj\ctype.c
# End Source File
# Begin Source File
SOURCE=..\src\pj\equeue_winnt.c
# End Source File
# Begin Source File
SOURCE=..\src\pj\errno.c
# End Source File
# Begin Source File
@ -233,13 +229,6 @@ SOURCE=..\src\pj\ioqueue_common_abs.h
# Begin Source File
SOURCE=..\src\pj\ioqueue_select.c
!IF "$(CFG)" == "pjlib - Win32 Release"
!ELSEIF "$(CFG)" == "pjlib - Win32 Debug"
!ENDIF
# End Source File
# Begin Source File

View File

@ -1,19 +0,0 @@
/* $Id$ */
/*
* Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <pj/equeue.h>

View File

@ -319,6 +319,10 @@ SOURCE=..\include\pjsip\sip_ua_layer.h
# End Group
# Begin Source File
SOURCE=..\docs\doxygen.h
# End Source File
# Begin Source File
SOURCE=..\include\pjsip.h
# End Source File
# End Group

View File

@ -134,7 +134,7 @@ FULL_PATH_NAMES = NO
# the path. It is allowed to use relative paths in the argument list.
#STRIP_FROM_PATH = "/cygdrive/e/project/bulukucing.org/pjsip/src"
STRIP_FROM_PATH = "/c/project/bulukucing.org/pjsip/src"
STRIP_FROM_PATH = "/c/project/pjproject/pjsip"
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
@ -346,7 +346,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = src/pjsip src/pjsip_mod_ua src/pjsip_simple src
INPUT = docs include
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@ -474,7 +474,7 @@ COLS_IN_ALPHA_INDEX = 5
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
IGNORE_PREFIX = /c/project/pjproject/pjsip
#---------------------------------------------------------------------------
# configuration options related to the HTML output
@ -495,19 +495,19 @@ HTML_OUTPUT = html
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
HTML_FILE_EXTENSION = .htm
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
HTML_HEADER = docs/header.html
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
HTML_FOOTER = docs/footer.html
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
# style sheet that is used by each HTML page. It can be used to
@ -844,7 +844,6 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = PJ_DECL(x)=x PJ_DEF(x)=x PJ_IDECL(x)=x \
PJ_IDEF(x)=x PJ_INLINE(x)=x
@ -1010,37 +1009,3 @@ DOT_CLEANUP = YES
SEARCHENGINE = NO
# The CGI_NAME tag should be the name of the CGI script that
# starts the search engine (doxysearch) with the correct parameters.
# A script with this name will be generated by doxygen.
CGI_NAME = search.cgi
# The CGI_URL tag should be the absolute URL to the directory where the
# cgi binaries are located. See the documentation of your http daemon for
# details.
CGI_URL =
# The DOC_URL tag should be the absolute URL to the directory where the
# documentation is located. If left blank the absolute path to the
# documentation, with file:// prepended to it, will be used.
DOC_URL =
# The DOC_ABSPATH tag should be the absolute path to the directory where the
# documentation is located. If left blank the directory on the local machine
# will be used.
DOC_ABSPATH =
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
# is installed.
BIN_ABSPATH = /usr/local/bin/
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
# documentation generated for other projects. This allows doxysearch to search
# the documentation for these projects as well.
EXT_DOC_PATHS =

183
pjsip/docs/doxygen.h Normal file
View File

@ -0,0 +1,183 @@
/* $Id$ */
/*
* Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* @file doxygen.h
* @brief PJSIP Doxygen's mainpage.
*/
/*////////////////////////////////////////////////////////////////////////// */
/*
INTRODUCTION PAGE
*/
/**
@mainpage PJSIP
\n
\n
@section intro_sec Introduction
PJSIP is an Open Source SIP prototol stack, designed to be very small in
footprint, have high performance, and very flexible.
@subsection hist_sec History
PJSIP has been actively developed since 2003, but its history goes well
beyond that. The author has been developing SIP stack since 1999 during
RFC 2543 era, and after several experimentation with different approaches
in the programming (the first stack actually was in C++!), and also with
the evolution of the SIP protocol itself, the current/third generation
of PJSIP (the 0.2.9 version is the second generation) can be considered
as pretty stable in term of design, and should
incorporate all design considerations (and implementation tricks!) that
have been learned over the years. Of course only time will tell if this
statement can still be held true in the future.
\n
\n
@section pjsipgetting_started Getting Started
PJSIP consists of multiple levels of APIs, which each of them layered on
top of another. Because of this, new readers may find it a bit difficult
to find the place to start.
In general, I think perhaps I can recommend two approaches on using PJSIP.
\n
@subsection getting_started_high Using PJSUA API
@ref PJSUA_LIB wraps together all SIP components and media into a high level
API, suitable for creating typical SIP user agent applications. It
features easy to use API for:
- multiple client registration (accounts),
- high level SIP and media session (calls),
- buddy list, presence and instant messaging,
- powerful and very easy to use media manipulation,
while maintaining some space for customization (custom SIP
transport, custom SIP media, etc.) needed by some types of applications.
@ref PJSUA_LIB is also aimed to be able to run on devices such as PDA
or mobile phones, by carefully allowing application to set the appropriate
threading strategy and memory limits (number of calls, media ports, etc.).
However, @ref PJSUA_LIB may not be the most suitable API for some types
of applications, since it is directed towards an easy to use API. For
more more advanced use, you may better implement the application by using
PJSIP + PJMEDIA directly, as described below.
\n
@subsection getting_started_pjsip_pjmedia Using PJSIP and PJMEDIA Directly
For the ultimate flexibility and power, using PJSIP and PJMEDIA directly
is the way to go. The drawback will be, of course, steeper learning curve.
However, the following links may provide some useful information:
- <A HREF="/docs.htm">PJSIP Developer's Guide</A> PDF
document is the ultimate guide to understand PJSIP design concept.
- there are some samples in <A HREF="/cgi-bin/viewcvs.cgi/pjproject/trunk/pjsip-apps/src/samples/">
<b>pjsip-apps/src/samples</b></A> directory.
- @ref PJSUA_LIB source code may also be useful to see how high level
API are implemented with PJSIP/PJMEDIA.
- and finally, you can always <b>Use the Source</b>!
\n
\n
@section this_doc About This Document
This document contains the reference information about PJSIP. For
more in-depth guide (and information in general), readers are
encouraged to read the <A HREF="/docs.htm">
<b>PJSIP Developer's Guide</b></A> PDF document
which can be downloaded from http://www.pjsip.org/docs.htm.
\n
@subsection doc_ver Version
This document corresponds to PJSIP version 0.5.6.
\n
@subsection doc_how_to_read How to Read This Document
For main navigation, please go to <A HREF="modules.htm"><b>Modules</b></A>
link on top of this page.
This document was generated with <A HREF="http://www.doxygen.org">Doxygen</A>
from PJSIP header files.
\n
\n
@section pjsip_toc Documentation Contents
Click on <A HREF="modules.htm"><b>Modules</b></A> link on top of this page
to get the detailed table of contents.
The following are top level sections in the <A HREF="modules.htm">
<b>Modules</b></A>, as laid out in the following diagram:
\image html pjsip-arch.jpg "Static Library Layout"
Enumerating the static libraries from the bottom:
- <A HREF="/pjlib/docs/main.htm">PJLIB</A>, is the platform abstraction
and framework library, on which all other libraries depend,
- PJLIB-UTIL, provides auxiliary functions such as text scanning,
XML, and STUN,
- PJMEDIA is the multimedia framework,
- PJMEDIA-CODEC is the placeholder for media codecs,
- @ref PJSIP_CORE (<b>PJSIP-CORE</b>) is the very core of the PJSIP library,
and contains the SIP @ref PJSIP_ENDPT, which is the owner/manager for all
SIP objects in the application, messaging elements, parsing, transport
management, module management, and stateless operations, and also
contains:
- The @ref PJSIP_TRANSACT module inside <b>PJSIP-CORE</b> provides
stateful operation, and is the base for higher layer features such as
dialogs,
- The @ref PJSIP_UA module inside <b>PJSIP-CORE</b> manages dialogs, and supports dialog
usages,
- @ref PJSIP_SIMPLE (<b>PJSIP-SIMPLE</b>) provides the base SIP event framework
(which uses the common/base dialog framework) and implements presence
on top of it, and is also used by call transfer functions,
- @ref PJSIP_HIGH_UA (<b>PJSIP-UA</b>) is the high level abstraction of INVITE sessions
(using the common/base dialog framework). This library also provides
SIP client registration and call transfer functionality,
- and finally, @ref PJSUA_LIB (<b>PJSUA-LIB</b>) is the highest level of abstraction,
which wraps together all above functionalities into high level, easy to
use API.
*/

4
pjsip/docs/footer.html Normal file
View File

@ -0,0 +1,4 @@
<!--#include virtual="/footer.html" -->
</BODY>
</HTML>

7
pjsip/docs/header.html Normal file
View File

@ -0,0 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PJSIP - Open Source SIP, SIMPLE, Presence, IM Protocol Stack Documentation</title>
<link href="/style/style.css" rel="stylesheet" type="text/css">
</head><body>
<!--#include virtual="/header.html" -->

BIN
pjsip/docs/pjsip-arch.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -30,6 +30,7 @@
/**
* @defgroup PJSIP_EVENT_NOT SIP Event Notification (RFC 3265) Module
* @ingroup PJSIP_SIMPLE
* @brief Core Event Subscription framework, used by presence, call transfer, etc.
* @{
*
* This module provides the implementation of SIP Extension for SIP Specific
@ -430,7 +431,7 @@ PJ_DECL(pjsip_evsub*) pjsip_tsx_get_evsub(pjsip_transaction *tsx);
* Set event subscription's module data.
*
* @param sub The event subscription.
* @param index The module id.
* @param mod_id The module id.
* @param data Arbitrary data.
*/
PJ_DECL(void) pjsip_evsub_set_mod_data( pjsip_evsub *sub, unsigned mod_id,

View File

@ -26,6 +26,7 @@
#include <pjsip/sip_msg.h>
/**
* @defgroup PJSIP_EVENT_HDRS Additional Header Fields
* @ingroup PJSIP_EVENT_NOT
* @{
*/
@ -41,7 +42,9 @@ PJ_BEGIN_DECL
*/
typedef struct pjsip_event_hdr
{
/** Standard header fields. */
PJSIP_DECL_HDR_MEMBER(struct pjsip_event_hdr);
pj_str_t event_type; /**< Event name. */
pj_str_t id_param; /**< Optional event ID parameter. */
pjsip_param other_param; /**< Other parameter. */
@ -66,11 +69,12 @@ typedef pjsip_generic_array_hdr pjsip_allow_events_hdr;
/**
* Create a new Allow-Events header.
*
* @param pool. The pool.
* @param pool The pool.
*
* @return Allow-Events header.
*/
PJ_DECL(pjsip_allow_events_hdr*) pjsip_allow_events_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_allow_events_hdr*)
pjsip_allow_events_hdr_create(pj_pool_t *pool);
/**
@ -78,7 +82,9 @@ PJ_DECL(pjsip_allow_events_hdr*) pjsip_allow_events_hdr_create(pj_pool_t *pool);
*/
typedef struct pjsip_sub_state_hdr
{
/** Standard header fields. */
PJSIP_DECL_HDR_MEMBER(struct pjsip_sub_state_hdr);
pj_str_t sub_state; /**< Subscription state. */
pj_str_t reason_param; /**< Optional termination reason. */
int expires_param; /**< Expires param, or -1. */

View File

@ -26,6 +26,15 @@
#include <pjsip-simple/types.h>
#include <pjlib-util/xml.h>
/**
* @defgroup PJSIP_ISCOMPOSING Message Composition Indication (RFC 3994)
* @ingroup PJSIP_SIMPLE
* @brief Support for Indication of Message Composition (RFC 3994)
* @{
*
* This implements message composition indication, as described in
* RFC 3994.
*/
PJ_BEGIN_DECL
@ -113,6 +122,10 @@ PJ_DECL(pj_status_t) pjsip_iscomposing_parse( pj_pool_t *pool,
int *p_refresh );
/**
* @}
*/
PJ_END_DECL

View File

@ -32,6 +32,7 @@ PJ_BEGIN_DECL
/**
* @defgroup PJSIP_SIMPLE_PIDF PIDF/Presence Information Data Format (RFC 3863)
* @ingroup PJSIP_SIMPLE
* @brief Support for PIDF/Presence Information Data Format (RFC 3863)
* @{
*
* This file provides tools for manipulating Presence Information Data

View File

@ -34,6 +34,7 @@ PJ_BEGIN_DECL
/**
* @defgroup PJSIP_SIMPLE_PRES SIP Extension for Presence (RFC 3856)
* @ingroup PJSIP_SIMPLE
* @brief Support for SIP Extension for Presence (RFC 3856)
* @{
*
* This module contains the implementation of SIP Presence Extension as
@ -67,6 +68,9 @@ PJ_DECL(pj_status_t) pjsip_pres_init_module(pjsip_endpoint *endpt,
PJ_DECL(pjsip_module*) pjsip_pres_instance(void);
/**
* Maximum presence status info.
*/
#define PJSIP_PRES_STATUS_MAX_INFO 8
/**

View File

@ -31,6 +31,7 @@ PJ_BEGIN_DECL
/**
* @defgroup PJSIP_SIMPLE_XPIDF XPIDF/Presence Information Data Format
* @ingroup PJSIP_SIMPLE
* @brief Support for XPIDF/Presence Information Data Format
* @{
*
* This is an old presence data format as described in:

View File

@ -19,21 +19,73 @@
#ifndef __SIP_INVITE_SESSION_H__
#define __SIP_INVITE_SESSION_H__
/**
* @file sip_inv.h
* @brief INVITE sessions
*/
#include <pjsip/sip_dialog.h>
#include <pjmedia/sdp_neg.h>
/**
* @defgroup PJSIP_HIGH_UA User Agent Library
* @ingroup PJSIP
* @brief Mid-level User Agent Library.
*
* This is the high level user agent library, which consists of:
* - @ref PJSIP_INV, to encapsulate INVITE sessions and SDP
* negotiation in the session,
* - @ref PJSUA_REGC, high level client registration API, and
* - @ref PJSUA_XFER.
*
* More detailed information is explained in
* <A HREF="/docs.htm">PJSIP Developer's Guide</A>
* PDF document, and readers are encouraged to read the document to
* get the concept behind dialog, dialog usages, and INVITE sessions.
*
* The User Agent Library is implemented in <b>pjsip-ua</b> static
* library.
*/
/**
* @defgroup PJSIP_INV INVITE Session
* @ingroup PJSIP_HIGH_UA
* @brief Provides INVITE session management.
* @{
*
* The INVITE session uses the @ref PJSIP_DIALOG framework to manage
* the underlying dialog, and is one type of usages that can use
* a particular dialog instance (other usages are event subscription,
* discussed in @ref PJSIP_EVENT_NOT). The INVITE session manages
* the life-time of the session, and also manages the SDP negotiation.
*
* Application must link with <b>pjsip-ua</b> static library to use this API.
*
* More detailed information is explained in
* <A HREF="/docs.htm">PJSIP Developer's Guide</A>
* PDF document, and readers are encouraged to read the document to
* get the concept behind dialog, dialog usages, and INVITE sessions.
*
* The INVITE session does NOT manage media. If application wants to
* use API that encapsulates both signaling and media in a very easy
* to use API, it can use @ref PJSUA_LIB for this purpose.
*/
PJ_BEGIN_DECL
typedef enum pjsip_inv_state pjsip_inv_state;
/**
* @see pjsip_inv_session
*/
typedef struct pjsip_inv_session pjsip_inv_session;
typedef struct pjsip_inv_callback pjsip_inv_callback;
/**
* This enumeration describes invite session state.
*/
enum pjsip_inv_state
typedef enum pjsip_inv_state
{
PJSIP_INV_STATE_NULL, /**< Before INVITE is sent or received */
PJSIP_INV_STATE_CALLING, /**< After INVITE is sent */
@ -42,14 +94,14 @@ enum pjsip_inv_state
PJSIP_INV_STATE_CONNECTING, /**< After 2xx is sent/received. */
PJSIP_INV_STATE_CONFIRMED, /**< After ACK is sent/received. */
PJSIP_INV_STATE_DISCONNECTED, /**< Session is terminated. */
};
} pjsip_inv_state;
/**
* This structure contains callbacks to be registered by application to
* receieve notifications from the framework about various events in
* the invite session.
*/
struct pjsip_inv_callback
typedef struct pjsip_inv_callback
{
/**
* This callback is called when the invite sesion state has changed.
@ -118,7 +170,9 @@ struct pjsip_inv_callback
*/
void (*on_media_update)(pjsip_inv_session *inv_ses,
pj_status_t status);
};
} pjsip_inv_callback;
/**
@ -187,7 +241,7 @@ struct pjsip_inv_session
* occurences of events in invite sessions.
*
* @param endpt The endpoint instance.
* @param callback Callback structure.
* @param cb Callback structure.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
@ -310,7 +364,7 @@ PJ_DECL(pj_status_t) pjsip_inv_verify_request( pjsip_rx_data *rdata,
* in rdata. The invite session needs to inspect the
* received request to see if the request contains
* features that it supports.
* @param sdp If application has determined its media capability,
* @param local_sdp If application has determined its media capability,
* it can specify this capability in this argument.
* If SDP is received in the initial INVITE, the UAS
* capability specified in this argument doesn't have to
@ -563,6 +617,9 @@ PJ_DECL(const char *) pjsip_inv_state_name(pjsip_inv_state state);
PJ_END_DECL
/**
* @}
*/
#endif /* __SIP_INVITE_SESSION_H__ */

View File

@ -26,18 +26,22 @@
#include <pjsip/sip_types.h>
#include <pjsip/sip_auth.h>
//#include <pjsip/sip_ua.h>
PJ_BEGIN_DECL
/**
* @defgroup PJSUA_REGC SIP Registration Client
* @ingroup PJSUA
* @defgroup PJSUA_REGC Client Registration
* @ingroup PJSIP_HIGH_UA
* @brief High Layer API for performing client registration.
* @{
* \brief
* API for performing registration for user agent.
*
* This provides API for performing client registration. Application must
* link with <b>pjsip-ua</b> static library to use this API.
*/
PJ_BEGIN_DECL
/** Typedef for client registration data. */
typedef struct pjsip_regc pjsip_regc;
@ -56,15 +60,15 @@ typedef struct pjsip_regc pjsip_regc;
*/
struct pjsip_regc_cbparam
{
pjsip_regc *regc;
void *token;
int code;
pj_status_t status;
pj_str_t reason;
pjsip_rx_data *rdata;
int contact_cnt;
int expiration;
pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT];
pjsip_regc *regc; /**< Client registration structure. */
void *token; /**< Arbitrary token. */
pj_status_t status; /**< Error status. */
int code; /**< SIP status code received. */
pj_str_t reason; /**< SIP reason phrase received. */
pjsip_rx_data *rdata; /**< The complete received response. */
int expiration;/**< Next expiration interval. */
int contact_cnt;/**<Number of contacts in response. */
pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; /**< Contacts. */
};
@ -149,6 +153,7 @@ PJ_DECL(pj_pool_t*) pjsip_regc_get_pool(pjsip_regc *regc);
* perform the registration.
*
* @param regc The client registration structure.
* @param srv_url Server URL.
* @param from_url The person performing the registration, must be a SIP URL type.
* @param to_url The address of record for which the registration is targetd, must
* be a SIP/SIPS URL.
@ -259,4 +264,8 @@ PJ_DECL(pj_status_t) pjsip_regc_send(pjsip_regc *regc, pjsip_tx_data *tdata);
PJ_END_DECL
/**
* @}
*/
#endif /* __PJSIP_REG_H__ */

View File

@ -28,6 +28,19 @@
#include <pjsip-simple/evsub.h>
#include <pjsip/sip_msg.h>
/**
* @defgroup PJSUA_XFER Call Transfer
* @ingroup PJSIP_HIGH_UA
* @brief Provides call transfer functionality.
* @{
*
* This implements call transfer functionality to INVITE sessions. The call
* transfer functionality uses SIP Event Subscription framework for
* managing call transfer status.
*
* Application must link with <b>pjsip-ua</b> AND <b>pjsip-simple</b> static
* libraries to use call transfer functionality.
*/
PJ_BEGIN_DECL
@ -168,8 +181,11 @@ PJ_DECL(pj_status_t) pjsip_xfer_send_request( pjsip_evsub *sub,
pjsip_tx_data *tdata);
PJ_END_DECL
/**
* @}
*/
#endif /* __PJSIP_XFER_H__ */

View File

@ -29,14 +29,20 @@
PJ_BEGIN_DECL
/**
* @addtogroup PJSIP_AUTH Authentication Framework
* @ingroup PJSIP_CORE
* @brief Client and server side authentication framework.
*/
/**
* @defgroup PJSIP_AUTH_API Authorization API's
* @defgroup PJSIP_AUTH_API Authentication API's
* @ingroup PJSIP_AUTH
* @brief Structures and functions to perform authentication.
* @{
*/
/* Length of digest string. */
/** Length of digest string. */
#define PJSIP_MD5STRLEN 32
@ -80,6 +86,7 @@ struct pjsip_cred_info
*/
typedef struct pjsip_cached_auth_hdr
{
/** Standard list member */
PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth_hdr);
pjsip_method method; /**< To quickly see the method. */
@ -100,6 +107,7 @@ typedef struct pjsip_cached_auth_hdr
*/
typedef struct pjsip_cached_auth
{
/** Standard list member */
PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth);
pj_str_t realm; /**< Realm. */

View File

@ -24,21 +24,23 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_MSG_AUTHORIZATION Header Field: Authorization and Proxy-Authorization
* @brief Authorization and Proxy-Authorization header field.
* @ingroup PJSIP_MSG
* @addtogroup PJSIP_MSG_HDR
* @{
*/
/**
* Common credential.
* Common credential structure represents common credential fields
* present in Authorization/Proxy-Authorization header.
*/
struct pjsip_common_credential
{
pj_str_t realm;
pjsip_param other_param;
pj_str_t realm; /**< Credential's realm. */
pjsip_param other_param; /**< Other parameters. */
};
/**
* @see pjsip_common_credential
*/
typedef struct pjsip_common_credential pjsip_common_credential;
@ -48,19 +50,22 @@ typedef struct pjsip_common_credential pjsip_common_credential;
*/
struct pjsip_digest_credential
{
pj_str_t realm;
pjsip_param other_param;
pj_str_t username;
pj_str_t nonce;
pj_str_t uri;
pj_str_t response;
pj_str_t algorithm;
pj_str_t cnonce;
pj_str_t opaque;
pj_str_t qop;
pj_str_t nc;
pj_str_t realm; /**< Realm of the credential */
pjsip_param other_param; /**< Other parameters. */
pj_str_t username; /**< Username parameter. */
pj_str_t nonce; /**< Nonce parameter. */
pj_str_t uri; /**< URI parameter. */
pj_str_t response; /**< Response digest. */
pj_str_t algorithm; /**< Algorithm. */
pj_str_t cnonce; /**< Cnonce. */
pj_str_t opaque; /**< Opaque value. */
pj_str_t qop; /**< Quality of protection. */
pj_str_t nc; /**< Nonce count. */
};
/**
* @see pjsip_digest_credential
*/
typedef struct pjsip_digest_credential pjsip_digest_credential;
/**
@ -69,14 +74,17 @@ typedef struct pjsip_digest_credential pjsip_digest_credential;
*/
struct pjsip_pgp_credential
{
pj_str_t realm;
pjsip_param other_param;
pj_str_t version;
pj_str_t signature;
pj_str_t signed_by;
pj_str_t nonce;
pj_str_t realm; /**< Realm. */
pjsip_param other_param; /**< Other parameters. */
pj_str_t version; /**< Version parameter. */
pj_str_t signature; /**< Signature parameter. */
pj_str_t signed_by; /**< Signed by parameter. */
pj_str_t nonce; /**< Nonce parameter. */
};
/**
* @see pjsip_pgp_credential
*/
typedef struct pjsip_pgp_credential pjsip_pgp_credential;
/**
@ -85,16 +93,24 @@ typedef struct pjsip_pgp_credential pjsip_pgp_credential;
*/
struct pjsip_authorization_hdr
{
/** Standard header fiends. */
PJSIP_DECL_HDR_MEMBER(struct pjsip_authorization_hdr);
/** Authorization scheme. */
pj_str_t scheme;
/** Type of credentials, depending on the scheme. */
union
{
pjsip_common_credential common;
pjsip_digest_credential digest;
pjsip_pgp_credential pgp;
pjsip_common_credential common; /**< Common fields. */
pjsip_digest_credential digest; /**< Digest credentials. */
pjsip_pgp_credential pgp; /**< PGP credentials. */
} credential;
};
/**
* @see pjsip_authorization_hdr.
*/
typedef struct pjsip_authorization_hdr pjsip_authorization_hdr;
/** SIP Proxy-Authorization header shares the same structure as SIP
@ -104,36 +120,34 @@ typedef struct pjsip_authorization_hdr pjsip_proxy_authorization_hdr;
/**
* Create SIP Authorization header.
* @param pool Pool where memory will be allocated from.
* @return SIP Authorization header.
* @param pool Pool where memory will be allocated from.
* @return SIP Authorization header.
*/
PJ_DECL(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_authorization_hdr*)
pjsip_authorization_hdr_create(pj_pool_t *pool);
/**
* Create SIP Proxy-Authorization header.
* @param pool Pool where memory will be allocated from.
* @return SIP Proxy-Authorization header.
* @param pool Pool where memory will be allocated from.
* @return SIP Proxy-Authorization header.
*/
PJ_DECL(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_proxy_authorization_hdr*)
pjsip_proxy_authorization_hdr_create(pj_pool_t *pool);
/**
* @}
* This structure describes common fields in authentication challenge
* headers (WWW-Authenticate and Proxy-Authenticate).
*/
/**
* @defgroup PJSIP_WWW_AUTH Header Field: Proxy-Authenticate and WWW-Authenticate
* @brief Proxy-Authenticate and WWW-Authenticate.
* @ingroup PJSIP_MSG
* @{
*/
struct pjsip_common_challenge
{
pj_str_t realm;
pjsip_param other_param;
pj_str_t realm; /**< Realm for the challenge. */
pjsip_param other_param; /**< Other parameters. */
};
/**
* @see pjsip_common_challenge
*/
typedef struct pjsip_common_challenge pjsip_common_challenge;
/**
@ -142,16 +156,19 @@ typedef struct pjsip_common_challenge pjsip_common_challenge;
*/
struct pjsip_digest_challenge
{
pj_str_t realm;
pjsip_param other_param;
pj_str_t domain;
pj_str_t nonce;
pj_str_t opaque;
int stale;
pj_str_t algorithm;
pj_str_t qop;
pj_str_t realm; /**< Realm for the challenge. */
pjsip_param other_param; /**< Other parameters. */
pj_str_t domain; /**< Domain. */
pj_str_t nonce; /**< Nonce challenge. */
pj_str_t opaque; /**< Opaque value. */
int stale; /**< Stale parameter. */
pj_str_t algorithm; /**< Algorithm parameter. */
pj_str_t qop; /**< Quality of protection. */
};
/**
* @see pjsip_digest_challenge
*/
typedef struct pjsip_digest_challenge pjsip_digest_challenge;
/**
@ -160,14 +177,17 @@ typedef struct pjsip_digest_challenge pjsip_digest_challenge;
*/
struct pjsip_pgp_challenge
{
pj_str_t realm;
pjsip_param other_param;
pj_str_t version;
pj_str_t micalgorithm;
pj_str_t pubalgorithm;
pj_str_t nonce;
pj_str_t realm; /**< Realm for the challenge. */
pjsip_param other_param; /**< Other parameters. */
pj_str_t version; /**< PGP version. */
pj_str_t micalgorithm; /**< micalgorithm parameter. */
pj_str_t pubalgorithm; /**< pubalgorithm parameter. */
pj_str_t nonce; /**< Nonce challenge. */
};
/**
* @see pjsip_pgp_challenge
*/
typedef struct pjsip_pgp_challenge pjsip_pgp_challenge;
/**
@ -176,33 +196,51 @@ typedef struct pjsip_pgp_challenge pjsip_pgp_challenge;
*/
struct pjsip_www_authenticate_hdr
{
/** Standard header fields. */
PJSIP_DECL_HDR_MEMBER(struct pjsip_www_authenticate_hdr);
/** Authentication scheme */
pj_str_t scheme;
/** This union contains structures that are only relevant
depending on the value of the scheme being used.
*/
union
{
pjsip_common_challenge common;
pjsip_digest_challenge digest;
pjsip_pgp_challenge pgp;
pjsip_common_challenge common; /**< Common fields. */
pjsip_digest_challenge digest; /**< Digest challenge. */
pjsip_pgp_challenge pgp; /**< PGP challenge. */
} challenge;
};
/**
* WWW-Authenticate header.
*/
typedef struct pjsip_www_authenticate_hdr pjsip_www_authenticate_hdr;
/**
* Proxy-Authenticate header.
*/
typedef struct pjsip_www_authenticate_hdr pjsip_proxy_authenticate_hdr;
/**
* Create SIP WWW-Authenticate header.
* @param pool Pool where memory will be allocated from.
* @return SIP WWW-Authenticate header.
*
* @param pool Pool where memory will be allocated from.
* @return SIP WWW-Authenticate header.
*/
PJ_DECL(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_www_authenticate_hdr*)
pjsip_www_authenticate_hdr_create(pj_pool_t *pool);
/**
* Create SIP Proxy-Authenticate header.
* @param pool Pool where memory will be allocated from.
* @return SIP Proxy-Authenticate header.
*
* @param pool Pool where memory will be allocated from.
* @return SIP Proxy-Authenticate header.
*/
PJ_DECL(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_proxy_authenticate_hdr*)
pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool);
/**
* @}

View File

@ -28,18 +28,14 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_AUTH_PARSER_MODULE Authorization Parser Module
* @ingroup PJSIP_AUTH
* @{
*/
/**
* Initialize and register authorization parser module.
* This will register parser handler for various Authorization related headers
* such as Authorization, WWW-Authenticate, Proxy-Authorizization, and
* Proxy-Authenticate headers.
*
* This function is called automatically by the main SIP parser.
*
* @return PJ_SUCCESS or the appropriate status code.
*/
PJ_DECL(pj_status_t) pjsip_auth_init_parser(void);
@ -50,36 +46,25 @@ PJ_DECL(pj_status_t) pjsip_auth_init_parser(void);
PJ_DECL(void) pjsip_auth_deinit_parser();
extern const pj_str_t pjsip_USERNAME_STR,
pjsip_REALM_STR,
pjsip_NONCE_STR,
pjsip_URI_STR,
pjsip_RESPONSE_STR,
pjsip_ALGORITHM_STR,
pjsip_DOMAIN_STR,
pjsip_STALE_STR,
pjsip_QOP_STR,
pjsip_CNONCE_STR,
pjsip_OPAQUE_STR,
pjsip_NC_STR,
pjsip_TRUE_STR,
pjsip_FALSE_STR,
pjsip_DIGEST_STR,
pjsip_PGP_STR,
pjsip_MD5_STR,
pjsip_AUTH_STR;
/*
extern const pj_str_t pjsip_QUOTED_TRUE_STR,
pjsip_QUOTED_FALSE_STR,
pjsip_QUOTED_DIGEST_STR,
pjsip_QUOTED_PGP_STR,
pjsip_QUOTED_MD5_STR,
pjsip_QUOTED_AUTH_STR;
*/
/**
* @}
*/
extern const pj_str_t pjsip_USERNAME_STR, /**< "username" string const. */
pjsip_REALM_STR, /**< "realm" string const. */
pjsip_NONCE_STR, /**< "nonce" string const. */
pjsip_URI_STR, /**< "uri" string const. */
pjsip_RESPONSE_STR, /**< "response" string const. */
pjsip_ALGORITHM_STR,/**< "algorithm" string const. */
pjsip_DOMAIN_STR, /**< "domain" string const. */
pjsip_STALE_STR, /**< "stale" string const. */
pjsip_QOP_STR, /**< "qop" string const. */
pjsip_CNONCE_STR, /**< "cnonce" string const. */
pjsip_OPAQUE_STR, /**< "opaque" string const. */
pjsip_NC_STR, /**< "nc" string const. */
pjsip_TRUE_STR, /**< "true" string const. */
pjsip_FALSE_STR, /**< "false" string const. */
pjsip_DIGEST_STR, /**< "digest" string const. */
pjsip_PGP_STR, /**< "pgp" string const. */
pjsip_MD5_STR, /**< "md5" string const. */
pjsip_AUTH_STR; /**< "auth" string const. */
PJ_END_DECL

View File

@ -19,8 +19,43 @@
#ifndef __PJSIP_SIP_CONFIG_H__
#define __PJSIP_SIP_CONFIG_H__
/**
* @file sip_config.h
* @brief Compile time configuration.
*/
#include <pj/config.h>
/**
* @defgroup PJSIP PJSIP Library Collection
*/
/**
* @defgroup PJSIP_CORE Core SIP Library
* @ingroup PJSIP
* @brief The core framework from which all other SIP components depends on.
*
* The PJSIP Core library only provides transport framework, event
* dispatching/module framework, and SIP message representation and
* parsing. It doesn't do anything usefull in itself!
*
* If application wants the stack to do anything usefull at all,
* it must registers @ref PJSIP_MOD to the core library. Examples
* of modules are @ref PJSIP_TRANSACT and @ref PJSUA_UA.
*/
/**
* @defgroup PJSIP_BASE Base Types
* @ingroup PJSIP_CORE
* @brief Basic PJSIP types and configurations.
*/
/**
* @defgroup PJSIP_CONFIG Compile Time Configuration
* @ingroup PJSIP_BASE
* @brief PJSIP compile time configurations.
* @{
*/
/**
* Specify maximum transaction count in transaction hash table.
* Default value is 16*1024
@ -76,6 +111,14 @@
#endif
/**
* Maximum packet length.
*/
#ifndef PJSIP_MAX_PKT_LEN
# define PJSIP_MAX_PKT_LEN 1500
#endif
/* Endpoint. */
#define PJSIP_MAX_TIMER_COUNT (2*PJSIP_MAX_TSX_COUNT + 2*PJSIP_MAX_DIALOG_COUNT)
@ -84,7 +127,6 @@
/* Transport related constants. */
#define PJSIP_MAX_PKT_LEN 1500
#define PJSIP_POOL_RDATA_LEN 4000
#define PJSIP_POOL_RDATA_INC 4000
#define PJSIP_POOL_LEN_TRANSPORT 512
@ -141,22 +183,22 @@
//#define PJSIP_T1_TIMEOUT 15000
//#define PJSIP_T2_TIMEOUT 60000
/* T1 timeout value. */
/** Transaction T1 timeout value. */
#if !defined(PJSIP_T1_TIMEOUT)
# define PJSIP_T1_TIMEOUT 500
#endif
/* T2 timeout value. */
/** Transaction T2 timeout value. */
#if !defined(PJSIP_T2_TIMEOUT)
# define PJSIP_T2_TIMEOUT 4000
#endif
/* Completed timer for non-INVITE */
/** Transaction completed timer for non-INVITE */
#if !defined(PJSIP_T4_TIMEOUT)
# define PJSIP_T4_TIMEOUT 5000
#endif
/* Completed timer for INVITE */
/** Transaction completed timer for INVITE */
#if !defined(PJSIP_TD_TIMEOUT)
# define PJSIP_TD_TIMEOUT 32000
#endif
@ -166,7 +208,7 @@
* Authorization
*/
/*
/**
* If this flag is set, the stack will keep the Authorization/Proxy-Authorization
* headers that are sent in a cache. Future requests with the same realm and
* the same method will use the headers in the cache (as long as no qop is
@ -182,7 +224,7 @@
# define PJSIP_AUTH_HEADER_CACHING 1
#endif
/*
/**
* If this flag is set, the stack will proactively send Authorization/Proxy-
* Authorization header for next requests. If next request has the same method
* with any of previous requests, then the last header which is saved in
@ -203,7 +245,7 @@
# define PJSIP_AUTH_AUTO_SEND_NEXT 1
#endif
/*
/**
* Support qop="auth" directive.
* This option also requires client to cache the last challenge offered by
* server.
@ -215,6 +257,10 @@
#endif
/**
* @}
*/
#include <pj/config.h>

View File

@ -31,6 +31,30 @@
#include <pj/sock.h>
#include <pj/assert.h>
/**
* @defgroup PJSIP_DIALOG Base Dialog
* @ingroup PJSIP_UA
* @brief The base dialog framework to support dialog usages.
* @{
*
* The base dialog framework provides management for base dialog
* properties such as <b>From</b> header, <b>To</b> header, <b>CSeq</b>
* sequencing, <b>Call-ID</b> header, <b>Contact</b> header management,
* dialog <b>route-set</b> management, and common <b>authentication</b>.
* This basic dialog functionality will be shared by all <b>dialog
* usages</b> of a particular dialog.
*
* More detailed information is explained in
* <A HREF="/docs.htm">PJSIP Developer's Guide</A>
* PDF document, and readers are encouraged to read the document to
* get the concept behind dialog, dialog usages, and INVITE sessions.
*
* Application MUST initialize the user agent layer module by calling
* #pjsip_ua_init_module() before using any of the dialog API, and link
* the application with with <b>pjsip-core</b> library.
*/
PJ_BEGIN_DECL
@ -54,7 +78,10 @@ typedef struct pjsip_dlg_party
*/
enum pjsip_dialog_state
{
/** Dialog is not established. */
PJSIP_DIALOG_STATE_NULL,
/** Dialog has been established (probably early) */
PJSIP_DIALOG_STATE_ESTABLISHED,
};
@ -86,7 +113,7 @@ struct pjsip_dialog
pjsip_user_agent *ua; /**< User agent instance. */
pjsip_endpoint *endpt; /**< Endpoint instance. */
/* The dialog set. */
/** The dialog set which this dialog belongs (opaque type). */
void *dlg_set;
/* Dialog's session properties. */

View File

@ -27,18 +27,18 @@
#include <pjsip/sip_transport.h>
#include <pjsip/sip_resolve.h>
/**
* @defgroup PJSIP_CORE_CORE At the Very Core
* @ingroup PJSIP_CORE
* @brief The very core of PJSIP.
*/
PJ_BEGIN_DECL
/**
* @defgroup PJSIP SIP Stack Core
* Implementation of core SIP protocol stack processing.
*/
/**
* @defgroup PJSIP_ENDPT SIP Endpoint
* @ingroup PJSIP
* @brief
* Representation of SIP node instance.
* @defgroup PJSIP_ENDPT Endpoint
* @ingroup PJSIP_CORE_CORE
* @brief The master, owner of all objects
*
* SIP Endpoint instance (pjsip_endpoint) can be viewed as the master/owner of
* all SIP objects in an application. It performs the following roles:
@ -286,7 +286,7 @@ PJ_DECL(pj_status_t) pjsip_endpt_create_tdata( pjsip_endpoint *endpt,
*
* Note: at the moment we don't have implementation of RFC 3263 yet!
*
* @param resolver The resolver engine.
* @param endpt The endpoint instance.
* @param pool The pool to allocate resolver job.
* @param target The target specification to be resolved.
* @param token A user defined token to be passed back to callback function.
@ -418,6 +418,11 @@ PJ_DECL(void) pjsip_endpt_dump( pjsip_endpoint *endpt, pj_bool_t detail );
/**
* @}
*/
/**
* Log an error.
*/
@ -436,10 +441,6 @@ PJ_DECL(void) pjsip_endpt_log_error( pjsip_endpoint *endpt,
PJ_LOG(4,expr); \
} while (0)
/**
* @}
*/
/*
* Internal functions.
*/

View File

@ -19,10 +19,22 @@
#ifndef __PJSIP_SIP_ERRNO_H__
#define __PJSIP_SIP_ERRNO_H__
/**
* @file sip_errno.h
* @brief PJSIP Specific Error Code
*/
#include <pj/errno.h>
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_CORE_ERRNO PJSIP Specific Error Code
* @ingroup PJSIP_BASE
* @brief PJSIP specific error constants.
* @{
*/
/*
* PJSIP error codes occupies 170000 - 219000, and mapped as follows:
* - 170100 - 170799: mapped to SIP status code in response msg.
@ -382,4 +394,9 @@ PJ_BEGIN_DECL
PJ_END_DECL
/**
* @}
*/
#endif /* __PJSIP_SIP_ERRNO_H__ */

View File

@ -27,8 +27,9 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_EVENT SIP Event
* @ingroup PJSIP
* @defgroup PJSIP_EVENT Event
* @ingroup PJSIP_CORE_CORE
* @brief Representation of events as they are distributed among modules.
* @{
*/
#include <pj/types.h>
@ -64,8 +65,7 @@ typedef enum pjsip_event_id_e
/**
* \struct
* \brief Event descriptor to fully identify a SIP event.
* This structure describe event descriptor to fully identify a SIP event.
*
* Events are the only way for a lower layer object to inform something
* to higher layer objects. Normally this is achieved by means of callback,
@ -85,8 +85,8 @@ struct pjsip_event
*/
pjsip_event_id_e type;
/*
* The event body.
/**
* The event body as union, which fields depends on the event type.
* By convention, the first member of each struct in the union must be
* the pointer which is relevant to the event.
*/
@ -216,7 +216,7 @@ struct pjsip_event
/**
* Get the event string from the event ID.
* @param e the event ID.
* @notes defined in sip_util.c
* @note defined in sip_util.c
*/
PJ_DEF(const char *) pjsip_event_str(pjsip_event_id_e e);

View File

@ -29,16 +29,26 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_MOD SIP Modules
* @ingroup PJSIP
* @defgroup PJSIP_MOD Modules
* @ingroup PJSIP_CORE_CORE
* @brief Modules are the primary means to extend PJSIP!
* @{
* Modules are the primary means to extend PJSIP. Without modules, PJSIP
* would not know how to handle messages, and will simply discard all
* incoming messages.
*
* Modules are registered by creating and initializing #pjsip_module
* structure, and register the structure to PJSIP with
* #pjsip_endpt_register_module().
*
* The <A HREF="/docs.htm">PJSIP Developer's Guide</A>
* has a thorough discussion on this subject, and readers are encouraged
* to read the document for more information.
*/
/**
* Module registration structure, which is passed by the module to the
* endpoint during the module registration process. This structure enables
* the endpoint to query the module capability and to further communicate
* with the module.
* The declaration for SIP module. This structure would be passed to
* #pjsip_endpt_register_module() to register the module to PJSIP.
*/
struct pjsip_module
{
@ -46,12 +56,16 @@ struct pjsip_module
PJ_DECL_LIST_MEMBER(struct pjsip_module);
/**
* Module name.
* Module name to identify the module.
*
* This field MUST be initialized before registering the module.
*/
pj_str_t name;
/**
* Module ID.
* Module ID. Application must initialize this field with -1 before
* registering the module to PJSIP. After the module is registered,
* this field will contain a unique ID to identify the module.
*/
int id;
@ -59,11 +73,15 @@ struct pjsip_module
* Integer number to identify module initialization and start order with
* regard to other modules. Higher number will make the module gets
* initialized later.
*
* This field MUST be initialized before registering the module.
*/
int priority;
/**
* Pointer to function to be called to initialize the module.
* Optional function to be called to initialize the module. This function
* will be called by endpoint during module registration. If the value
* is NULL, then it's equal to returning PJ_SUCCESS.
*
* @param endpt The endpoint instance.
* @return Module should return PJ_SUCCESS to indicate success.
@ -71,23 +89,29 @@ struct pjsip_module
pj_status_t (*load)(pjsip_endpoint *endpt);
/**
* Pointer to function to be called to start the module.
* Optional function to be called to start the module. This function
* will be called by endpoint during module registration. If the value
* is NULL, then it's equal to returning PJ_SUCCESS.
*
* @return Module should return zero to indicate success.
*/
pj_status_t (*start)(void);
/**
* Pointer to function to be called to deinitialize the module before
* it is unloaded.
* Optional function to be called to deinitialize the module before
* it is unloaded. This function will be called by endpoint during
* module unregistration. If the value is NULL, then it's equal to
* returning PJ_SUCCESS.
*
* @return Module should return PJ_SUCCESS to indicate success.
*/
pj_status_t (*stop)(void);
/**
* Pointer to function to be called to deinitialize the module before
* it is unloaded.
* Optional function to be called to deinitialize the module before
* it is unloaded. This function will be called by endpoint during
* module unregistration. If the value is NULL, then it's equal to
* returning PJ_SUCCESS.
*
* @param mod The module.
*
@ -96,7 +120,7 @@ struct pjsip_module
pj_status_t (*unload)(void);
/**
* Called to process incoming request.
* Optional function to be called to process incoming request message.
*
* @param rdata The incoming message.
*
@ -107,7 +131,7 @@ struct pjsip_module
pj_bool_t (*on_rx_request)(pjsip_rx_data *rdata);
/**
* Called to processed incoming response.
* Optional function to be called to process incoming response message.
*
* @param rdata The incoming message.
*
@ -118,7 +142,8 @@ struct pjsip_module
pj_bool_t (*on_rx_response)(pjsip_rx_data *rdata);
/**
* Called to process outgoing request.
* Optional function to be called when transport layer is about to
* transmit outgoing request message.
*
* @param tdata The outgoing request message.
*
@ -129,7 +154,8 @@ struct pjsip_module
pj_status_t (*on_tx_request)(pjsip_tx_data *tdata);
/**
* Called to process outgoing response message.
* Optional function to be called when transport layer is about to
* transmit outgoing response message.
*
* @param tdata The outgoing response message.
*
@ -140,8 +166,9 @@ struct pjsip_module
pj_status_t (*on_tx_response)(pjsip_tx_data *tdata);
/**
* Called when this module is acting as transaction user for the specified
* transaction, when the transaction's state has changed.
* Optional function to be called when this module is acting as
* transaction user for the specified transaction, when the
* transaction's state has changed.
*
* @param tsx The transaction.
* @param event The event which has caused the transaction state
@ -157,10 +184,29 @@ struct pjsip_module
*/
enum pjsip_module_priority
{
/**
* This is the priority used by transport layer.
*/
PJSIP_MOD_PRIORITY_TRANSPORT_LAYER = 8,
/**
* This is the priority used by transaction layer.
*/
PJSIP_MOD_PRIORITY_TSX_LAYER = 16,
/**
* This is the priority used by the user agent and proxy layer.
*/
PJSIP_MOD_PRIORITY_UA_PROXY_LAYER = 32,
/**
* This is the priority used by the dialog usages.
*/
PJSIP_MOD_PRIORITY_DIALOG_USAGE = 48,
/**
* This is the recommended priority to be used by applications.
*/
PJSIP_MOD_PRIORITY_APPLICATION = 64,
};

View File

@ -20,7 +20,7 @@
#define __PJSIP_SIP_MSG_H__
/**
* @file sip_msg.h
* @file pjsip/sip_msg.h
* @brief SIP Message Structure.
*/
@ -31,8 +31,9 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_MSG SIP Message Structure
* @ingroup PJSIP
* @defgroup PJSIP_MSG Messaging Elements
* @ingroup PJSIP_CORE
* @brief Various SIP message elements such as methods, headers, URIs, etc.
* @{
*/
@ -154,8 +155,8 @@ PJ_DECL(int) pjsip_method_cmp( const pjsip_method *m1, const pjsip_method *m2);
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR Header Fields General Structure.
* @brief General Header Fields Structure.
* @defgroup PJSIP_MSG_HDR Header Fields
* @brief Declarations for various SIP header fields.
* @ingroup PJSIP_MSG
* @{
*/
@ -461,8 +462,8 @@ PJ_DECL(const pj_str_t*) pjsip_get_status_text(int status_code);
///////////////////////////////////////////////////////////////////////////////
/**
* @addtogroup PJSIP_MSG_MEDIA Media Type
* @brief Media type definitions and manipulations.
* @addtogroup PJSIP_MSG_MEDIA Media/MIME Type
* @brief Media/MIME type declaration and manipulations.
* @ingroup PJSIP_MSG
* @{
*/
@ -654,7 +655,7 @@ PJ_DECL(pjsip_msg_body*) pjsip_msg_body_create( pj_pool_t *pool,
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_MSG Message Structure
* @brief Message structure and operations.
* @brief SIP message (request and response) structure and operations.
* @ingroup PJSIP_MSG
* @{
*/
@ -845,9 +846,7 @@ PJ_DECL(pj_ssize_t) pjsip_msg_print(const pjsip_msg *msg,
///////////////////////////////////////////////////////////////////////////////
/**
* @addtogroup PJSIP_MSG_HDR_GEN Header Field: Generic
* @brief Generic header field which contains header name and value.
* @ingroup PJSIP_MSG
* @addtogroup PJSIP_MSG_HDR
* @{
*/
@ -904,17 +903,8 @@ pjsip_generic_string_hdr_init( pj_pool_t *pool,
const pj_str_t *hvalue);
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @addtogroup PJSIP_MSG_HDR_GEN_INT Header Field: Generic Integer
* @brief Generic header field which contains header name and value.
* @ingroup PJSIP_MSG
* @{
*/
/**
* Generic SIP header, which contains hname and a string hvalue.
@ -964,26 +954,25 @@ PJ_DECL(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_init( pj_pool_t *pool,
const pj_str_t *hname,
int value );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_GENERIC_LIST Header Field: Generic string list.
* @brief Header with list of strings separated with comma
* @ingroup PJSIP_MSG
* @{
*/
/** Maximum elements in the header array. */
#define PJSIP_GENERIC_ARRAY_MAX_COUNT 32
/**
* Generic array of string header.
*/
typedef struct pjsip_generic_array_hdr
{
/** Standard header fields. */
PJSIP_DECL_HDR_MEMBER(struct pjsip_generic_array_hdr);
unsigned count; /**< Number of elements. */
pj_str_t values[PJSIP_GENERIC_ARRAY_MAX_COUNT]; /**< Elements. */
/** Number of tags/elements. */
unsigned count;
/**< Tags/elements. */
pj_str_t values[PJSIP_GENERIC_ARRAY_MAX_COUNT];
} pjsip_generic_array_hdr;
/**
@ -1018,17 +1007,8 @@ PJ_DECL(pjsip_generic_array_hdr*) pjsip_generic_array_hdr_init(pj_pool_t *pool,
const pj_str_t *hname);
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_ACCEPT Header Field: Accept
* @brief Accept header field.
* @ingroup PJSIP_MSG
* @{
*/
/** Accept header. */
typedef pjsip_generic_array_hdr pjsip_accept_hdr;
@ -1061,16 +1041,11 @@ PJ_DECL(pjsip_accept_hdr*) pjsip_accept_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_accept_hdr*) pjsip_accept_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_ALLOW Header Field: Allow
* @brief Allow header field.
* @ingroup PJSIP_MSG
* @{
* Allow header.
*/
typedef pjsip_generic_array_hdr pjsip_allow_hdr;
@ -1102,17 +1077,8 @@ PJ_DECL(pjsip_allow_hdr*) pjsip_allow_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_allow_hdr*) pjsip_allow_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_CID Header Field: Call-ID
* @brief Call-ID header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* Call-ID header.
*/
@ -1151,17 +1117,8 @@ PJ_DECL(pjsip_cid_hdr*) pjsip_cid_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_CLEN Header Field: Content-Length
* @brief Content-Length header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* Content-Length header.
*/
@ -1197,17 +1154,7 @@ PJ_DECL(pjsip_clen_hdr*) pjsip_clen_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_CSEQ Header Field: CSeq
* @brief CSeq header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* CSeq header.
*/
@ -1243,17 +1190,7 @@ PJ_DECL(pjsip_cseq_hdr*) pjsip_cseq_hdr_create( pj_pool_t *pool );
PJ_DECL(pjsip_cseq_hdr*) pjsip_cseq_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_CONTACT Header Field: Contact
* @brief Contact header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* Contact header.
* In this library, contact header only contains single URI. If a message has
@ -1296,17 +1233,8 @@ PJ_DECL(pjsip_contact_hdr*) pjsip_contact_hdr_create( pj_pool_t *pool );
PJ_DECL(pjsip_contact_hdr*) pjsip_contact_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_CTYPE Header Field: Content-Type
* @brief Content-Type header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* Content-Type.
*/
@ -1342,17 +1270,7 @@ PJ_DECL(pjsip_ctype_hdr*) pjsip_ctype_hdr_create( pj_pool_t *pool );
PJ_DECL(pjsip_ctype_hdr*) pjsip_ctype_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_EXPIRES Header Field: Expires
* @brief Expires header field.
* @ingroup PJSIP_MSG
* @{
*/
/** Expires header. */
typedef pjsip_generic_int_hdr pjsip_expires_hdr;
@ -1387,17 +1305,8 @@ PJ_DECL(pjsip_expires_hdr*) pjsip_expires_hdr_init( pj_pool_t *pool,
int value );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_FROMTO Header Field: From/To
* @brief From and To header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* To or From header.
*/
@ -1468,30 +1377,23 @@ PJ_DECL(pjsip_to_hdr*) pjsip_to_hdr_init( pj_pool_t *pool,
/**
* Convert the header to a From header.
*
* @param pool The pool.
* @return "From" header.
* @param hdr The generic from/to header.
* @return "From" header.
*/
PJ_DECL(pjsip_from_hdr*) pjsip_fromto_hdr_set_from( pjsip_fromto_hdr *hdr );
/**
* Convert the header to a To header.
*
* @param pool The pool.
* @return "To" header.
* @param hdr The generic from/to header.
* @return "To" header.
*/
PJ_DECL(pjsip_to_hdr*) pjsip_fromto_hdr_set_to( pjsip_fromto_hdr *hdr );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_MAX_FORWARDS Header Field: Max-Forwards
* @brief Max-Forwards header field.
* @ingroup PJSIP_MSG
* @{
* Max-Forwards header.
*/
typedef pjsip_generic_int_hdr pjsip_max_fwd_hdr;
@ -1525,17 +1427,10 @@ pjsip_max_fwd_hdr_create(pj_pool_t *pool, int value);
PJ_DECL(pjsip_max_fwd_hdr*)
pjsip_max_fwd_hdr_init( pj_pool_t *pool, void *mem, int value );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_MIN_EXPIRES Header Field: Min-Expires
* @brief Min-Expires header field.
* @ingroup PJSIP_MSG
* @{
* Min-Expires header.
*/
typedef pjsip_generic_int_hdr pjsip_min_expires_hdr;
@ -1570,18 +1465,8 @@ PJ_DECL(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_init( pj_pool_t *pool,
void *mem,
int value );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_ROUTING Header Field: Record-Route/Route
* @brief Record-Route and Route header fields.
* @ingroup PJSIP_MSG
* @{
*/
/**
* Record-Route and Route headers.
*/
@ -1589,7 +1474,7 @@ typedef struct pjsip_routing_hdr
{
PJSIP_DECL_HDR_MEMBER(struct pjsip_routing_hdr); /**< Generic header fields. */
pjsip_name_addr name_addr; /**< The URL in the Route/Record-Route header. */
pjsip_param other_param; /** Other parameter. */
pjsip_param other_param; /**< Other parameter. */
} pjsip_routing_hdr;
/** Alias for Record-Route header. */
@ -1665,16 +1550,9 @@ PJ_DECL(pjsip_rr_hdr*) pjsip_routing_hdr_set_rr( pjsip_routing_hdr *r );
*/
PJ_DECL(pjsip_route_hdr*) pjsip_routing_hdr_set_route( pjsip_routing_hdr *r );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_REQUIRE Header Field: Require
* @brief Require header field.
* @ingroup PJSIP_MSG
* @{
* Require header.
*/
typedef pjsip_generic_array_hdr pjsip_require_hdr;
@ -1704,17 +1582,10 @@ PJ_DECL(pjsip_require_hdr*) pjsip_require_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_require_hdr*) pjsip_require_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_RETRY_AFTER Header Field: Retry-After
* @brief Retry-After header field.
* @ingroup PJSIP_MSG
* @{
* Retry-After header.
*/
typedef pjsip_generic_int_hdr pjsip_retry_after_hdr;
@ -1744,16 +1615,9 @@ PJ_DECL(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_init( pj_pool_t *pool,
int value );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_SUPPORTED Header Field: Supported
* @brief Supported header field.
* @ingroup PJSIP_MSG
* @{
* Supported header.
*/
typedef pjsip_generic_array_hdr pjsip_supported_hdr;
@ -1778,16 +1642,9 @@ PJ_DECL(pjsip_supported_hdr*) pjsip_supported_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_supported_hdr*) pjsip_supported_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_UNSUPPORTED Header Field: Unsupported
* @brief Unsupported header field.
* @ingroup PJSIP_MSG
* @{
* Unsupported header.
*/
typedef pjsip_generic_array_hdr pjsip_unsupported_hdr;
@ -1812,18 +1669,7 @@ PJ_DECL(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_create(pj_pool_t *pool);
PJ_DECL(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_VIA Header Field: Via
* @brief Via header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* SIP Via header.
* In this implementation, Via header can only have one element in each header.
@ -1865,18 +1711,7 @@ PJ_DECL(pjsip_via_hdr*) pjsip_via_hdr_create( pj_pool_t *pool );
PJ_DECL(pjsip_via_hdr*) pjsip_via_hdr_init( pj_pool_t *pool,
void *mem );
/**
* @}
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_WARNING Header Field: Warning
* @brief Warning header field.
* @ingroup PJSIP_MSG
* @{
*/
/**
* SIP Warning header.
* In this version, Warning header is just a typedef for generic string
@ -1917,25 +1752,7 @@ pjsip_warning_hdr_create_from_status( pj_pool_t *pool,
const pj_str_t *host,
pj_status_t status);
/**
* @}
*/
/**
* @bug Once a header is put in the message, the header CAN NOT be put in
* other list. Solution:
* - always clone header in the message.
* - create a list node for each header in the message.
*/
///////////////////////////////////////////////////////////////////////////////
/**
* @defgroup PJSIP_MSG_HDR_UNIMP Unimplemented Header Fields
* @brief Unimplemented header fields.
* @ingroup PJSIP_MSG
* @{
*/
/** Accept-Encoding header. */
typedef pjsip_generic_string_hdr pjsip_accept_encoding_hdr;

View File

@ -31,8 +31,9 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_PARSER SIP Message Parser
* @ingroup PJSIP
* @defgroup PJSIP_PARSER Parser
* @ingroup PJSIP_MSG
* @brief Message and message elements parsing.
* @{
*/
@ -66,6 +67,7 @@ extern int PJSIP_SYN_ERR_EXCEPTION;
*/
typedef struct pjsip_parser_err_report
{
/** Standard header fields. */
PJ_DECL_LIST_MEMBER(struct pjsip_parser_err_report);
int except_code; /**< Error exception (e.g. PJSIP_SYN_ERR_EXCEPTION) */
int line; /**< Line number. */
@ -134,6 +136,7 @@ PJ_DECL(pj_status_t) pjsip_register_hdr_parser( const char *hname,
*
* @param hname The header name registered.
* @param hshortname The short header name registered, or NULL.
* @param fptr Previously registered function to parse the header.
*
* @return zero if unregistration was successfull.
*/
@ -185,7 +188,7 @@ PJ_DECL(pj_status_t) pjsip_unregister_uri_parser( const char *scheme,
*/
PJ_DECL(pjsip_uri*) pjsip_parse_uri( pj_pool_t *pool,
char *buf, pj_size_t size,
unsigned option);
unsigned options);
/**
* Parse a packet buffer and build a full SIP message from the packet. This
@ -237,6 +240,7 @@ PJ_DECL(pjsip_msg *) pjsip_parse_rdata( char *buf, pj_size_t size,
*
* @param buf The input buffer, which must be NULL terminated.
* @param size The buffer size.
* @param is_datagram Put non-zero if transport is datagram oriented.
* @param msg_size [out] If message is valid, this parameter will contain
* the size of the SIP message (including body, if any).
*
@ -278,19 +282,26 @@ PJ_DECL(void*) pjsip_parse_hdr( pj_pool_t *pool, const pj_str_t *hname,
* a newline (as in SIP message) or ampersand mark (as in URI). This separator
* however is optional for the last header.
*
* @param pool the pool.
* @param buf the input text to parse.
* @param size the text length.
* @param hlist the header list to store the parsed headers. This list must
* have been initialized before calling this function.
* @return zero if successfull, or -1 if error is encountered. Upon error,
* the \a hlist argument MAY contain successfully parsed headers.
* @param pool the pool.
* @param input the input text to parse.
* @param size the text length.
* @param hlist the header list to store the parsed headers.
* This list must have been initialized before calling
* this function.
* @return zero if successfull, or -1 if error is encountered.
* Upon error, the \a hlist argument MAY contain
* successfully parsed headers.
*/
PJ_DECL(pj_status_t) pjsip_parse_headers( pj_pool_t *pool,
char *input, pj_size_t size,
pj_list *hlist );
/**
* @}
*/
/*
* Various specification used in parsing, exported here as extern for other
* parsers.
@ -316,20 +327,22 @@ extern pj_cis_t
/*
* Various string constants.
*/
extern const pj_str_t pjsip_USER_STR,
pjsip_METHOD_STR,
pjsip_TRANSPORT_STR,
pjsip_MADDR_STR,
pjsip_LR_STR,
pjsip_SIP_STR,
pjsip_SIPS_STR,
pjsip_TEL_STR,
pjsip_BRANCH_STR,
pjsip_TTL_STR,
pjsip_PNAME_STR,
pjsip_Q_STR,
pjsip_EXPIRES_STR,
pjsip_TAG_STR;
extern const pj_str_t pjsip_USER_STR, /**< "user" string constant. */
pjsip_METHOD_STR, /**< "method" string constant */
pjsip_TRANSPORT_STR, /**< "transport" string const. */
pjsip_MADDR_STR, /**< "maddr" string const. */
pjsip_LR_STR, /**< "lr" string const. */
pjsip_SIP_STR, /**< "sip" string constant. */
pjsip_SIPS_STR, /**< "sips" string constant. */
pjsip_TEL_STR, /**< "tel" string constant. */
pjsip_BRANCH_STR, /**< "branch" string constant. */
pjsip_TTL_STR, /**< "ttl" string constant. */
pjsip_RECEIVED_STR, /**< "received" string const. */
pjsip_Q_STR, /**< "q" string constant. */
pjsip_EXPIRES_STR, /**< "expires" string constant. */
pjsip_TAG_STR, /**< "tag" string constant. */
pjsip_RPORT_STR; /**< "rport" string const. */
/*
* Parser utilities.
@ -346,10 +359,6 @@ void pjsip_concat_param_imp( pj_str_t *param, pj_pool_t *pool,
const pj_str_t *pname, const pj_str_t *pvalue, int sepchar);
void pjsip_parse_end_hdr_imp ( pj_scanner *scanner );
/**
* @}
*/
PJ_END_DECL
#endif /* __PJSIP_SIP_PARSER_H__ */

View File

@ -26,21 +26,6 @@
#include <pjsip/sip_types.h>
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_PRIVATE Private structures and functions (PJSIP internals)
* @ingroup PJSIP
* @{
*/
/**
* @}
*/
PJ_END_DECL
#endif /* __PJSIP_PRIVATE_I_H__ */

View File

@ -32,9 +32,14 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_RESOLVE SIP Server Resolver
* @ingroup PJSIP
* @defgroup PJSIP_RESOLVE Server Resolution
* @ingroup PJSIP_TRANSPORT
* @brief Framework to resolve SIP servers based on RFC 3263.
* @{
* This is the server resolution framework, which is modelled after
* RFC 3263 - Locating SIP Servers document. The server resolution
* framework is asynchronous; callback will be called once the server
* address has been resolved (successfully or with errors).
*/
/**
@ -42,12 +47,10 @@ PJ_BEGIN_DECL
*/
#define PJSIP_MAX_RESOLVED_ADDRESSES 8
typedef struct pjsip_server_addresses pjsip_server_addresses;
/**
* The server addresses returned by the resolver.
*/
struct pjsip_server_addresses
typedef struct pjsip_server_addresses
{
/** Number of address records. */
unsigned count;
@ -66,7 +69,8 @@ struct pjsip_server_addresses
} entry[PJSIP_MAX_RESOLVED_ADDRESSES];
};
} pjsip_server_addresses;
/**
* The type of callback function to be called when resolver finishes the job.

View File

@ -26,6 +26,13 @@
#include <pjsip/sip_uri.h>
/**
* @addtogroup PJSIP_TEL_URI tel URI Scheme
* @ingroup PJSIP_URI
* @brief Support for "tel:" URI scheme.
* @{
*/
PJ_BEGIN_DECL
@ -68,4 +75,9 @@ PJ_DECL(int) pjsip_tel_nb_cmp(const pj_str_t *nb1, const pj_str_t *nb2);
PJ_END_DECL
/**
* @}
*/
#endif /* __PJSIP_TEL_URI_H__ */

View File

@ -31,9 +31,28 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_TRANSACT SIP Transaction
* @defgroup PJSIP_TRANSACT Transaction Layer
* @ingroup PJSIP
* @brief Provides statefull message processing.
*
* This module provides stateful processing to incoming or outgoing SIP
* messages.
* Before performing any stateful operations, application must register the
* transaction layer module by calling #pjsip_tsx_layer_init_module().
*
* Application should link with <b>pjsip-core</b> library to
* use the transaction layer.
*/
/**
* @defgroup PJSIP_TRANSACT_TRANSACTION Transaction
* @ingroup PJSIP_TRANSACT
* @brief Transaction instance for all types of SIP transactions.
* @{
* The pjsip_transaction describes SIP transaction, and is used for
* both INVITE and non-INVITE, UAC or UAS. Application must register the
* transaction layer module with #pjsip_tsx_layer_init_module() before
* performing any stateful operations.
*/
/**
@ -257,7 +276,7 @@ PJ_DECL(pj_status_t) pjsip_tsx_create_key( pj_pool_t *pool,
* @param code The status code to report.
*/
PJ_DECL(pj_status_t) pjsip_tsx_terminate( pjsip_transaction *tsx,
int st_code );
int code );
/**

View File

@ -34,12 +34,17 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_TRANSPORT SIP Transport
* @ingroup PJSIP
* @defgroup PJSIP_TRANSPORT Transport
* @ingroup PJSIP_CORE
* @brief This is the transport framework.
*
* This is the low-level transport layer. Application normally won't need to
* use this function, but instead can use transaction or higher layer API to
* send and receive messages.
* The transport framework is fully extensible. Please see
* <A HREF="/docs.htm">PJSIP Developer's Guide</A> PDF
* document for more information.
*
* Application MUST register at least one transport to PJSIP before any
* messages can be sent or received. Please see @ref PJSIP_TRANSPORT_UDP
* on how to create/register UDP transport to the transport framework.
*
* @{
*/
@ -137,8 +142,8 @@ PJ_DECL(const char*) pjsip_transport_get_type_name(pjsip_transport_type_e t);
*/
typedef struct pjsip_rx_data_op_key
{
pj_ioqueue_op_key_t op_key;
pjsip_rx_data *rdata;
pj_ioqueue_op_key_t op_key; /**< ioqueue op_key. */
pjsip_rx_data *rdata; /**< rdata associated with this */
} pjsip_rx_data_op_key;
@ -303,9 +308,18 @@ PJ_DECL(char*) pjsip_rx_data_get_info(pjsip_rx_data *rdata);
*/
typedef struct pjsip_tx_data_op_key
{
/** ioqueue pending operation key. */
pj_ioqueue_op_key_t key;
/** Transmit data associated with this key. */
pjsip_tx_data *tdata;
/** Arbitrary token (attached by transport) */
void *token;
/** Callback to be called when pending transmit operation has
completed.
*/
void (*callback)(pjsip_transport*,void*,pj_ssize_t);
} pjsip_tx_data_op_key;
@ -376,6 +390,8 @@ struct pjsip_tx_data
/** Transport manager internal. */
void *token;
/** Callback to be called when this tx_data has been transmitted. */
void (*cb)(void*, pjsip_tx_data*, pj_ssize_t);
/** Transport information, only valid during on_tx_request() and
@ -592,18 +608,18 @@ typedef struct pjsip_tpfactory pjsip_tpfactory;
*/
struct pjsip_tpfactory
{
/* This list is managed by transport manager. */
/** This list is managed by transport manager. */
PJ_DECL_LIST_MEMBER(struct pjsip_tpfactory);
pj_pool_t *pool;
pj_lock_t *lock;
pj_pool_t *pool; /**< Owned memory pool. */
pj_lock_t *lock; /**< Lock object. */
pjsip_transport_type_e type;
char type_name[8];
unsigned flag;
pjsip_transport_type_e type; /**< Transport type. */
char type_name[8]; /**< Type string name. */
unsigned flag; /**< Transport flag. */
pj_sockaddr local_addr;
pjsip_host_port addr_name;
pj_sockaddr local_addr; /**< Bound address. */
pjsip_host_port addr_name; /**< Published name. */
/**
* Create new outbound connection.
@ -628,7 +644,7 @@ struct pjsip_tpfactory
* Register a transport factory.
*
* @param mgr The transport manager.
* @param factory Transport factory.
* @param tpf Transport factory.
*
* @return PJ_SUCCESS if listener was successfully created.
*/
@ -637,6 +653,11 @@ PJ_DECL(pj_status_t) pjsip_tpmgr_register_tpfactory(pjsip_tpmgr *mgr,
/**
* Unregister factory.
*
* @param mgr The transport manager.
* @param tpf Transport factory.
*
* @return PJ_SUCCESS is sucessfully unregistered.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_unregister_tpfactory(pjsip_tpmgr *mgr,
pjsip_tpfactory *tpf);

View File

@ -19,8 +19,26 @@
#ifndef __PJSIP_TRANSPORT_LOOP_H__
#define __PJSIP_TRANSPORT_LOOP_H__
/**
* @file sip_transport_loop.h
* @brief
* Loopback transport (for debugging)
*/
#include <pjsip/sip_transport.h>
/**
* @defgroup PJSIP_TRANSPORT_LOOP Loop Transport
* @ingroup PJSIP_TRANSPORT
* @brief Loopback transport (for testing purposes).
* @{
* The loopback transport simply bounce back outgoing messages as
* incoming messages. This feature is used mostly during automated
* testing, to provide controlled behavior.
*/
PJ_BEGIN_DECL
/**
@ -120,6 +138,9 @@ PJ_DECL(pj_status_t) pjsip_loop_set_delay( pjsip_transport *tp,
PJ_END_DECL
/**
* @}
*/
#endif /* __PJSIP_TRANSPORT_LOOP_H__ */

View File

@ -1,4 +1,4 @@
/* $Id: $ */
/* $Id$ */
/*
* Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
*
@ -19,10 +19,24 @@
#ifndef __PJSIP_TRANSPORT_UDP_H__
#define __PJSIP_TRANSPORT_UDP_H__
/**
* @file sip_transport_udp.h
* @brief SIP UDP Transport.
*/
#include <pjsip/sip_transport.h>
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_TRANSPORT_UDP UDP transport
* @ingroup PJSIP_TRANSPORT
* @brief API to create and register UDP transport.
* @{
* The functions below are used to create UDP transport and register
* the transport to the framework.
*/
/**
* Start UDP transport.
*
@ -67,5 +81,8 @@ PJ_DECL(pj_status_t) pjsip_udp_transport_attach(pjsip_endpoint *endpt,
PJ_END_DECL
/**
* @}
*/
#endif /* __PJSIP_TRANSPORT_UDP_H__ */

View File

@ -19,16 +19,39 @@
#ifndef __PJSIP_SIP_TYPES_H__
#define __PJSIP_SIP_TYPES_H__
/*
* My note: Doxygen PJSIP and PJSIP_CORE group is declared in
* sip_config.h
*/
/**
* @file sip_types.h
* @brief Basic PJSIP types.
*/
#include <pjsip/sip_config.h>
#include <pj/types.h>
/**
* Opaque data structure for transports (sip_transport.h).
* @addtogroup PJSIP_BASE
*/
/* @defgroup PJSIP_TYPES Basic Data Types
* @ingroup PJSIP_BASE
* @brief Basic data types.
* @{
*/
/**
* Forward declaration for SIP transport.
*/
typedef struct pjsip_transport pjsip_transport;
/**
* Opaque data type for transport manager (sip_transport.h).
* Forward declaration for transport manager.
*/
typedef struct pjsip_tpmgr pjsip_tpmgr;
@ -217,5 +240,10 @@ PJ_DECL(pj_status_t) pjsip_exception_to_status(int exception_id);
*/
#define PJSIP_THROW_SPEC(list)
/**
* @}
*/
#endif /* __PJSIP_SIP_TYPES_H__ */

View File

@ -29,20 +29,34 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSUA SIP User Agent Stack
* @defgroup PJSIP_UA Base User Agent Layer/Common Dialog Layer
* @ingroup PJSIP
* @brief Dialog management.
*
* This module provides basic dialog management, which is used by higher
* layer dialog usages such as INVITE sessions and SIP Event Subscription
* framework (RFC 3265). Application should link with <b>pjsip-core</b>
* library to use this base UA layer. The base UA layer module is initialized
* with #pjsip_ua_init_module().
*/
/**
* @defgroup PJSUA_UA SIP User Agent Module
* @ingroup PJSUA
* @ingroup PJSIP_UA
* @brief Provides dialog management.
* @{
* \brief
* User Agent manages the interactions between application and SIP dialogs.
*
* Application MUST initialize the user agent layer module by calling
* #pjsip_ua_init_module() before using any of the dialog API, and link
* the application with with <b>pjsip-core</b> library.
*/
/** User agent initialization parameter. */
typedef struct pjsip_ua_init_param
{
/** Callback to be called when the UA layer detects that outgoing
* dialog has forked.
*/
pjsip_dialog* (*on_dlg_forked)(pjsip_dialog *first_set, pjsip_rx_data *res);
} pjsip_ua_init_param;
@ -90,6 +104,11 @@ PJ_DEF(void) pjsip_ua_dump(pj_bool_t detail);
PJ_DECL(pjsip_endpoint*) pjsip_ua_get_endpt(pjsip_user_agent *ua);
/**
* @}
*/
/*
* Internal (called by sip_dialog.c).
*/
@ -100,10 +119,6 @@ PJ_DECL(pj_status_t) pjsip_ua_unregister_dlg(pjsip_user_agent *ua,
pjsip_dialog *dlg );
/**
* @}
*/
PJ_END_DECL

View File

@ -33,9 +33,15 @@ PJ_BEGIN_DECL
/**
* @defgroup PJSIP_URL URL Structures
* @brief SIP Url, tel: Url, and generic URI.
* @defgroup PJSIP_URI URI
* @brief URI types and manipulations.
* @ingroup PJSIP_MSG
*/
/**
* @addtogroup PJSIP_URI_PARAM URI Parameter Container
* @ingroup PJSIP_URI
* @brief Generic parameter elements container.
* @{
*/
@ -118,6 +124,17 @@ PJ_DECL(pj_ssize_t) pjsip_param_print_on(const pjsip_param *param_list,
const pj_cis_t *pvalue_unres,
int sep);
/**
* @}
*/
/**
* @defgroup PJSIP_URI_GENERIC Generic URI
* @ingroup PJSIP_URI
* @brief Generic representation for all types of URI.
* @{
*/
/**
* URI context.
*/
@ -221,45 +238,6 @@ struct pjsip_uri
(pj_strnicmp2(pjsip_uri_get_scheme(url), "tel", 3)==0)
/**
* SIP and SIPS URL scheme.
*/
typedef struct pjsip_sip_uri
{
pjsip_uri_vptr *vptr; /**< Pointer to virtual function table.*/
pj_str_t user; /**< Optional user part. */
pj_str_t passwd; /**< Optional password part. */
pj_str_t host; /**< Host part, always exists. */
int port; /**< Optional port number, or zero. */
pj_str_t user_param; /**< Optional user parameter */
pj_str_t method_param; /**< Optional method parameter. */
pj_str_t transport_param; /**< Optional transport parameter. */
int ttl_param; /**< Optional TTL param, or -1. */
int lr_param; /**< Optional loose routing param, or zero */
pj_str_t maddr_param; /**< Optional maddr param */
pjsip_param other_param; /**< Other parameters grouped together. */
pjsip_param header_param; /**< Optional header parameter. */
} pjsip_sip_uri;
/**
* SIP name-addr, which typically appear in From, To, and Contact header.
* The SIP name-addr contains a generic URI and a display name.
*/
typedef struct pjsip_name_addr
{
/** Pointer to virtual function table. */
pjsip_uri_vptr *vptr;
/** Optional display name. */
pj_str_t display;
/** URI part. */
pjsip_uri *uri;
} pjsip_name_addr;
/**
* Generic function to get the URI scheme.
* @param uri the URI object.
@ -326,6 +304,58 @@ PJ_INLINE(void*) pjsip_uri_clone( pj_pool_t *pool, const void *uri )
}
/**
* @}
*/
/**
* @defgroup PJSIP_SIP_URI SIP URI Scheme and Name address
* @ingroup PJSIP_URI
* @brief SIP URL structure ("sip:" and "sips:")
* @{
*/
/**
* SIP and SIPS URL scheme.
*/
typedef struct pjsip_sip_uri
{
pjsip_uri_vptr *vptr; /**< Pointer to virtual function table.*/
pj_str_t user; /**< Optional user part. */
pj_str_t passwd; /**< Optional password part. */
pj_str_t host; /**< Host part, always exists. */
int port; /**< Optional port number, or zero. */
pj_str_t user_param; /**< Optional user parameter */
pj_str_t method_param; /**< Optional method parameter. */
pj_str_t transport_param; /**< Optional transport parameter. */
int ttl_param; /**< Optional TTL param, or -1. */
int lr_param; /**< Optional loose routing param, or zero */
pj_str_t maddr_param; /**< Optional maddr param */
pjsip_param other_param; /**< Other parameters grouped together. */
pjsip_param header_param; /**< Optional header parameter. */
} pjsip_sip_uri;
/**
* SIP name-addr, which typically appear in From, To, and Contact header.
* The SIP name-addr contains a generic URI and a display name.
*/
typedef struct pjsip_name_addr
{
/** Pointer to virtual function table. */
pjsip_uri_vptr *vptr;
/** Optional display name. */
pj_str_t display;
/** URI part. */
pjsip_uri *uri;
} pjsip_name_addr;
/**
* Create new SIP URL and initialize all fields with zero or NULL.
* @param pool The pool.
@ -344,6 +374,7 @@ PJ_DECL(pjsip_sip_uri*) pjsip_sips_uri_create( pj_pool_t *pool );
/**
* Initialize SIP URL (all fields are set to NULL or zero).
* @param url The URL.
* @param secure Create sips URI?
*/
PJ_DECL(void) pjsip_sip_uri_init(pjsip_sip_uri *url, int secure);

View File

@ -25,8 +25,9 @@
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_ENDPT SIP Endpoint
* @ingroup PJSIP
* @defgroup PJSIP_ENDPT_STATELESS Message Creation and Stateless Operations
* @ingroup PJSIP_CORE_CORE
* @brief Utilities to create various messages and base function to send messages.
* @{
*/
@ -238,6 +239,10 @@ typedef struct pjsip_send_state
*
* @param endpt The endpoint instance.
* @param tdata The transmit data to be sent.
* @param token Arbitrary token to be given back on the callback.
* @param cb Optional callback to notify transmission status (also
* gives chance for application to discontinue retrying
* sending to alternate address).
*
* @return PJ_SUCCESS, or the appropriate error code.
*/
@ -349,6 +354,16 @@ PJ_DECL(pj_status_t) pjsip_endpt_respond_stateless(pjsip_endpoint *endpt,
const pjsip_hdr *hdr_list,
const pjsip_msg_body *body);
/**
* @}
*/
/**
* @defgroup PJSIP_TRANSACT_UTIL Stateful Operations
* @ingroup PJSIP_TRANSACT
* @brief Utility function to send requests/responses statefully.
* @{
*/
/**
* This composite function creates and sends response statefully for the

View File

@ -18,7 +18,8 @@
*/
/**
* @defgroup PJSIP_SIMPLE SIP Event, Instant Messaging and Presence Extension (SIMPLE)
* @defgroup PJSIP_SIMPLE Event and Presence Framework
* @ingroup PJSIP
*/
/**

File diff suppressed because it is too large Load Diff

View File

@ -97,7 +97,7 @@ const pj_str_t pjsip_SIPS_STR = { "sips", 4 };
const pj_str_t pjsip_TEL_STR = { "tel", 3 };
const pj_str_t pjsip_BRANCH_STR = { "branch", 6 };
const pj_str_t pjsip_TTL_STR = { "ttl", 3 };
const pj_str_t pjsip_PNAME_STR = { "received", 8 };
const pj_str_t pjsip_RECEIVED_STR = { "received", 8 };
const pj_str_t pjsip_Q_STR = { "q", 1 };
const pj_str_t pjsip_EXPIRES_STR = { "expires", 7 };
const pj_str_t pjsip_TAG_STR = { "tag", 3 };
@ -1656,7 +1656,7 @@ static void int_parse_via_param( pjsip_via_hdr *hdr, pj_scanner *scanner,
} else if (!parser_stricmp(pname, pjsip_MADDR_STR) && pvalue.slen) {
hdr->maddr_param = pvalue;
} else if (!parser_stricmp(pname, pjsip_PNAME_STR) && pvalue.slen) {
} else if (!parser_stricmp(pname, pjsip_RECEIVED_STR) && pvalue.slen) {
hdr->recvd_param = pvalue;
} else if (!parser_stricmp(pname, pjsip_RPORT_STR)) {