diff options
author | anthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-07 20:39:14 +0000 |
---|---|---|
committer | anthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-07 20:39:14 +0000 |
commit | c1457252403f367fda151cf89728711629176a09 (patch) | |
tree | 033ebcd77785f0886ef673f19d830339fee527e1 /apps/app_senddtmf.c | |
parent | e090e8c65cb14bc5fd1a5b2e5a33a646c4280d6c (diff) |
Created API call ast_dtmf_stream
int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digits,int between)
changed app_senddtmf.c to use this new call
added D() parameter to app_dial to allow post connect dtmf stream to be sent using above call
-Tony
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2918 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_senddtmf.c')
-rwxr-xr-x | apps/app_senddtmf.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c index 2e85b01d3..58e99b21c 100755 --- a/apps/app_senddtmf.c +++ b/apps/app_senddtmf.c @@ -43,34 +43,13 @@ static int senddtmf_exec(struct ast_channel *chan, void *data) int res = 0; struct localuser *u; char *digits = data; - struct ast_frame f; - int x; + if (!digits || !strlen(digits)) { - ast_log(LOG_WARNING, "SendDTMF requires an argument (digits or *#abcd)\n"); + ast_log(LOG_WARNING, "SendDTMF requires an argument (digits or *#aAbBcCdD)\n"); return -1; } LOCAL_USER_ADD(u); - for (x=0;x<strlen(digits);x++) { - memset(&f, 0, sizeof(f)); - f.frametype = AST_FRAME_DTMF; - f.subclass = digits[x]; - f.src = "app_senddtmf"; - if (strchr("0123456789*#abcd",digits[x])==NULL) { - ast_log(LOG_WARNING, "Illegal DTMF character in string. (0-9*#abcd allowed)\n"); - } else { - res = ast_write(chan, &f); - if (res) - break; - /* Wait 250ms */ - res = ast_safe_sleep(chan, 250); - if (res) - break; - } - } - if (!res) - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Sent digit string '%s' on %s\n", digits, chan->name); - + res = ast_dtmf_stream(chan,NULL,digits,250); LOCAL_USER_REMOVE(u); return res; } |