ast_sip_pubsub_body_generator Struct Reference

Pubsub body generator. More...

#include <res_pjsip_pubsub.h>

Collaboration diagram for ast_sip_pubsub_body_generator:

Collaboration graph
[legend]

Data Fields

void *(* allocate_body )(void *data)
 allocate body structure.
const char * body_type
void(* destroy_body )(void *body)
 Deallocate resources created for the body.
int(* generate_body_content )(void *body, void *data)
 Add content to the body of a SIP request.
struct {
   struct
ast_sip_pubsub_body_generator *   next
list
const char * subtype
 Content subtype In "plain/text", "text" is the subtype.
void(* to_string )(void *body, struct ast_str **str)
 Convert the body to a string.
const char * type
 Content type In "plain/text", "plain" is the type.

Detailed Description

Pubsub body generator.

A body generator is responsible for taking Asterisk content and converting it into a body format to be placed in an outbound SIP NOTIFY or PUBLISH request.

Definition at line 510 of file res_pjsip_pubsub.h.


Field Documentation

void*(* allocate_body)(void *data)

allocate body structure.

Body generators will have this method called when a NOTIFY or PUBLISH body needs to be created. The type returned depends on the type of content being produced for the body. The data parameter is provided by the subscription handler and will vary between different event types.

Parameters:
data The subscription data provided by the event handler
Return values:
non-NULL The allocated body
NULL Failure

Referenced by ast_sip_pubsub_generate_body_content().

const char* body_type

Type of data the body generator takes as input

Definition at line 522 of file res_pjsip_pubsub.h.

Referenced by ast_sip_pubsub_generate_body_content(), and find_body_generator().

void(* destroy_body)(void *body)

Deallocate resources created for the body.

Optional callback to destroy resources allocated for the message body.

Parameters:
body Body to be destroyed

Referenced by ast_sip_pubsub_generate_body_content().

int(* generate_body_content)(void *body, void *data)

Add content to the body of a SIP request.

The body of the request has already been allocated by the body generator's allocate_body callback.

Parameters:
body The body of the SIP request. The type is determined by the content type.
data The subscription data used to populate the body. The type is determined by the content type.

Referenced by ast_sip_pubsub_generate_body_content().

struct { ... } list

Definition at line 565 of file res_pjsip_pubsub.h.

const char* subtype

void(* to_string)(void *body, struct ast_str **str)

Convert the body to a string.

Parameters:
body The request body.
str The converted string form of the request body

Referenced by ast_sip_pubsub_generate_body_content().

const char* type


The documentation for this struct was generated from the following file:

Generated on Thu Apr 16 06:35:37 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6