diff options
author | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-06-17 18:59:58 +0000 |
---|---|---|
committer | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-06-17 18:59:58 +0000 |
commit | 5f8cdb401217596181aabfc7df5d1a7dddf1bd7f (patch) | |
tree | 74be2423ef3f4064a76e54669c2eb03d0c34d6a5 /indications.c | |
parent | b1c74b765e69a13370cb848fdf93c7e426b0fb89 (diff) |
Fix the playtones app so that we can pass the tones as an argument ( we don't need to refer to a defined tone in indications.conf )
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1102 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'indications.c')
-rwxr-xr-x | indications.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indications.c b/indications.c index ccfd04e82..62500a790 100755 --- a/indications.c +++ b/indications.c @@ -143,6 +143,7 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst, char *s, *data = ast_strdupa(playlst); /* cute */ struct playtones_def d = { vol, -1, 0, 1, NULL}; char *stringp=NULL; + char *separator; if (!data) return -1; if (vol < 1) @@ -151,7 +152,13 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst, d.interruptible = interruptible; stringp=data; - s = strsep(&stringp,","); + /* the stringp/data is not null here */ + /* check if the data is separated with '|' or with ',' by default */ + if (strchr(stringp,'|')) + separator = "|"; + else + separator = ","; + s = strsep(&stringp,separator); while(s && *s) { int freq1, freq2, time; @@ -184,7 +191,7 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst, d.items[d.nitems].duration = time; d.nitems++; - s = strsep(&stringp,","); + s = strsep(&stringp,separator); } if (ast_activate_generator(chan, &playtones, &d)) { |