[Freeswitch-svn] [commit] r6178 - freeswitch/trunk/src/mod/applications/mod_rss

Freeswitch SVN anthm at freeswitch.org
Wed Nov 7 15:12:26 EST 2007


Author: anthm
Date: Wed Nov  7 15:12:26 2007
New Revision: 6178

Modified:
   freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c

Log:
parse chan vars in rss.conf

Modified: freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	Wed Nov  7 15:12:26 2007
@@ -198,14 +198,31 @@
 	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++;
+
 		}
 	}
 



More information about the Freeswitch-svn mailing list