aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authorcitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-07 21:14:55 +0000
committercitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-07 21:14:55 +0000
commit52ae3f42d4cd5c7d285bec82c06edd2e9c0b86f5 (patch)
tree35539a72ebb3554cef1dfd87d4a8395b3140cf70 /app.c
parentc1457252403f367fda151cf89728711629176a09 (diff)
Code cleanup
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2919 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rwxr-xr-xapp.c81
1 files changed, 40 insertions, 41 deletions
diff --git a/app.c b/app.c
index c12767b69..f9cd46b89 100755
--- a/app.c
+++ b/app.c
@@ -260,47 +260,46 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
return 0;
}
-int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digits,int between) {
- char *ptr=NULL;
- int res=0;
- struct ast_frame f;
- if(!between)
- between = 100;
-
- if(peer)
- res = ast_autoservice_start(peer);
+int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digits,int between)
+{
+ char *ptr=NULL;
+ int res=0;
+ struct ast_frame f;
+ if (!between)
+ between = 100;
- if (!res) {
- res = ast_waitfor(chan,100);
- if(res > -1) {
- for(ptr=digits;*ptr;*ptr++) {
- if(*ptr == 'w') {
- res = ast_safe_sleep(chan, 500);
- if(res)
- break;
- continue;
- }
- memset(&f, 0, sizeof(f));
- f.frametype = AST_FRAME_DTMF;
- f.subclass = *ptr;
- f.src = "ast_dtmf_stream";
- if (strchr("0123456789*#abcdABCD",*ptr)==NULL) {
- ast_log(LOG_WARNING, "Illegal DTMF character '%c' in string. (0-9*#aAbBcCdD allowed)\n",*ptr);
- }
- else {
- res = ast_write(chan, &f);
- if (res)
- break;
- /* pause between digits */
- res = ast_safe_sleep(chan,between);
- if (res)
- break;
- }
- }
- }
- if(peer)
- res = ast_autoservice_stop(peer);
- }
+ if (peer)
+ res = ast_autoservice_start(peer);
- return res;
+ if (!res) {
+ res = ast_waitfor(chan,100);
+ if (res > -1) {
+ for (ptr=digits;*ptr;*ptr++) {
+ if (*ptr == 'w') {
+ res = ast_safe_sleep(chan, 500);
+ if (res)
+ break;
+ continue;
+ }
+ memset(&f, 0, sizeof(f));
+ f.frametype = AST_FRAME_DTMF;
+ f.subclass = *ptr;
+ f.src = "ast_dtmf_stream";
+ if (strchr("0123456789*#abcdABCD",*ptr)==NULL) {
+ ast_log(LOG_WARNING, "Illegal DTMF character '%c' in string. (0-9*#aAbBcCdD allowed)\n",*ptr);
+ } else {
+ res = ast_write(chan, &f);
+ if (res)
+ break;
+ /* pause between digits */
+ res = ast_safe_sleep(chan,between);
+ if (res)
+ break;
+ }
+ }
+ }
+ if (peer)
+ res = ast_autoservice_stop(peer);
+ }
+ return res;
}