Group PJSIP_MSG_HDR

group PJSIP_MSG_HDR

Declarations for various SIP header fields.

Defines

PJSIP_DECL_HDR_MEMBER(hdr)

Generic fields for all SIP headers are declared using this macro, to make sure that all headers will have exactly the same layout in their start of the storage. This behaves like C++ inheritance actually.

PJSIP_GENERIC_ARRAY_MAX_COUNT

Maximum elements in the header array.

PJSIP_MAX_ACCEPT_COUNT

Maximum fields in Accept header.

pjsip_accept_encoding_hdr_create

Create Accept-Encoding header.

pjsip_accept_lang_hdr_create

Create Accept-Language header.

pjsip_alert_info_hdr_create

Create Alert-Info header.

pjsip_auth_info_hdr_create

Create Authentication-Info header.

pjsip_call_info_hdr_create

Create Call-Info header.

pjsip_content_disposition_hdr_create

Create Content-Disposition header.

pjsip_content_encoding_hdr_create

Create Content-Encoding header.

pjsip_content_lang_hdr_create

Create Content-Language header.

pjsip_date_hdr_create

Create Date header.

pjsip_err_info_hdr_create

Create Error-Info header.

pjsip_in_reply_to_hdr_create

Create In-Reply-To header.

pjsip_mime_version_hdr_create

Create MIME-Version header.

pjsip_organization_hdr_create

Create Organization header.

pjsip_priority_hdr_create

Create Priority header.

pjsip_reply_to_hdr_create

Create Reply-To header.

pjsip_server_hdr_create

Create Server header.

pjsip_subject_hdr_create

Create Subject header.

pjsip_timestamp_hdr_create

Create Timestamp header.

pjsip_user_agent_hdr_create

Create User-Agent header.

Typedefs

typedef pjsip_generic_array_hdr pjsip_accept_hdr

Accept header.

typedef pjsip_generic_array_hdr pjsip_allow_hdr

Allow header.

typedef pjsip_generic_int_hdr pjsip_expires_hdr

Expires header.

typedef pjsip_fromto_hdr pjsip_from_hdr

Alias for From header.

typedef pjsip_fromto_hdr pjsip_to_hdr

Alias for To header.

typedef pjsip_generic_int_hdr pjsip_max_fwd_hdr

Max-Forwards header.

typedef pjsip_generic_int_hdr pjsip_min_expires_hdr

Min-Expires header.

typedef pjsip_routing_hdr pjsip_rr_hdr

Alias for Record-Route header.

typedef pjsip_routing_hdr pjsip_route_hdr

Alias for Route header.

typedef pjsip_generic_array_hdr pjsip_require_hdr

Require header.

typedef pjsip_generic_array_hdr pjsip_supported_hdr

Supported header.

typedef pjsip_generic_array_hdr pjsip_unsupported_hdr

Unsupported header.

typedef pjsip_generic_string_hdr pjsip_warning_hdr

SIP Warning header. In this version, Warning header is just a typedef for generic string header.

typedef pjsip_generic_string_hdr pjsip_accept_encoding_hdr

Accept-Encoding header.

typedef pjsip_generic_string_hdr pjsip_accept_lang_hdr

Accept-Language header.

typedef pjsip_generic_string_hdr pjsip_alert_info_hdr

Alert-Info header.

typedef pjsip_generic_string_hdr pjsip_auth_info_hdr

Authentication-Info header.

typedef pjsip_generic_string_hdr pjsip_call_info_hdr

Call-Info header.

typedef pjsip_generic_string_hdr pjsip_content_disposition_hdr

Content-Disposition header.

typedef pjsip_generic_string_hdr pjsip_content_encoding_hdr

Content-Encoding header.

typedef pjsip_generic_string_hdr pjsip_content_lang_hdr

Content-Language header.

typedef pjsip_generic_string_hdr pjsip_date_hdr

Date header.

typedef pjsip_generic_string_hdr pjsip_err_info_hdr

Error-Info header.

typedef pjsip_generic_string_hdr pjsip_in_reply_to_hdr

In-Reply-To header.

typedef pjsip_generic_string_hdr pjsip_mime_version_hdr

MIME-Version header.

typedef pjsip_generic_string_hdr pjsip_organization_hdr

Organization header.

typedef pjsip_generic_string_hdr pjsip_priority_hdr

Priority header.

typedef pjsip_generic_string_hdr pjsip_proxy_require_hdr

Proxy-Require header.

typedef pjsip_generic_string_hdr pjsip_reply_to_hdr

Reply-To header.

typedef pjsip_generic_string_hdr pjsip_server_hdr

Server header.

typedef pjsip_generic_string_hdr pjsip_subject_hdr

Subject header.

typedef pjsip_generic_string_hdr pjsip_timestamp_hdr

Timestamp header.

typedef pjsip_generic_string_hdr pjsip_user_agent_hdr

User-Agent header.

Enums

enum pjsip_hdr_e

Header types, as defined by RFC3261.

Values:

enumerator PJSIP_H_ACCEPT
enumerator PJSIP_H_ACCEPT_ENCODING_UNIMP
enumerator PJSIP_H_ACCEPT_LANGUAGE_UNIMP
enumerator PJSIP_H_ALERT_INFO_UNIMP
enumerator PJSIP_H_ALLOW
enumerator PJSIP_H_AUTHENTICATION_INFO_UNIMP
enumerator PJSIP_H_AUTHORIZATION
enumerator PJSIP_H_CALL_ID
enumerator PJSIP_H_CALL_INFO_UNIMP
enumerator PJSIP_H_CONTACT
enumerator PJSIP_H_CONTENT_DISPOSITION_UNIMP
enumerator PJSIP_H_CONTENT_ENCODING_UNIMP
enumerator PJSIP_H_CONTENT_LANGUAGE_UNIMP
enumerator PJSIP_H_CONTENT_LENGTH
enumerator PJSIP_H_CONTENT_TYPE
enumerator PJSIP_H_CSEQ
enumerator PJSIP_H_DATE_UNIMP
enumerator PJSIP_H_ERROR_INFO_UNIMP
enumerator PJSIP_H_EXPIRES
enumerator PJSIP_H_FROM
enumerator PJSIP_H_IN_REPLY_TO_UNIMP
enumerator PJSIP_H_MAX_FORWARDS
enumerator PJSIP_H_MIME_VERSION_UNIMP
enumerator PJSIP_H_MIN_EXPIRES
enumerator PJSIP_H_ORGANIZATION_UNIMP
enumerator PJSIP_H_PRIORITY_UNIMP
enumerator PJSIP_H_PROXY_AUTHENTICATE
enumerator PJSIP_H_PROXY_AUTHORIZATION
enumerator PJSIP_H_PROXY_REQUIRE_UNIMP
enumerator PJSIP_H_RECORD_ROUTE
enumerator PJSIP_H_REPLY_TO_UNIMP
enumerator PJSIP_H_REQUIRE
enumerator PJSIP_H_RETRY_AFTER
enumerator PJSIP_H_ROUTE
enumerator PJSIP_H_SERVER_UNIMP
enumerator PJSIP_H_SUBJECT_UNIMP
enumerator PJSIP_H_SUPPORTED
enumerator PJSIP_H_TIMESTAMP_UNIMP
enumerator PJSIP_H_TO
enumerator PJSIP_H_UNSUPPORTED
enumerator PJSIP_H_USER_AGENT_UNIMP
enumerator PJSIP_H_VIA
enumerator PJSIP_H_WARNING_UNIMP
enumerator PJSIP_H_WWW_AUTHENTICATE
enumerator PJSIP_H_OTHER

Functions

pjsip_authorization_hdr *pjsip_authorization_hdr_create(pj_pool_t *pool)

Create SIP Authorization header.

Parameters

pool – Pool where memory will be allocated from.

Returns

SIP Authorization header.

pjsip_proxy_authorization_hdr *pjsip_proxy_authorization_hdr_create(pj_pool_t *pool)

Create SIP Proxy-Authorization header.

Parameters

pool – Pool where memory will be allocated from.

Returns

SIP Proxy-Authorization header.

pjsip_www_authenticate_hdr *pjsip_www_authenticate_hdr_create(pj_pool_t *pool)

Create SIP WWW-Authenticate header.

Parameters

pool – Pool where memory will be allocated from.

Returns

SIP WWW-Authenticate header.

pjsip_proxy_authenticate_hdr *pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool)

Create SIP Proxy-Authenticate header.

Parameters

pool – Pool where memory will be allocated from.

Returns

SIP Proxy-Authenticate header.

void *pjsip_hdr_clone(pj_pool_t *pool, const void *hdr)

This generic function will clone any header, by calling “clone” function in header’s virtual function table.

Parameters
  • pool – The pool to allocate memory from.

  • hdr – The header to clone.

Returns

A new instance copied from the original header.

void *pjsip_hdr_shallow_clone(pj_pool_t *pool, const void *hdr)

This generic function will clone any header, by calling “shallow_clone” function in header’s virtual function table.

Parameters
  • pool – The pool to allocate memory from.

  • hdr – The header to clone.

Returns

A new instance copied from the original header.

int pjsip_hdr_print_on(void *hdr, char *buf, pj_size_t len)

This generic function will print any header, by calling “print” function in header’s virtual function table.

Parameters
  • hdr – The header to print.

  • buf – The buffer.

  • len – The size of the buffer.

Returns

The size copied to buffer, or -1 if there’s not enough space.

pjsip_generic_string_hdr *pjsip_generic_string_hdr_create(pj_pool_t *pool, const pj_str_t *hname, const pj_str_t *hvalue)

Create a new instance of generic header. A generic header can have an arbitrary header name.

Parameters
  • pool – The pool.

  • hname – The header name to be assigned to the header, or NULL to assign the header name with some string.

  • hvalue – Optional string to be assigned as the value.

Returns

The header, or THROW exception.

pjsip_generic_string_hdr *pjsip_generic_string_hdr_init(pj_pool_t *pool, void *mem, const pj_str_t *hname, const pj_str_t *hvalue)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

  • hname – The header name to be assigned to the header, or NULL to assign the header name with some string later.

  • hvalue – Optional string to be assigned as the value.

Returns

The header instance, which points to the same memory location as the mem argument.

void pjsip_generic_string_hdr_init2(pjsip_generic_string_hdr *h, pj_str_t *hname, pj_str_t *hvalue)

Construct a generic string header without allocating memory from the pool. This function is useful to create a temporary header which life-time is very short (for example, creating the header in the stack to be passed as argument to a function which will copy the header).

Parameters
  • h – The header to be initialized.

  • hname – The header name to be assigned to the header, or NULL to assign the header name with some string.

  • hvalue – Optional string to be assigned as the value.

Returns

The header, or THROW exception.

pjsip_generic_int_hdr *pjsip_generic_int_hdr_create(pj_pool_t *pool, const pj_str_t *hname, int hvalue)

Create a new instance of generic header. A generic header can have an arbitrary header name.

Parameters
  • pool – The pool.

  • hname – The header name to be assigned to the header, or NULL to assign the header name with some string.

  • hvalue – The value to be assigned to the header.

Returns

The header, or THROW exception.

pjsip_generic_int_hdr *pjsip_generic_int_hdr_init(pj_pool_t *pool, void *mem, const pj_str_t *hname, int value)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

  • hname – The header name to be assigned to the header, or NULL to assign the header name with some string later.

  • value – Value to be assigned to the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_generic_array_hdr *pjsip_generic_array_hdr_create(pj_pool_t *pool, const pj_str_t *hname)

Create generic array header.

Parameters
  • pool – Pool to allocate memory from.

  • hname – Header name.

Returns

New generic array header.

pjsip_generic_array_hdr *pjsip_generic_array_hdr_init(pj_pool_t *pool, void *mem, const pj_str_t *hname)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

  • hname – The header name to be assigned to the header, or NULL to assign the header name with some string later.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_accept_hdr *pjsip_accept_hdr_create(pj_pool_t *pool)

Create new Accept header instance.

Parameters

pool – The pool.

Returns

New Accept header instance.

pjsip_accept_hdr *pjsip_accept_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_allow_hdr *pjsip_allow_hdr_create(pj_pool_t *pool)

Create new Allow header instance.

Parameters

pool – The pool.

Returns

New Allow header instance.

pjsip_allow_hdr *pjsip_allow_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_cid_hdr *pjsip_cid_hdr_create(pj_pool_t *pool)

Create new Call-ID header.

Parameters

pool – The pool.

Returns

new Call-ID header.

pjsip_cid_hdr *pjsip_cid_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_clen_hdr *pjsip_clen_hdr_create(pj_pool_t *pool)

Create new Content-Length header.

Parameters

pool – the pool.

Returns

A new Content-Length header instance.

pjsip_clen_hdr *pjsip_clen_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_cseq_hdr *pjsip_cseq_hdr_create(pj_pool_t *pool)

Create new CSeq header.

Parameters

pool – The pool.

Returns

A new CSeq header instance.

pjsip_cseq_hdr *pjsip_cseq_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_contact_hdr *pjsip_contact_hdr_create(pj_pool_t *pool)

Create a new Contact header.

Parameters

pool – The pool.

Returns

A new instance of Contact header.

pjsip_contact_hdr *pjsip_contact_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_ctype_hdr *pjsip_ctype_hdr_create(pj_pool_t *pool)

Create a nwe Content Type header.

Parameters

pool – The pool.

Returns

A new Content-Type header.

pjsip_ctype_hdr *pjsip_ctype_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_expires_hdr *pjsip_expires_hdr_create(pj_pool_t *pool, int value)

Create a new Expires header.

Parameters
  • pool – The pool.

  • value – The expiration value.

Returns

A new Expires header.

pjsip_expires_hdr *pjsip_expires_hdr_init(pj_pool_t *pool, void *mem, int value)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

  • value – The expiration value.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_from_hdr *pjsip_from_hdr_create(pj_pool_t *pool)

Create a From header.

Parameters

pool – The pool.

Returns

New instance of From header.

pjsip_from_hdr *pjsip_from_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_to_hdr *pjsip_to_hdr_create(pj_pool_t *pool)

Create a To header.

Parameters

pool – The pool.

Returns

New instance of To header.

pjsip_to_hdr *pjsip_to_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_from_hdr *pjsip_fromto_hdr_set_from(pjsip_fromto_hdr *hdr)

Convert the header to a From header.

Parameters

hdr – The generic from/to header.

Returns

“From” header.

pjsip_to_hdr *pjsip_fromto_hdr_set_to(pjsip_fromto_hdr *hdr)

Convert the header to a To header.

Parameters

hdr – The generic from/to header.

Returns

“To” header.

pjsip_max_fwd_hdr *pjsip_max_fwd_hdr_create(pj_pool_t *pool, int value)

Create new Max-Forwards header instance.

Parameters
  • pool – The pool.

  • value – The Max-Forwards value.

Returns

New Max-Forwards header instance.

pjsip_max_fwd_hdr *pjsip_max_fwd_hdr_init(pj_pool_t *pool, void *mem, int value)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

  • value – The Max-Forwards value.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_min_expires_hdr *pjsip_min_expires_hdr_create(pj_pool_t *pool, int value)

Create new Min-Expires header instance.

Parameters
  • pool – The pool.

  • value – The Min-Expires value.

Returns

New Min-Expires header instance.

pjsip_min_expires_hdr *pjsip_min_expires_hdr_init(pj_pool_t *pool, void *mem, int value)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

  • value – The Min-Expires value.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_rr_hdr *pjsip_rr_hdr_create(pj_pool_t *pool)

Create new Record-Route header from the pool.

Parameters

pool – The pool.

Returns

A new instance of Record-Route header.

pjsip_rr_hdr *pjsip_rr_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_route_hdr *pjsip_route_hdr_create(pj_pool_t *pool)

Create new Route header from the pool.

Parameters

pool – The pool.

Returns

A new instance of “Route” header.

pjsip_route_hdr *pjsip_route_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_rr_hdr *pjsip_routing_hdr_set_rr(pjsip_routing_hdr *r)

Convert generic routing header to Record-Route header.

Parameters

r – The generic routing header, or a “Routing” header.

Returns

Record-Route header.

pjsip_route_hdr *pjsip_routing_hdr_set_route(pjsip_routing_hdr *r)

Convert generic routing header to “Route” header.

Parameters

r – The generic routing header, or a “Record-Route” header.

Returns

“Route” header.

pjsip_require_hdr *pjsip_require_hdr_create(pj_pool_t *pool)

Create new Require header instance.

Parameters

pool – The pool.

Returns

New Require header instance.

pjsip_require_hdr *pjsip_require_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure. This function should only be called when application uses its own memory allocation to allocate memory block for the specified header (e.g. in C++, when the header is allocated with “new” operator). For normal applications, they should use pjsip_xxx_hdr_create() instead, which allocates memory and initialize it in one go.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_retry_after_hdr *pjsip_retry_after_hdr_create(pj_pool_t *pool, int value)

Create new Retry-After header instance.

Parameters
  • pool – The pool.

  • value – The Retry-After value.

Returns

New Retry-After header instance.

pjsip_retry_after_hdr *pjsip_retry_after_hdr_init(pj_pool_t *pool, void *mem, int value)

Initialize a preallocated memory with the header structure.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

  • value – The Retry-After value.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_supported_hdr *pjsip_supported_hdr_create(pj_pool_t *pool)

Create new Supported header instance.

Parameters

pool – The pool.

Returns

New Supported header instance.

pjsip_supported_hdr *pjsip_supported_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_unsupported_hdr *pjsip_unsupported_hdr_create(pj_pool_t *pool)

Create new Unsupported header instance.

Parameters

pool – The pool.

Returns

New Unsupported header instance.

pjsip_unsupported_hdr *pjsip_unsupported_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_via_hdr *pjsip_via_hdr_create(pj_pool_t *pool)

Create a new Via header.

Parameters

pool – The pool.

Returns

A new “Via” header instance.

pjsip_via_hdr *pjsip_via_hdr_init(pj_pool_t *pool, void *mem)

Initialize a preallocated memory with the header structure.

Parameters
  • pool – Pool for additional memory allocation if required.

  • mem – Pre-allocated memory to be initialized as the header.

Returns

The header instance, which points to the same memory location as the mem argument.

pjsip_warning_hdr *pjsip_warning_hdr_create(pj_pool_t *pool, int code, const pj_str_t *host, const pj_str_t *text)

Create a warning header with the specified contents.

Parameters
  • pool – Pool to allocate memory from.

  • code – Warning code, 300-399.

  • host – The host portion of the Warning header.

  • text – The warning text, which MUST not be quoted with double quote.

Returns

The Warning header field.

pjsip_warning_hdr *pjsip_warning_hdr_create_from_status(pj_pool_t *pool, const pj_str_t *host, pj_status_t status)

Create a warning header and initialize the contents from the error message for the specified status code. The warning code will be set to 399.

Parameters
  • pool – Pool to allocate memory from.

  • host – The host portion of the Warning header.

  • status – The error status code, which error text will be put in as the Warning text.

Returns

The Warning header field.

struct pjsip_common_credential
#include <sip_auth_msg.h>

Common credential structure represents common credential fields present in Authorization/Proxy-Authorization header.

See

pjsip_common_credential

struct pjsip_digest_credential
#include <sip_auth_msg.h>

This structure describe credential used in Authorization and Proxy-Authorization header for digest authentication scheme.

See

pjsip_digest_credential

struct pjsip_pgp_credential
#include <sip_auth_msg.h>

This structure describe credential used in Authorization and Proxy-Authorization header for PGP authentication scheme.

See

pjsip_pgp_credential

struct pjsip_authorization_hdr
#include <sip_auth_msg.h>

This structure describes SIP Authorization header (and also SIP Proxy-Authorization header).

SIP Proxy-Authorization header shares the same structure as SIP Authorization header.

See

pjsip_authorization_hdr.

struct pjsip_common_challenge
#include <sip_auth_msg.h>

This structure describes common fields in authentication challenge headers (WWW-Authenticate and Proxy-Authenticate).

See

pjsip_common_challenge

struct pjsip_digest_challenge
#include <sip_auth_msg.h>

This structure describes authentication challenge used in Proxy-Authenticate or WWW-Authenticate for digest authentication scheme.

See

pjsip_digest_challenge

struct pjsip_pgp_challenge
#include <sip_auth_msg.h>

This structure describes authentication challenge used in Proxy-Authenticate or WWW-Authenticate for PGP authentication scheme.

See

pjsip_pgp_challenge

struct pjsip_www_authenticate_hdr
#include <sip_auth_msg.h>

This structure describe SIP WWW-Authenticate header (Proxy-Authenticate header also uses the same structure).

WWW-Authenticate header.

Proxy-Authenticate header.

struct pjsip_hdr_vptr
#include <sip_msg.h>

This structure provides the pointer to basic functions that are needed for generic header operations. All header fields will have pointer to this structure, so that they can be manipulated uniformly.

struct pjsip_hdr
#include <sip_msg.h>

Generic SIP header structure, for generic manipulation for headers in the message. All header fields can be typecasted to this type.

Forward declaration for header field (sip_msg.h).

struct pjsip_generic_string_hdr
#include <sip_msg.h>

Generic SIP header, which contains hname and a string hvalue. Note that this header is not supposed to be used as ‘base’ class for headers.

struct pjsip_generic_int_hdr
#include <sip_msg.h>

Generic SIP header, which contains hname and a string hvalue.

struct pjsip_generic_array_hdr
#include <sip_msg.h>

Generic array of string header.

struct pjsip_cid_hdr
#include <sip_msg.h>

Call-ID header.

struct pjsip_clen_hdr
#include <sip_msg.h>

Content-Length header.

struct pjsip_cseq_hdr
#include <sip_msg.h>

CSeq header.

struct pjsip_contact_hdr
#include <sip_msg.h>

Contact header. In this library, contact header only contains single URI. If a message has multiple URI in the Contact header, the URI will be put in separate Contact headers.

struct pjsip_ctype_hdr
#include <sip_msg.h>

Content-Type.

struct pjsip_fromto_hdr
#include <sip_msg.h>

To or From header.

struct pjsip_routing_hdr
#include <sip_msg.h>

Record-Route and Route headers.

struct pjsip_retry_after_hdr
#include <sip_msg.h>

Retry-After header.

struct pjsip_via_hdr
#include <sip_msg.h>

SIP Via header. In this implementation, Via header can only have one element in each header. If a message arrives with multiple elements in a single Via, then they will be split up into multiple Via headers.