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@7334 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
1424b6c73b
commit
591f098a14
|
@ -138,9 +138,8 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
||||||
switch_str_nil(key_value));
|
switch_str_nil(key_value));
|
||||||
|
|
||||||
data = switch_event_build_param_string(params, basic_data);
|
data = switch_event_build_param_string(params, basic_data);
|
||||||
|
|
||||||
switch_assert(data);
|
switch_assert(data);
|
||||||
printf("XXXXXXXXXXXXXXXXXXXX\n%s\n", data);
|
|
||||||
switch_uuid_get(&uuid);
|
switch_uuid_get(&uuid);
|
||||||
switch_uuid_format(uuid_str, &uuid);
|
switch_uuid_format(uuid_str, &uuid);
|
||||||
|
|
||||||
|
|
|
@ -1310,28 +1310,29 @@ SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, co
|
||||||
stream.write_function(&stream, "%s=%s&", prof_names[x], encode_buf);
|
stream.write_function(&stream, "%s=%s&", prof_names[x], encode_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hi = event->headers)) {
|
if (event) {
|
||||||
for (; hi; hi = hi->next) {
|
if ((hi = event->headers)) {
|
||||||
char *var = hi->name;
|
for (; hi; hi = hi->next) {
|
||||||
char *val = hi->value;
|
char *var = hi->name;
|
||||||
|
char *val = hi->value;
|
||||||
|
|
||||||
new_len = (strlen((char *) var) * 3) + 1;
|
new_len = (strlen((char *) var) * 3) + 1;
|
||||||
if (encode_len < new_len) {
|
if (encode_len < new_len) {
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
encode_len = new_len;
|
encode_len = new_len;
|
||||||
|
|
||||||
tmp = realloc(encode_buf, encode_len);
|
tmp = realloc(encode_buf, encode_len);
|
||||||
switch_assert(tmp);
|
switch_assert(tmp);
|
||||||
encode_buf = tmp;
|
encode_buf = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_url_encode((char *) val, encode_buf, encode_len - 1);
|
||||||
|
stream.write_function(&stream, "%s=%s&", (char *) var, encode_buf);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_url_encode((char *) val, encode_buf, encode_len - 1);
|
|
||||||
stream.write_function(&stream, "%s=%s&", (char *) var, encode_buf);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e = (char *) stream.data + (strlen((char *) stream.data) - 1);
|
e = (char *) stream.data + (strlen((char *) stream.data) - 1);
|
||||||
|
|
||||||
if (e && *e == '&') {
|
if (e && *e == '&') {
|
||||||
|
|
Loading…
Reference in New Issue