aboutsummaryrefslogtreecommitdiffstats
path: root/indications.c
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-16 22:37:31 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-16 22:37:31 +0000
commit342cf00fb74d7832598ad2431b3338512273959e (patch)
tree42e44ab95928950f65a80b2dd298dc79f9b82a8e /indications.c
parent40b9926da3752f8e6f5d1a23d4dd8ae8655df2b1 (diff)
dom mar 16 23:37:23 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@647 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'indications.c')
-rwxr-xr-xindications.c10
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) {