提交 37594b7e authored 作者: Anthony Minessale's avatar Anthony Minessale

allow xml_locate to just take section

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14317 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 1c1a9a6b
...@@ -855,7 +855,7 @@ SWITCH_STANDARD_API(xml_locate_function) ...@@ -855,7 +855,7 @@ SWITCH_STANDARD_API(xml_locate_function)
goto end; goto end;
} }
if (argc < 4) { if (argc != 1 && argc != 4) {
err = "bad args"; err = "bad args";
goto end; goto end;
} }
...@@ -868,9 +868,18 @@ SWITCH_STANDARD_API(xml_locate_function) ...@@ -868,9 +868,18 @@ SWITCH_STANDARD_API(xml_locate_function)
switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS); switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
switch_assert(params); switch_assert(params);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "section", section); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "section", section);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "tag", tag);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "tag_attr_name", tag_attr_name); if (tag) {
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "tag_attr_val", tag_attr_val); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "tag", tag);
}
if (tag_attr_name) {
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "tag_attr_name", tag_attr_name);
}
if (tag_attr_val) {
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "tag_attr_val", tag_attr_val);
}
if (switch_xml_locate(section, tag, tag_attr_name, tag_attr_val, &xml, &obj, params, SWITCH_FALSE) != SWITCH_STATUS_SUCCESS) { if (switch_xml_locate(section, tag, tag_attr_name, tag_attr_val, &xml, &obj, params, SWITCH_FALSE) != SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "can't find anything\n"); stream->write_function(stream, "can't find anything\n");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论