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

« back to all changes in this revision

Viewing changes to funcs/func_cut.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:
26
26
 
27
27
#include "asterisk.h"
28
28
 
29
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40722 $")
 
29
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 87340 $")
30
30
 
31
31
#include <stdio.h>
32
32
#include <stdlib.h>
125
125
        );
126
126
 
127
127
        memset(buffer, 0, buflen); 
128
 
        
 
128
 
129
129
        parse = ast_strdupa(data);
130
130
 
131
131
        AST_STANDARD_APP_ARGS(args, parse);
145
145
                        return ERROR_NOMEM;
146
146
                }
147
147
 
148
 
                d = args.delimiter[0] ? args.delimiter[0] : '-';
 
148
                if (args.delimiter[0] == '\\') {
 
149
                        if (args.delimiter[1] == 'n')
 
150
                                d = '\n';
 
151
                        else if (args.delimiter[1] == 't')
 
152
                                d = '\t';
 
153
                        else if (args.delimiter[1] == 'r')
 
154
                                d = '\r';
 
155
                        else if (args.delimiter[1])
 
156
                                d = args.delimiter[1];
 
157
                        else
 
158
                                d = '-';
 
159
                } else if (args.delimiter[0])
 
160
                        d = args.delimiter[0];
 
161
                else
 
162
                        d = '-';
149
163
 
150
164
                /* String form of the delimiter, for use with strsep(3) */
151
165
                snprintf(ds, sizeof(ds), "%c", d);
237
251
static int acf_cut_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
238
252
{
239
253
        int ret = -1;
240
 
        struct ast_module_user *u;
 
254
        struct ast_module_user *u = NULL;
241
255
 
242
 
        u = ast_module_user_add(chan);
 
256
        if (chan) {
 
257
                ast_autoservice_start(chan);
 
258
                u = ast_module_user_add(chan);
 
259
        }
243
260
 
244
261
        switch (cut_internal(chan, data, buf, len)) {
245
262
        case ERROR_NOARG:
258
275
                ast_log(LOG_ERROR, "Unknown internal error\n");
259
276
        }
260
277
 
261
 
        ast_module_user_remove(u);
 
278
        if (chan) {
 
279
                ast_module_user_remove(u);
 
280
                ast_autoservice_stop(chan);
 
281
        }
262
282
 
263
283
        return ret;
264
284
}