minor refactor

This commit is contained in:
Anthony Minessale 2010-06-23 11:47:39 -05:00
parent bcb2449937
commit 39f6c58557
1 changed files with 4 additions and 5 deletions

View File

@ -1380,6 +1380,10 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_e
char *val = p; char *val = p;
switch_url_decode(val); switch_url_decode(val);
switch_channel_set_variable(channel, tag->name, val); switch_channel_set_variable(channel, tag->name, val);
if (!strcasecmp(tag->name, "channel_name")) {
printf("name %s\n", val);
switch_channel_set_name(channel, val);
}
free(p); free(p);
} }
} }
@ -1388,7 +1392,6 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_e
if ((callflow = switch_xml_child(xml, "callflow"))) { if ((callflow = switch_xml_child(xml, "callflow"))) {
if ((tag2 = switch_xml_child(callflow, "caller_profile"))) { if ((tag2 = switch_xml_child(callflow, "caller_profile"))) {
switch_caller_profile_t *caller_profile; switch_caller_profile_t *caller_profile;
char *name;
char *tmp; char *tmp;
caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
@ -1411,10 +1414,6 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_e
caller_profile->callee_id_number = switch_core_session_strdup(session, tmp); caller_profile->callee_id_number = switch_core_session_strdup(session, tmp);
} }
if ((name = xml_find_var(tag2, "channel_name"))) {
switch_channel_set_name(channel, name);
}
if ((tag3 = switch_xml_child(callflow, "times"))) { if ((tag3 = switch_xml_child(callflow, "times"))) {
caller_profile->times = (switch_channel_timetable_t *) switch_core_session_alloc(session, sizeof(*caller_profile->times)); caller_profile->times = (switch_channel_timetable_t *) switch_core_session_alloc(session, sizeof(*caller_profile->times));