~ubuntu-branches/ubuntu/karmic/asterisk/karmic

« back to all changes in this revision

Viewing changes to apps/app_playback.c

  • Committer: Bazaar Package Importer
  • Author(s): Faidon Liambotis, Tzafrir Cohen, Faidon Liambotis
  • Date: 2007-12-06 17:20:21 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206172021-pd0wrjirz3os7hia
Tags: 1:1.4.15~dfsg-1
* New upstream release (Closes: #452054)
  - Fix a potential corrupt of voicemail.conf on simultaneous PIN updates
    (Closes: #353227)

[ Tzafrir Cohen ]
* Add some sample/reference config files as documentation.
* Provide asterisk-bristuff for upgrading from Etch.
* Move libc-client to not be last, so debian/backports/xorcom.etch would
  still work.

[ Faidon Liambotis ]
* Really enable the libcap/ToS functionality; the previous patch didn't
  enable the functionality, even though the code and the libcap.so
  dependency were there. (Closes: #454342)
* Fix a minor issue with init script's stop target when running with
  safe_asterisk.
* Add chan_vpb, adding support for VoiceTronix OpenSwitch and OpenLine
  cards. (Closes: #396499)
* Fix debian/watch by using a pkg-voip wrapper to avoid upstream's silly
  redirections. (Closes: #449706)
* Use DEBVERSION as asterisk's version string.
* Disable the MD5 build sum that breaks all out-of-tree plugins (duh!).
* Create /usr/local/share/asterisk/sounds to put all site-specific
  non-modifiable sounds.
* Add a note about bugs.debian.org to the banner.
* Add noload for res_config_* since loading them results in errors and
  doesn't provide any functionality.
* News entries were added but we never shipped the file; ship NEWS.Debian.
* Add an entry to NEWS.Debian warning users about app_voicemail_*.so
  (Closes: #452596)
* Provide options in /etc/default/asterisk for configuring safe_asterisk.
  (Closes: #381786)

[ Tzafrir Cohen ]
* Provide a custom sounds directory under /var/lib - user-modifieble at
  runtime and hence not under /usr. (Closes: #337209)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "asterisk.h"
29
29
 
30
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 53399 $")
 
30
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 89618 $")
31
31
 
32
32
#include <string.h>
33
33
#include <stdlib.h>
152
152
        struct varshead head = { .first = NULL, .last = NULL };
153
153
        struct ast_var_t *n;
154
154
 
155
 
        ast_log(LOG_WARNING, "string <%s> depth <%d>\n", s, depth);
156
155
        if (depth++ > 10) {
157
156
                ast_log(LOG_WARNING, "recursion too deep, exiting\n");
158
157
                return -1;
164
163
        /* scan languages same as in file.c */
165
164
        if (a->language == NULL)
166
165
                a->language = "en";     /* default */
167
 
        ast_log(LOG_WARNING, "try <%s> in <%s>\n", s, a->language);
168
166
        lang = ast_strdupa(a->language);
169
167
        for (;;) {
170
168
                for (v = ast_variable_browse(say_cfg, lang); v ; v = v->next) {
190
188
                s = x + 1;
191
189
        if ( (x = strchr(s, ':')) )
192
190
                s = x + 1;
193
 
        ast_log(LOG_WARNING, "value is <%s>\n", s);
194
191
        n = ast_var_assign("SAY", s);
195
192
        AST_LIST_INSERT_HEAD(&head, n, entries);
196
193
 
197
194
        /* scan the body, one piece at a time */
198
 
        while ( ret <= 0 && (x = strsep(&rule, ",")) ) { /* exit on key */
 
195
        while ( !ret && (x = strsep(&rule, ",")) ) { /* exit on key */
199
196
                char fn[128];
200
197
                const char *p, *fmt, *data; /* format and data pointers */
201
198
 
206
203
                /* replace variables */
207
204
                memset(fn, 0, sizeof(fn)); /* XXX why isn't done in pbx_substitute_variables_helper! */
208
205
                pbx_substitute_variables_varshead(&head, x, fn, sizeof(fn));
209
 
                ast_log(LOG_WARNING, "doing [%s]\n", fn);
210
206
 
211
207
                /* locate prefix and data, if any */
212
208
                fmt = index(fn, ':');
245
241
                                strcpy(fn2 + l, data);
246
242
                                ret = do_say(a, fn2, options, depth);
247
243
                        }
 
244
                        
 
245
                        if (ret) {
 
246
                                break;
 
247
                        }
248
248
                }
249
249
        }
250
250
        ast_var_delete(n);