mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 16:15:04 +00:00
allow xml_locate to just take section
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14317 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
1c1a9a6be9
commit
37594b7ec0
@ -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)
|
|||||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
switch_event_create(¶ms, 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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user