mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 04:31:50 +00:00
add xml
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1376 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -57,6 +57,23 @@ static void disast_function(switch_core_session_t *session, char *data)
|
||||
}
|
||||
|
||||
|
||||
static void xml_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_xml_t f1 = switch_xml_parse_file("/root/formula1.xml"), team, driver;
|
||||
const char *teamname;
|
||||
|
||||
for (team = switch_xml_child(f1, "team"); team; team = team->next) {
|
||||
teamname = switch_xml_attr(team, "name");
|
||||
for (driver = switch_xml_child(team, "driver"); driver; driver = driver->next) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
|
||||
"%s, %s: %s\n", switch_xml_child(driver, "name")->txt, teamname,
|
||||
switch_xml_child(driver, "points")->txt);
|
||||
}
|
||||
}
|
||||
switch_xml_free(f1);
|
||||
}
|
||||
|
||||
|
||||
static void dirtest_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
char *var, *val;
|
||||
@@ -204,11 +221,18 @@ static const switch_state_handler_table_t state_handlers = {
|
||||
};
|
||||
|
||||
|
||||
static const switch_application_interface_t xml_application_interface = {
|
||||
/*.interface_name */ "xml",
|
||||
/*.application_function */ xml_function,
|
||||
NULL, NULL, NULL,
|
||||
/*.next*/ NULL
|
||||
};
|
||||
|
||||
static const switch_application_interface_t disast_application_interface = {
|
||||
/*.interface_name */ "disast",
|
||||
/*.application_function */ disast_function,
|
||||
NULL, NULL, NULL,
|
||||
/*.next*/ NULL
|
||||
/*.next*/ &xml_application_interface
|
||||
};
|
||||
|
||||
static const switch_application_interface_t tts_application_interface = {
|
||||
|
||||
@@ -79,9 +79,9 @@ static switch_caller_extension_t *flatfile_dialplan_hunt(switch_core_session_t *
|
||||
*data = '\0';
|
||||
data++;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "invalid extension on line %d\n", cfg.lineno);
|
||||
continue;
|
||||
data = "";
|
||||
}
|
||||
|
||||
if (!extension) {
|
||||
if ((extension =
|
||||
switch_caller_extension_new(session, caller_profile->destination_number,
|
||||
|
||||
Reference in New Issue
Block a user