]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
parse chan vars in rss.conf
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 7 Nov 2007 20:12:26 +0000 (20:12 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 7 Nov 2007 20:12:26 +0000 (20:12 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6178 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_rss/mod_rss.c

index b71d956d8eb537b37793a37990a8dca6b0aad63a..27e37b7187dd9a5538440976d363cf70e3aa00ae 100644 (file)
@@ -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++;
+
                }
        }