Asterisk - The Open Source Telephony Project  18.5.0
Data Fields
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. More...
 
const char * body_type
 
void(* destroy_body )(void *body)
 Deallocate resources created for the body. More...
 
int(* generate_body_content )(void *body, void *data)
 Add content to the body of a SIP request. More...
 
struct {
   struct ast_sip_pubsub_body_generator *   next
 
list
 
const char * subtype
 Content subtype In "plain/text", "text" is the subtype. More...
 
void(* to_string )(void *body, struct ast_str **str)
 Convert the body to a string. More...
 
const char * type
 Content type In "plain/text", "plain" is the type. More...
 

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 591 of file res_pjsip_pubsub.h.

Field Documentation

◆ allocate_body

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
dataThe subscription data provided by the event handler
Return values
non-NULLThe allocated body
NULLFailure

Definition at line 617 of file res_pjsip_pubsub.h.

Referenced by ast_sip_pubsub_generate_body_content().

◆ body_type

const char* body_type

Type of data the body generator takes as input

Definition at line 603 of file res_pjsip_pubsub.h.

Referenced by ast_sip_pubsub_generate_body_content(), find_body_generator(), and subscription_persistence_remove().

◆ destroy_body

void(* destroy_body) (void *body)

Deallocate resources created for the body.

Optional callback to destroy resources allocated for the message body.

Parameters
bodyBody to be destroyed

Definition at line 645 of file res_pjsip_pubsub.h.

Referenced by ast_sip_pubsub_generate_body_content().

◆ 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
bodyThe body of the SIP request. The type is determined by the content type.
dataThe subscription data used to populate the body. The type is determined by the content type.

Definition at line 629 of file res_pjsip_pubsub.h.

Referenced by ast_sip_pubsub_generate_body_content().

◆ list

struct { ... } list

◆ next

Definition at line 646 of file res_pjsip_pubsub.h.

◆ subtype

const char* subtype

◆ to_string

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

Convert the body to a string.

Parameters
bodyThe request body.
strThe converted string form of the request body

Definition at line 636 of file res_pjsip_pubsub.h.

Referenced by ast_sip_pubsub_generate_body_content().

◆ type

const char* type

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