change xml_lookups to take an event as params instead of url string this will break your xml_curl scripts please update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7333 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2008-01-23 20:59:25 +00:00
1 parent 14ba0b9999
commit 1424b6c73b
16 files changed
+286 -103

No files matched your search

+14 -10
View File
@@ -95,7 +95,7 @@ static size_t file_callback(void *ptr, size_t size, size_t nmemb, void *data)
}
static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, const char *params,
static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
void *user_data)
{
char filename[512] = "";
@@ -111,7 +111,8 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
long httpRes = 0;
struct curl_slist *headers = NULL;
char hostname[256] = "";
char basic_data[512];
gethostname(hostname, sizeof(hostname));
if (!binding) {
@@ -128,15 +129,18 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
return xml;
}
data = switch_mprintf("hostname=%s&section=%s&tag_name=%s&key_name=%s&key_value=%s%s%s",
hostname,
section,
switch_str_nil(tag_name),
switch_str_nil(key_name),
switch_str_nil(key_value),
params ? strchr(params, '=') ? "&" : "&params=" : "", params ? params : "");
switch_assert(data);
switch_snprintf(basic_data, sizeof(basic_data), "hostname=%s&section=%s&tag_name=%s&key_name=%s&key_value=%s",
hostname,
section,
switch_str_nil(tag_name),
switch_str_nil(key_name),
switch_str_nil(key_value));
data = switch_event_build_param_string(params, basic_data);
switch_assert(data);
printf("XXXXXXXXXXXXXXXXXXXX\n%s\n", data);
switch_uuid_get(&uuid);
switch_uuid_format(uuid_str, &uuid);