diff options
author | Matteo Brancaleoni <mbrancaleoni@espia.it> | 2003-03-16 22:37:31 +0000 |
---|---|---|
committer | Matteo Brancaleoni <mbrancaleoni@espia.it> | 2003-03-16 22:37:31 +0000 |
commit | 61e446f04b2bdcc41f6420e3cf9ed466ed80c3ed (patch) | |
tree | 42e44ab95928950f65a80b2dd298dc79f9b82a8e /indications.c | |
parent | 7640e83360c2dfc792091caeaea05cc9fce0635c (diff) |
dom mar 16 23:37:23 CET 2003
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'indications.c')
-rwxr-xr-x | indications.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indications.c b/indications.c index a2cceb8a4..1ef2357ad 100755 --- a/indications.c +++ b/indications.c @@ -40,6 +40,7 @@ struct playtones_def { int vol; int reppos; int nitems; + int interruptible; struct playtones_item *items; }; @@ -84,7 +85,7 @@ static void * playtones_alloc(struct ast_channel *chan, void *params) ps->items = pd->items; } /* Let interrupts interrupt :) */ - chan->writeinterrupt = 1; + chan->writeinterrupt = pd->interruptible; return ps; } @@ -137,16 +138,18 @@ static struct ast_generator playtones = { generate: playtones_generator, }; -int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst) +int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst, int interruptible) { char *s, *data = strdupa(playlst); /* cute */ - struct playtones_def d = { vol, -1, 0, NULL}; + struct playtones_def d = { vol, -1, 0, 1, NULL}; char *stringp=NULL; if (!data) return -1; if (vol < 1) d.vol = 8192; + d.interruptible = interruptible; + stringp=data; s = strsep(&stringp,","); while(s && *s) { @@ -156,7 +159,6 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst) s++; else if (d.reppos == -1) d.reppos = d.nitems; - if (sscanf(s, "%d+%d/%d", &freq1, &freq2, &time) == 3) { /* f1+f2/time format */ } else if (sscanf(s, "%d+%d", &freq1, &freq2) == 2) { |