From f5036fec03faf036c75438845a5ed77d9d0ea35c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 11 Feb 2008 23:55:18 +0000 Subject: [PATCH] add silly workaround to compensate for xml catch-22 with expressions with <> in them git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7593 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c index c369e5d2b4..74cd2aa015 100644 --- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c +++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c @@ -46,7 +46,7 @@ typedef enum { static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t xexten, switch_caller_extension_t **extension) { - switch_xml_t xcond, xaction; + switch_xml_t xcond, xaction, xexpression; switch_channel_t *channel = switch_core_session_get_channel(session); char *exten_name = (char *) switch_xml_attr_soft(xexten, "name"); int proceed = 0; @@ -66,8 +66,12 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * field = (char *) switch_xml_attr(xcond, "field"); - expression = (char *) switch_xml_attr_soft(xcond, "expression"); - + if ((xexpression = switch_xml_child(xcond, "expression"))) { + expression = switch_str_nil(xexpression->txt); + } else { + expression = (char *) switch_xml_attr_soft(xcond, "expression"); + } + if ((expression_expanded = switch_channel_expand_variables(channel, expression)) == expression) { expression_expanded = NULL; } else {