Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjlib.h>
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/res_pjsip_presence_xml.h"
Go to the source code of this file.
Functions | |
void | ast_sip_presence_exten_state_to_str (int state, char **statestring, char **pidfstate, char **pidfnote, enum ast_sip_pidf_state *local_state, unsigned int notify_early_inuse_ringing) |
Convert extension state to relevant PIDF strings. More... | |
pj_xml_attr * | ast_sip_presence_xml_create_attr (pj_pool_t *pool, pj_xml_node *node, const char *name, const char *value) |
Create XML attribute. More... | |
pj_xml_node * | ast_sip_presence_xml_create_node (pj_pool_t *pool, pj_xml_node *parent, const char *name) |
Create XML node. More... | |
void | ast_sip_presence_xml_find_node_attr (pj_pool_t *pool, pj_xml_node *parent, const char *node_name, const char *attr_name, pj_xml_node **node, pj_xml_attr **attr) |
Find an attribute within a given node. More... | |
void | ast_sip_sanitize_xml (const char *input, char *output, size_t len) |
Replace offensive XML characters with XML entities. More... | |
void ast_sip_presence_exten_state_to_str | ( | int | state, |
char ** | statestring, | ||
char ** | pidfstate, | ||
char ** | pidfnote, | ||
enum ast_sip_pidf_state * | local_state, | ||
unsigned int | notify_early_inuse_ringing | ||
) |
Convert extension state to relevant PIDF strings.
state | The extension state | |
[out] | statestring | |
[out] | pidfstate | |
[out] | pidfnote | |
[out] | local_state | |
notify_early_inuse_ringing |
Definition at line 84 of file presence_xml.c.
References AST_EXTENSION_BUSY, AST_EXTENSION_INUSE, AST_EXTENSION_NOT_INUSE, AST_EXTENSION_ONHOLD, AST_EXTENSION_RINGING, AST_EXTENSION_UNAVAILABLE, NOTIFY_CLOSED, NOTIFY_INUSE, and NOTIFY_OPEN.
Referenced by dialog_info_generate_body_content(), pidf_generate_body_content(), pidf_supplement_body(), and xpidf_generate_body_content().
pj_xml_attr * ast_sip_presence_xml_create_attr | ( | pj_pool_t * | pool, |
pj_xml_node * | node, | ||
const char * | name, | ||
const char * | value | ||
) |
Create XML attribute.
pool | Allocation pool |
node | Node to add attribute to |
name | The attribute name |
value | The attribute value |
Definition at line 140 of file presence_xml.c.
Referenced by add_eyebeam(), add_rlmi_resource(), ast_sip_presence_xml_find_node_attr(), build_rlmi_body(), dialog_info_generate_body_content(), pidf_supplement_body(), and xpidf_generate_body_content().
pj_xml_node * ast_sip_presence_xml_create_node | ( | pj_pool_t * | pool, |
pj_xml_node * | parent, | ||
const char * | name | ||
) |
Create XML node.
pool | Allocation pool |
parent | Optional node that will be parent to the created node |
name | The name for the new node |
Definition at line 152 of file presence_xml.c.
Referenced by add_eyebeam(), add_rlmi_resource(), ast_sip_presence_xml_find_node_attr(), build_rlmi_body(), dialog_info_allocate_body(), dialog_info_generate_body_content(), and pidf_supplement_body().
void ast_sip_presence_xml_find_node_attr | ( | pj_pool_t * | pool, |
pj_xml_node * | parent, | ||
const char * | node_name, | ||
const char * | attr_name, | ||
pj_xml_node ** | node, | ||
pj_xml_attr ** | attr | ||
) |
Find an attribute within a given node.
Given a starting node, this will find an attribute that belongs to a specific node. If the node does not exist, it will be created under the passed-in parent. If the attribute does not exist, then it will be created on the node with an empty string as its value.
pool | Allocation pool | |
parent | Starting node for search | |
node_name | Name of node where to find attribute | |
attr_name | Name of attribute to find | |
[out] | node | Node that was found or created |
[out] | attr | Attribute that was found or created |
Definition at line 172 of file presence_xml.c.
References ast_sip_presence_xml_create_attr(), ast_sip_presence_xml_create_node(), name, and NULL.
Referenced by xpidf_generate_body_content().
void ast_sip_sanitize_xml | ( | const char * | input, |
char * | output, | ||
size_t | len | ||
) |
Replace offensive XML characters with XML entities.
" = " < = <
= >
' = ' & = &
input | String to sanitize | |
[out] | output | Sanitized string |
len | Size of output buffer |
Definition at line 29 of file presence_xml.c.
References ast_strdupa, copy(), input(), and len().
Referenced by add_rlmi_resource(), dialog_info_generate_body_content(), pidf_generate_body_content(), pidf_supplement_body(), and xpidf_generate_body_content().