From 016263810338ac9d758e99d8317f14b974363a7f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 7 Nov 2007 20:12:26 +0000 Subject: [PATCH] parse chan vars in rss.conf git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6178 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_rss/mod_rss.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_rss/mod_rss.c b/src/mod/applications/mod_rss/mod_rss.c index b71d956d8e..27e37b7187 100644 --- a/src/mod/applications/mod_rss/mod_rss.c +++ b/src/mod/applications/mod_rss/mod_rss.c @@ -198,14 +198,31 @@ SWITCH_STANDARD_APP(rss_function) if ((feeds = switch_xml_child(cfg, "feeds"))) { for (feed = switch_xml_child(feeds, "feed"); feed; feed = feed->next) { char *name = (char *) switch_xml_attr_soft(feed, "name"); + char *expanded = NULL; + char *idx = feed->txt; + + if ((expanded = switch_channel_expand_variables(channel, idx)) == idx) { + expanded = NULL; + } else { + idx = expanded; + } if (!name) { name = "Error No Name."; } + feed_list[feed_index] = switch_core_session_strdup(session, idx); + switch_safe_free(expanded); + + if ((expanded = switch_channel_expand_variables(channel, name)) == name) { + expanded = NULL; + } else { + name = expanded; + } feed_names[feed_index] = switch_core_session_strdup(session, name); - feed_list[feed_index] = switch_core_session_strdup(session, feed->txt); + switch_safe_free(expanded); feed_index++; + } }