diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-12-11 13:06:30 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-12-11 13:06:30 +0000 |
commit | ce423d2ea47501a829711ff957e78729f38925ff (patch) | |
tree | cbeaeafaba32bb60b551c7a24979b7783a0d94d3 /main/xmldoc.c | |
parent | f46b30bd36457cf349ef18ee854cce9f4dd0daaf (diff) |
func_channel, chan_pjsip: Add CHANNEL read function support for chan_pjsip
This patch adds CHANNEL read support for chan_pjsip. This allows the dialplan
to use the CHANNEL function on a chan_pjsip channel to obtain run-time
information about the channel from the PJSIP channel driver and the PJSIP
stack. This includes:
* RTP information, including source/destination media addresses, whether or
not the media is secure, held, and other properties.
* RTCP information. This includes sets of parseable information, as well as
individual statistic attriutes.
* PJSIP information. This includes URIs, local/remote signalling addresses,
whether or not the signalling is secure, and other properties.
* The endpoint name. This can be used in conjunction with the PJSIP_ENDPOINT
function to obtain more detailed endpoint information.
Review: https://reviewboard.asterisk.org/r/3038/
........
Merged revisions 403618 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/xmldoc.c')
-rw-r--r-- | main/xmldoc.c | 108 |
1 files changed, 56 insertions, 52 deletions
diff --git a/main/xmldoc.c b/main/xmldoc.c index 8a54d6f12..7a48c8701 100644 --- a/main/xmldoc.c +++ b/main/xmldoc.c @@ -70,6 +70,7 @@ struct documentation_tree { static char *xmldoc_get_syntax_cmd(struct ast_xml_node *fixnode, const char *name, int printname); static int xmldoc_parse_enumlist(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer); +static void xmldoc_parse_parameter(struct ast_xml_node *fixnode, const char *tabs, struct ast_str **buffer); static int xmldoc_parse_info(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer); static int xmldoc_parse_para(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer); static int xmldoc_parse_specialtags(struct ast_xml_node *fixnode, const char *tabs, const char *posttabs, struct ast_str **buffer); @@ -1492,58 +1493,6 @@ static int xmldoc_parse_specialtags(struct ast_xml_node *fixnode, const char *ta /*! * \internal - * \brief Parse an 'info' tag inside an element. - * - * \param node A pointer to the 'info' xml node. - * \param tabs A string to be appended at the beginning of each line being printed - * inside 'buffer' - * \param posttabs Add this string after the content of the <para> element, if one exists - * \param String buffer to put values found inide the info element. - * - * \retval 2 if the information contained a para element, and it returned a value of 2 - * \retval 1 if information was put into the buffer - * \retval 0 if no information was put into the buffer or error - */ -static int xmldoc_parse_info(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer) -{ - const char *tech; - char *internaltabs; - int internal_ret; - int ret = 0; - - if (strcasecmp(ast_xml_node_get_name(node), "info")) { - return ret; - } - - ast_asprintf(&internaltabs, "%s ", tabs); - if (!internaltabs) { - return ret; - } - - tech = ast_xml_get_attribute(node, "tech"); - if (tech) { - ast_str_append(buffer, 0, "%s<note>Technology: %s</note>\n", internaltabs, tech); - ast_xml_free_attr(tech); - } - - ret = 1; - - for (node = ast_xml_node_get_children(node); node; node = ast_xml_node_get_next(node)) { - if (!strcasecmp(ast_xml_node_get_name(node), "enumlist")) { - xmldoc_parse_enumlist(node, internaltabs, buffer); - } else if ((internal_ret = xmldoc_parse_common_elements(node, internaltabs, posttabs, buffer))) { - if (internal_ret > ret) { - ret = internal_ret; - } - } - } - ast_free(internaltabs); - - return ret; -} - -/*! - * \internal * \brief Parse an <argument> element from the xml documentation. * * \param fixnode Pointer to the 'argument' xml node. @@ -1829,6 +1778,7 @@ static int xmldoc_parse_enum(struct ast_xml_node *fixnode, const char *tabs, str } xmldoc_parse_enumlist(node, optiontabs, buffer); + xmldoc_parse_parameter(node, optiontabs, buffer); } ast_free(optiontabs); @@ -2053,6 +2003,60 @@ static void xmldoc_parse_parameter(struct ast_xml_node *fixnode, const char *tab /*! * \internal + * \brief Parse an 'info' tag inside an element. + * + * \param node A pointer to the 'info' xml node. + * \param tabs A string to be appended at the beginning of each line being printed + * inside 'buffer' + * \param posttabs Add this string after the content of the <para> element, if one exists + * \param String buffer to put values found inide the info element. + * + * \retval 2 if the information contained a para element, and it returned a value of 2 + * \retval 1 if information was put into the buffer + * \retval 0 if no information was put into the buffer or error + */ +static int xmldoc_parse_info(struct ast_xml_node *node, const char *tabs, const char *posttabs, struct ast_str **buffer) +{ + const char *tech; + char *internaltabs; + int internal_ret; + int ret = 0; + + if (strcasecmp(ast_xml_node_get_name(node), "info")) { + return ret; + } + + ast_asprintf(&internaltabs, "%s ", tabs); + if (!internaltabs) { + return ret; + } + + tech = ast_xml_get_attribute(node, "tech"); + if (tech) { + ast_str_append(buffer, 0, "%s<note>Technology: %s</note>\n", internaltabs, tech); + ast_xml_free_attr(tech); + } + + ret = 1; + + for (node = ast_xml_node_get_children(node); node; node = ast_xml_node_get_next(node)) { + if (!strcasecmp(ast_xml_node_get_name(node), "enumlist")) { + xmldoc_parse_enumlist(node, internaltabs, buffer); + } else if (!strcasecmp(ast_xml_node_get_name(node), "parameter")) { + xmldoc_parse_parameter(node, internaltabs, buffer); + } else if ((internal_ret = xmldoc_parse_common_elements(node, internaltabs, posttabs, buffer))) { + if (internal_ret > ret) { + ret = internal_ret; + } + } + } + ast_free(internaltabs); + + return ret; +} + +/*! + * \internal * \brief Build the arguments for an item * * \param node The arguments node to parse |