29 #include <pjsip_simple.h>
32 #include "asterisk/res_pjsip.h"
33 #include "asterisk/res_pjsip_pubsub.h"
34 #include "asterisk/res_pjsip_body_generator_types.h"
38 #define MWI_TYPE "application"
39 #define MWI_SUBTYPE "simple-message-summary"
41 static void *mwi_allocate_body(
void *
data)
57 static int mwi_generate_body_content(
void *body,
void *data)
73 static void mwi_to_string(
void *body,
struct ast_str **str)
80 static void mwi_destroy_body(
void *body)
90 .subtype = MWI_SUBTYPE,
91 .body_type = AST_SIP_MESSAGE_ACCUMULATOR,
92 .allocate_body = mwi_allocate_body,
93 .generate_body_content = mwi_generate_body_content,
94 .to_string = mwi_to_string,
95 .destroy_body = mwi_destroy_body,
98 static int load_module(
void)
100 if (ast_sip_pubsub_register_body_generator(&mwi_generator)) {
106 static int unload_module(
void)
108 ast_sip_pubsub_unregister_body_generator(&mwi_generator);
112 AST_MODULE_INFO(
ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER,
"PJSIP MWI resource",
113 .support_level = AST_MODULE_SUPPORT_CORE,
115 .unload = unload_module,
117 .requires =
"res_pjsip,res_pjsip_pubsub",
Asterisk main include file. File version handling, generic pbx functions.
String manipulation functions.
const char * type
Content type In "plain/text", "plain" is the type.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Message counter used for message-summary XML bodies.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
#define ast_malloc(len)
A wrapper for malloc()
Support for dynamic strings.
Module has failed to load, may be in an inconsistent state.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
char message_account[PJSIP_MAX_URL_SIZE]